/* ==========================================================================
   Magi2Free — V4 Direction B (Studio Violet + Rec Coral)
   Crisp daylight editorial-cinema design system (strict 11-color palette)
   ========================================================================== */

:root {
  --bg: #F5F4F8;
  --surface: #FFFFFF;
  --border: #DFDCEB;
  --text: #121122;
  --muted-on-bg: #54516E;
  --primary: #5236FF;
  --primary-hover: #3F24E0;
  --coral: #E03E1F;
  --do-ink: #046C4E;
  --warn-ink: #9A4D06;
  --danger: #B42318;

  /* Derived surface, ink, border, and semantic tones (zero extra literals) */
  --primary-ink: var(--surface);
  --coral-ink: var(--surface);
  --coral-bg: color-mix(in srgb, var(--coral) 10%, var(--surface));
  --coral-border: color-mix(in srgb, var(--coral) 28%, var(--surface));

  --surface-2: color-mix(in srgb, var(--text) 5%, var(--bg));
  --surface-tint: color-mix(in srgb, var(--primary) 9%, var(--surface));
  --border-strong: color-mix(in srgb, var(--text) 18%, var(--surface));
  --border-hover: color-mix(in srgb, var(--text) 34%, var(--surface));
  --text-secondary: color-mix(in srgb, var(--text) 78%, var(--surface));
  --muted: color-mix(in srgb, var(--muted-on-bg) 88%, var(--surface));
  --accent-text: color-mix(in srgb, var(--primary-hover) 88%, var(--text));
  --accent-border: color-mix(in srgb, var(--primary) 26%, var(--surface));
  --accent-hover-tint: color-mix(in srgb, var(--primary) 15%, var(--surface));

  --stage-bg: var(--text);
  --stage-border: color-mix(in srgb, var(--surface) 14%, var(--stage-bg));
  --stage-text: var(--surface);
  --stage-muted: color-mix(in srgb, var(--surface) 80%, var(--stage-bg));
  --stage-chip-bg: color-mix(in srgb, var(--surface) 9%, transparent);
  --stage-chip-border: color-mix(in srgb, var(--surface) 16%, transparent);

  --do-bg: color-mix(in srgb, var(--do-ink) 9%, var(--surface));
  --do-border: color-mix(in srgb, var(--do-ink) 28%, var(--surface));
  --warn-bg: color-mix(in srgb, var(--warn-ink) 9%, var(--surface));
  --warn-border: color-mix(in srgb, var(--warn-ink) 28%, var(--surface));
  --avoid-ink: color-mix(in srgb, var(--danger) 88%, var(--text));
  --avoid-bg: color-mix(in srgb, var(--danger) 8%, var(--surface));
  --avoid-border: color-mix(in srgb, var(--danger) 26%, var(--surface));
  --danger-hover: color-mix(in srgb, var(--danger) 84%, var(--text));

  /* Standardized 3-tier radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-pill: 9999px;

  --shadow-sm: 0 1px 2px color-mix(in srgb, var(--text) 5%, transparent);
  --shadow-lg: 0 16px 38px -14px color-mix(in srgb, var(--text) 12%, transparent);

  /* Typography — Sora (600/700) + DM Sans (400/500/600) + Geist Mono (400/500) */
  --font-display: 'Sora', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-sans: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* 8-token type scale (12px hard floor) */
  --fs-2xs: 0.75rem;    /* 12px mono meta, badges */
  --fs-xs: 0.8125rem;   /* 13px labels, tabs, chips, helper */
  --fs-sm: 0.875rem;    /* 14px secondary btn, table, captions */
  --fs-base: 1rem;      /* 16px body */
  --fs-lead: 1.0625rem; /* 17px hero sub, section lead */
  --fs-h3: 1.25rem;     /* 20px card & subsection titles */
  --fs-h2: clamp(1.625rem, 1.15rem + 1.3vw, 2.125rem); /* 26 -> 34px */
  --fs-h1: clamp(1.875rem, 1.05rem + 2.1vw, 2.625rem); /* 30 -> 42px */

  --lh-tight: 1.06;
  --lh-snug: 1.18;
  --lh-ui: 1.35;
  --lh-body: 1.6;

  --tr-h1: -0.026em;
  --tr-h2: -0.02em;
  --tr-ui: -0.005em;
  --tr-caps: 0.06em;

  --container: 1240px;
  --gutter: 24px;
  --header-h: 60px;
}

/* ==========================================================================
   Base Reset & Accessibility
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background-color: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background-color: var(--bg);
  background-image: radial-gradient(ellipse 84% 400px at 50% -140px, color-mix(in srgb, var(--primary) 8%, transparent), transparent 72%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main#main-content {
  flex: 1 0 auto;
  width: 100%;
  min-width: 0;
}

img, svg, video, canvas {
  max-width: 100%;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text);
  margin-top: 0;
}

h1 {
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-h1);
}

h2 {
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-h2);
}

h3, h4 {
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: -0.012em;
}

h2[id],
h3[id],
section[id] {
  scroll-margin-top: 76px;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-hover);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--primary);
  color: var(--primary-ink);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
}

.skip-link:focus-visible {
  top: 12px;
}

/* Shared Layout Container & Eyebrow */
.site-container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--accent-text);
  line-height: 1.3;
}

/* ==========================================================================
   Sitewide Buttons (Single Studio Violet Primary Accent)
   ========================================================================== */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: var(--tr-ui);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 120ms ease;
}

.btn-primary {
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  background: var(--primary);
  color: var(--primary-ink);
  border: 1px solid var(--primary);
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--primary) 62%, transparent);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--primary-ink);
  box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--primary) 65%, transparent);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  font-size: var(--fs-sm);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--primary);
  color: var(--text);
}

.btn-secondary:active {
  transform: translateY(1px);
}

/* ==========================================================================
   Header — Crisp 60px Frosted White Sticky Bar (3-Col Centered 3-Item Nav)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: calc(var(--header-h) - 1px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
}

.brand img,
.brand svg {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  display: block;
  flex-shrink: 0;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h3);
  letter-spacing: var(--tr-h1);
  line-height: 1;
  color: var(--text);
}

.wm-accent {
  color: var(--primary);
}

.site-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  color: var(--muted-on-bg);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: var(--tr-ui);
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  background: var(--surface-2);
  border-color: var(--border);
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-header-auth,
.btn-header-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 15px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: var(--tr-ui);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

/* Crisp ghost Sign in button — keeps Generate Video the sole violet primary above the fold */
.btn-header-auth {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-header-auth:hover {
  background: var(--surface-2);
  border-color: var(--primary);
  color: var(--text);
}

.btn-header-ghost {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

.btn-header-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-hover);
}

.member-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.member-pill:hover {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--text);
}

.member-pill[aria-current="page"] {
  background: var(--surface-tint);
  border-color: var(--accent-border);
  color: var(--accent-text);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.menu-toggle:hover {
  border-color: var(--primary);
  background: var(--surface-2);
}

.menu-bars {
  width: 18px;
  height: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.menu-bars span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: var(--r-pill);
  background: currentColor;
  transition: transform 160ms ease, opacity 160ms ease;
}

.menu-toggle[aria-expanded="true"] .menu-bars span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-bars span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-bars span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Navigation Drawer */
.mobile-drawer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 12px var(--gutter) 16px;
  box-shadow: var(--shadow-lg);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: var(--fs-base);
  font-weight: 600;
  text-decoration: none;
}

.mobile-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.mobile-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  background: var(--surface-2);
  border-color: var(--border);
}

.mobile-auth {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.mobile-auth:not(:has(> :not([hidden]))) {
  display: none;
}

.mobile-auth .btn-header-auth,
.mobile-auth .btn-header-ghost {
  min-height: 44px;
  padding: 10px 18px;
}

/* ==========================================================================
   Tool Homepage — Compact Centered Hero + Rec Coral Timecode Badge
   ========================================================================== */
.studio-hero {
  text-align: center;
  padding: 8px 0 10px;
}

.hero-tc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 3px 11px;
  margin: 0 auto 6px;
  border-radius: var(--r-pill);
  background: var(--coral);
  color: var(--coral-ink);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  line-height: 1.2;
}

.tc-rec-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--coral-ink);
  flex-shrink: 0;
}

.hero-title {
  margin: 0 0 4px;
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-h1);
  color: var(--text);
}

.hero-subtitle {
  max-width: 880px;
  margin: 0 auto 10px;
  color: var(--muted-on-bg);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: var(--lh-ui);
  text-wrap: balance;
}

.hero-trust {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

.hero-trust li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 6px 14px 6px 9px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 2px 8px -3px color-mix(in srgb, var(--text) 10%, transparent), inset 0 1px 0 color-mix(in srgb, var(--surface) 92%, transparent);
  letter-spacing: -0.005em;
  transition: transform 150ms cubic-bezier(0.22, 1, 0.36, 1), border-color 150ms ease, box-shadow 150ms ease;
}

.hero-trust li:hover {
  transform: translateY(-1px);
  border-color: var(--accent-border);
  box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--primary) 18%, transparent);
}

.hero-trust li:first-child {
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 6%, var(--surface)) 0%, var(--surface-tint) 100%);
  border-color: var(--accent-border);
  color: var(--accent-text);
}

.hero-pill-ico {
  width: 19px;
  height: 19px;
  border-radius: var(--r-pill);
  background: var(--do-bg);
  color: var(--do-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-trust li:first-child .hero-pill-ico {
  background: var(--primary);
  color: var(--primary-ink);
}

.hero-trust svg {
  width: 11px;
  height: 11px;
  color: currentColor;
  flex-shrink: 0;
}

/* Backward-compatible fallback if hero_badges is supplied */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

/* Workbench Shell — Centered 1240px Alignment */
.workbench-shell {
  width: 100%;
  min-width: 0;
  margin: 0 0 48px;
  scroll-margin-top: 76px;
}

.workbench-shell > [data-gf-tool] {
  width: 100%;
  min-width: 0;
}

/* Minimal Tool Mode (e.g. /phone-upload) */
.tool-page-minimal {
  max-width: 560px;
  padding-top: 24px;
  padding-bottom: 48px;
}

.minimal-tool-shell {
  width: 100%;
  min-width: 0;
}

.minimal-tool-head {
  text-align: center;
  margin-bottom: 16px;
}

.minimal-tool-title {
  margin: 0 0 6px;
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-h2);
  color: var(--text);
}

.minimal-tool-sub {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-ui);
  color: var(--muted-on-bg);
  text-wrap: balance;
}

.minimal-tool-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  line-height: var(--lh-body);
  color: var(--muted-on-bg);
  text-align: center;
}

.minimal-tool-note:empty {
  display: none;
}

.minimal-tool-note p {
  margin: 0 0 8px;
  color: var(--muted-on-bg);
}

.minimal-tool-note p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   Editorial Prose & 96px Section Rhythm (Homepage, Guide & Policy Pages)
   ========================================================================== */
.home-sections {
  width: 100%;
  min-width: 0;
}

.home-sections > h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-h2);
  margin: 48px 0 24px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.home-sections > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.home-sections > p {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
}

/* Centered Section Intro Helper (used above Anatomy / Visual Guide blocks) */
.section-head,
.anatomy-head,
.guide-section-head {
  text-align: center;
  max-width: 780px;
  margin: 48px auto 24px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.home-sections > .section-head:first-child,
.home-sections > .anatomy-head:first-child,
.article-card > .guide-section-head:first-child,
.article-card > .section-head:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.section-head h2,
.anatomy-head h2,
.guide-section-head h2 {
  margin: 8px 0 8px;
  padding: 0;
  border: none;
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-h2);
  color: var(--text);
}

.section-head p,
.anatomy-head p,
.anatomy-lead,
.guide-section-head p {
  margin: 0 auto;
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--text-secondary);
  text-wrap: balance;
}

/* Editorial Split (12-col: 5/12 H2 + 7/12 17px lead) */
.editorial-split {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px 32px;
  align-items: start;
  margin: 48px 0 24px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.home-sections > .editorial-split:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.editorial-split > :first-child {
  grid-column: 1 / span 5;
  min-width: 0;
}

.editorial-split > :nth-child(2) {
  grid-column: 6 / -1;
  min-width: 0;
}

.editorial-split h2 {
  margin: 0;
  padding: 0;
  border: none;
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-h2);
  color: var(--text);
  text-wrap: balance;
}

.editorial-split p,
.editorial-lead,
.editorial-split-lead {
  margin: 0;
  font-size: var(--fs-lead);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

.editorial-split p + p {
  margin-top: 12px;
}

.article-card h2,
.faq-header h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-h2);
  color: var(--text);
}

.article-card h2 {
  margin: 44px 0 18px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.article-card > h2:first-child,
.doc-page.is-wide .article-card > h2:first-of-type,
.doc-page:has(.pricing-grid) .article-card > h2:first-of-type,
.doc-page:has(.formula-grid) .article-card > h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.doc-page:has(.pricing-grid) .article-card > h2,
.doc-page:has(.formula-grid) .article-card > h2 {
  text-align: center;
}

.doc-page:has(.formula-grid) .article-card > h2 + p {
  text-align: center;
  max-width: 760px;
  margin: -8px auto 24px;
  text-wrap: balance;
}

.home-sections h3,
.article-card h3,
.policy-prose h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: -0.012em;
  margin: 24px 0 10px;
  color: var(--text);
}

.article-card p,
.policy-prose p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  overflow-wrap: break-word;
}

.home-sections strong,
.article-card strong,
.policy-prose strong {
  color: var(--text);
  font-weight: 600;
}

.home-sections ul,
.home-sections ol,
.article-card ul,
.article-card ol,
.policy-prose ul,
.policy-prose ol {
  margin: 0 0 20px;
  padding-left: 22px;
  color: var(--text-secondary);
}

.home-sections li,
.article-card li,
.policy-prose li {
  margin-bottom: 8px;
  line-height: var(--lh-body);
}

.home-sections blockquote,
.article-card blockquote,
.policy-prose blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--r-sm);
  color: var(--text);
}

.home-sections blockquote p:last-child,
.article-card blockquote p:last-child,
.policy-prose blockquote p:last-child {
  margin-bottom: 0;
}

.home-sections code,
.article-card code,
.policy-prose code {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  background: var(--surface-2);
  color: var(--accent-text);
  padding: 2px 7px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

.home-sections pre,
.article-card pre,
.policy-prose pre {
  margin: 20px 0;
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--text);
}

.home-sections pre code,
.article-card pre code,
.policy-prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ==========================================================================
   V4 Visual 3-Track Audio-Video Anatomy Diagram (Homepage)
   ========================================================================== */
.anatomy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px;
  margin: 24px 0 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.anatomy-ruler {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted-on-bg);
}

.anatomy-track {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.anatomy-track-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.anatomy-track-label svg,
.anatomy-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--primary);
}

.anatomy-track-label.is-voice svg,
.anatomy-track-label.is-voice .anatomy-icon {
  color: var(--coral);
}

.anatomy-track-label.is-sfx svg,
.anatomy-track-label.is-sfx .anatomy-icon {
  color: var(--do-ink);
}

.anatomy-beats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.anatomy-beats.is-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.anatomy-beats.is-full,
.anatomy-beats:has(> :only-child) {
  grid-template-columns: 1fr;
}

.anatomy-beat {
  border-radius: var(--r-sm);
  padding: 10px 12px;
  background: var(--surface-tint);
  border: 1px solid var(--accent-border);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: var(--lh-ui);
  min-width: 0;
}

.anatomy-beat.is-muted,
.anatomy-beat.is-pause {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--muted-on-bg);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
}

.anatomy-beat.is-voice {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--coral-ink);
  font-weight: 600;
}

.anatomy-beat.is-sfx {
  background: var(--do-bg);
  border-color: var(--do-border);
  color: var(--do-ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}

.anatomy-beat.is-sfx .anatomy-sfx-cue,
.anatomy-beat.is-sfx strong {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  color: var(--do-ink);
}

/* ==========================================================================
   V4 Visual Prompt Guide Components (Formula, Compare, Timelines, Diagrams)
   ========================================================================== */
.formula-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px;
  margin: 0 0 32px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.formula-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}

.formula-card-head h2,
.formula-card-head h3 {
  margin: 0;
  padding: 0;
  border: none;
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--text);
}

.formula-card-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  color: var(--muted-on-bg);
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.article-card > .formula-grid {
  margin: 20px 0 32px;
}

.formula-step {
  border-radius: var(--r-sm);
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.formula-step.is-tc {
  background: var(--surface-tint);
  border-color: var(--accent-border);
}

.formula-step.is-sub {
  background: var(--surface);
  border-color: var(--border);
}

.formula-step.is-cam {
  background: var(--surface-2);
  border-color: var(--border);
}

.formula-step.is-voice {
  background: var(--coral-bg);
  border-color: var(--coral-border);
}

.formula-step.is-sfx {
  background: var(--do-bg);
  border-color: var(--do-border);
}

.formula-num,
.formula-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--muted-on-bg);
}

.formula-step.is-tc .formula-num,
.formula-step.is-tc .formula-tag {
  color: var(--accent-text);
}

.formula-step.is-voice .formula-num,
.formula-step.is-voice .formula-tag {
  color: var(--coral);
}

.formula-step.is-sfx .formula-num,
.formula-step.is-sfx .formula-tag {
  color: var(--do-ink);
}

.formula-title,
.formula-step h3,
.formula-step strong {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: var(--lh-ui);
  color: var(--text);
}

.formula-step p {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.48;
  color: var(--text-secondary);
}

/* Weak vs. Director Prompt Comparison Cards (.compare-grid) */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 20px 0 36px;
}

.compare-card {
  border-radius: var(--r-md);
  padding: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.compare-card.is-weak {
  background: var(--avoid-bg);
  border-color: var(--avoid-border);
}

.compare-card.is-pro {
  background: var(--do-bg);
  border-color: var(--do-border);
}

.compare-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.compare-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
}

.compare-card.is-weak .compare-badge {
  color: var(--avoid-ink);
  border-color: var(--avoid-border);
}

.compare-card.is-pro .compare-badge {
  color: var(--do-ink);
  border-color: var(--do-border);
}

.compare-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  color: var(--muted-on-bg);
}

.compare-card.is-weak .compare-meta {
  color: var(--avoid-ink);
}

.compare-prompt,
.compare-quote {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.58;
  color: var(--text);
}

.compare-card ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compare-card li {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.compare-card.is-weak li {
  color: var(--avoid-ink);
}

.compare-card.is-pro li {
  color: var(--do-ink);
}

.try-studio-link,
.compare-try {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.try-studio-link:hover,
.compare-try:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Multi-Shot Timeline Cards (.timeline-stack, .timeline-grid & .timeline-card) */
.timeline-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 20px 0 36px;
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 20px 0 36px;
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.article-card > .timeline-card {
  margin: 0 0 20px;
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.timeline-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.timeline-card h3 {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--text);
}

.timeline-spec {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  color: var(--muted-on-bg);
}

.timeline-beats,
.timeline-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-beat,
.timeline-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.timeline-tc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  background: var(--surface-tint);
  border: 1px solid var(--accent-border);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--accent-text);
  white-space: nowrap;
}

.timeline-beat-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.timeline-beat p,
.timeline-row p {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--text-secondary);
}

.timeline-dialogue {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  background: var(--coral-bg);
  border: 1px solid var(--coral-border);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text);
}

.timeline-audio,
.timeline-foot {
  margin-top: auto;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--do-bg);
  border: 1px solid var(--do-border);
  font-size: var(--fs-xs);
  line-height: 1.48;
  color: var(--do-ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.timeline-audio p,
.timeline-foot p {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--do-ink);
}

.guide-demo-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  background: var(--text);
  display: block;
  margin: 12px 0 6px;
}

.guide-demo-stage {
  position: relative;
  width: 100%;
  margin: 12px 0 6px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--stage-bg, #121122);
}

.guide-demo-stage .guide-demo-video {
  margin: 0;
  border-radius: 0;
}

.guide-demo-stage.is-portrait {
  display: grid;
  place-items: center;
  min-height: 360px;
}

.guide-demo-stage.is-portrait .guide-demo-video {
  width: auto;
  max-width: 100%;
  max-height: 460px;
  aspect-ratio: 9 / 16;
  object-fit: contain;
}

.guide-demo-refs {
  position: absolute;
  left: 10px;
  bottom: 52px;
  z-index: 3;
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  padding: 5px 8px 5px 5px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--stage-bg, #121122) 78%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.guide-demo-refs.is-compact {
  padding: 4px;
}

.guide-demo-ref-thumb {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.86);
  background: var(--stage-bg, #121122);
  flex: 0 0 auto;
}

.guide-demo-ref-thumb.is-portrait {
  width: 46px;
  height: 68px;
}

.guide-demo-ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
}

.guide-demo-ref-tag {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  padding: 0 2px;
  border-radius: 4px;
  background: rgba(18, 17, 34, 0.84);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
}

.guide-demo-refs-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 2px 1px;
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.guide-demo-refs-meta strong {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
}

.guide-demo-refs-meta span {
  opacity: 0.84;
}

@media (max-width: 640px) {
  .guide-demo-refs {
    bottom: 48px;
    left: 8px;
    padding: 4px;
    gap: 4px;
  }
  .guide-demo-ref-thumb {
    width: 38px;
    height: 38px;
  }
  .guide-demo-ref-thumb.is-portrait {
    width: 42px;
    height: 60px;
  }
  .guide-demo-refs-meta {
    display: none;
  }
}

.timeline-card .guide-demo-cap,
.guide-demo-cap {
  font-size: var(--fs-2xs);
  line-height: var(--lh-ui);
  color: var(--muted-on-bg);
  margin: 0 0 12px;
}

/* Visual Workflow Diagrams (I2V & Multi-Ref: .diagram-grid & .diagram-card) */
.diagram-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 20px 0 36px;
}

.diagram-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.diagram-card h3 {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--text);
}

.diagram-card > p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

.flow-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.flow-node {
  border-radius: var(--r-sm);
  padding: 12px 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.flow-node.is-primary {
  border-color: var(--accent-border);
  background: var(--surface-tint);
}

.flow-node.is-dashed {
  border-style: dashed;
}

.flow-node.is-dark,
.flow-node.is-output {
  background: var(--stage-bg);
  border-color: var(--stage-border);
  color: var(--stage-text);
}

.flow-node strong,
.flow-node-title {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
}

.flow-node.is-primary strong,
.flow-node.is-primary .flow-node-title {
  color: var(--accent-text);
}

.flow-node.is-dark strong,
.flow-node.is-dark .flow-node-title,
.flow-node.is-output strong,
.flow-node.is-output .flow-node-title {
  color: var(--stage-text);
}

.flow-node span,
.flow-node-sub {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--muted-on-bg);
}

.flow-node.is-dark span,
.flow-node.is-dark .flow-node-sub,
.flow-node.is-output span,
.flow-node.is-output .flow-node-sub {
  color: var(--stage-muted);
}

.flow-arrow {
  text-align: center;
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  color: var(--primary);
}

.flow-arrow strong {
  color: var(--primary);
  font-weight: 600;
}

.flow-arrow small,
.flow-arrow span {
  font-family: var(--font-sans);
  font-size: var(--fs-2xs);
  color: var(--muted-on-bg);
}

.ref-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ref-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-tint);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  line-height: 1.3;
}

.ref-pill.is-tc {
  background: var(--surface-tint);
  border-color: var(--accent-border);
  color: var(--accent-text);
}

.ref-pill.is-warn,
.ref-pill.is-coral,
.ref-pill.is-voice {
  background: var(--coral-bg);
  border-color: var(--coral-border);
  color: var(--coral);
}

.ref-pill.is-ok,
.ref-pill.is-sfx {
  background: var(--do-bg);
  border-color: var(--do-border);
  color: var(--do-ink);
}

/* ==========================================================================
   Homepage Editorial Studio Components (Aligned to 1240px)
   ========================================================================== */

/* 1. 3-Column Daylight Mode Showcase Cards (.showcase-cards) */
.showcase-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 24px 0 32px;
}

.showcase-cards > *,
.showcase-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.showcase-cards > *:hover,
.showcase-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-lg);
}

.showcase-card-head,
.showcase-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.showcase-card-kicker,
.showcase-mode {
  display: inline-block;
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--accent-text);
  line-height: 1.3;
}

.showcase-card h3,
.showcase-cards h3 {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: -0.012em;
  color: var(--text);
}

.showcase-card p,
.showcase-cards p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

.showcase-media {
  position: relative;
  width: 100%;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.showcase-media video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  background: var(--stage-bg);
  border-radius: var(--r-sm);
}

.showcase-flow,
.showcase-io {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.showcase-io p {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--text-secondary);
}

.showcase-io p + p {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.showcase-io strong {
  color: var(--text);
  font-weight: 600;
}

.showcase-flow-row,
.showcase-io-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.showcase-flow-row + .showcase-flow-row,
.showcase-io-row + .showcase-io-row {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.showcase-flow-label,
.showcase-io-label {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--muted-on-bg);
}

.showcase-flow-val,
.showcase-io-val {
  font-size: var(--fs-xs);
  line-height: var(--lh-ui);
  color: var(--text);
}

.showcase-prompt {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--text);
}

.showcase-card .showcase-specs,
.showcase-card .showcase-meta {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted-on-bg);
}

.showcase-card .showcase-specs span,
.showcase-card .showcase-meta span {
  padding: 0;
  border: none;
  background: none;
  color: var(--muted-on-bg);
}

/* Legacy .showcase-split daylight fallback */
.showcase-split {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px;
  margin: 24px 0 32px;
  box-shadow: var(--shadow-sm);
}

.showcase-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.showcase-tabs button,
.showcase-tabs [role="tab"] {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 16px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-on-bg);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.showcase-tabs button:hover,
.showcase-tabs [role="tab"]:hover {
  color: var(--text);
}

.showcase-tabs button[aria-selected="true"],
.showcase-tabs [role="tab"][aria-selected="true"],
.showcase-tabs .is-active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.showcase-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: stretch;
}

.showcase-split:has(> .showcase-input) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: stretch;
}

.showcase-split:has(> .showcase-input) > .showcase-tabs {
  grid-column: 1 / -1;
  justify-self: start;
  margin-bottom: 0;
}

.showcase-panel .showcase-row,
.showcase-panel .showcase-pair,
.showcase-panel .showcase-columns,
.showcase-panel .showcase-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px;
  align-items: stretch;
}

.showcase-input,
.showcase-output {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.showcase-output {
  background: var(--surface);
  justify-content: space-between;
}

.showcase-input h3,
.showcase-input h4,
.showcase-output h3,
.showcase-output h4 {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--text);
}

.showcase-input p,
.showcase-output p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

.showcase-input ul,
.showcase-input ol,
.showcase-output ul,
.showcase-output ol {
  margin: 0;
  padding-left: 18px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.showcase-input li,
.showcase-output li {
  margin-bottom: 6px;
}

.showcase-input li:last-child,
.showcase-output li:last-child {
  margin-bottom: 0;
}

.showcase-label,
.showcase-kicker {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--accent-text);
  line-height: 1.3;
}

.showcase-specs,
.showcase-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.showcase-specs span,
.showcase-meta span,
.showcase-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.prompt-strip {
  grid-column: 1 / -1;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prompt-strip p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--text);
}

.prompt-strip strong,
.prompt-strip .prompt-strip-label {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--muted-on-bg);
}

/* 2. 4-Column Capability Grid + Duotone Icon Badges (.cap-grid, .cap-icon) */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 24px 0 8px;
}

.cap-grid > *,
.cap-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.cap-grid > *:hover,
.cap-card:hover {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-lg);
}

/* Duotone Violet Icon Badge (plus optional coral / emerald accents) */
.cap-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-sm);
  background: var(--surface-tint);
  border: 1px solid var(--accent-border);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.cap-icon.is-coral {
  background: var(--coral-bg);
  border-color: var(--coral-border);
  color: var(--coral);
}

.cap-icon.is-ok {
  background: var(--do-bg);
  border-color: var(--do-border);
  color: var(--do-ink);
}

.cap-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.cap-card h3,
.cap-grid h3,
.cap-grid h4 {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: -0.012em;
  color: var(--text);
}

.cap-card p,
.cap-grid p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--text-secondary);
  flex: 1 1 auto;
}

/* Plain mono kicker */
.cap-kicker,
.cap-tag {
  display: inline-block;
  align-self: flex-start;
  margin: 2px 0 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--muted-on-bg);
  line-height: 1.3;
}

/* 3. Horizontal 3-Step Workflow (.steps-row & .steps-timeline alias) */
.steps-row,
.steps-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 24px 0 32px;
  padding: 0;
  list-style: none;
}

.steps-row > *,
.steps-timeline > *,
.step-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.steps-row > :not(:last-child)::after,
.steps-timeline > :not(:last-child)::after {
  content: "";
  position: absolute;
  top: 42px;
  left: 100%;
  width: 24px;
  height: 1px;
  background: var(--border-strong);
  pointer-events: none;
}

.step-badge,
.step-num,
.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--surface-tint);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.steps-row h3,
.steps-timeline h3,
.step-card h3 {
  margin: 4px 0 0;
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: -0.012em;
  color: var(--text);
}

.steps-row p,
.steps-timeline p,
.step-card p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

/* 4. Compact Horizontal Changelog Bar (.whats-new) */
.whats-new {
  margin: 48px 0 24px;
  padding: 18px 22px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px 24px;
}

.whats-new-head,
.whats-new-label,
.whats-new > strong,
.whats-new > h2,
.whats-new > h3 {
  margin: 0;
  padding: 2px 0 0;
  border: none;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--accent-text);
  white-space: nowrap;
}

.whats-new-list,
.whats-new ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 22px;
  min-width: 0;
}

.whats-new-item,
.whats-new li {
  display: block;
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.52;
  color: var(--text-secondary);
}

.whats-new p {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.52;
  color: var(--text-secondary);
}

.whats-new time,
.whats-new-date {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted-on-bg);
  white-space: nowrap;
}

.whats-new-item strong,
.whats-new li strong {
  color: var(--text);
  font-weight: 600;
}

/* 5. 2-Column Do / Avoid Comparison (.do-avoid-grid, .do-card, .avoid-card) */
.do-avoid-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 24px 0 28px;
}

.do-card,
.avoid-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.do-card {
  border-color: var(--do-border);
}

.avoid-card {
  border-color: var(--avoid-border);
}

.do-card h3,
.avoid-card h3 {
  margin: 0;
  padding: 14px 22px;
  font-size: var(--fs-base);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.do-card h3 {
  background: var(--do-bg);
  color: var(--do-ink);
  border-bottom: 1px solid var(--do-border);
}

.do-card h3::before {
  content: "\2713";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--do-ink);
  color: var(--surface);
  font-size: var(--fs-2xs);
  font-weight: 600;
  flex-shrink: 0;
}

.avoid-card h3 {
  background: var(--avoid-bg);
  color: var(--avoid-ink);
  border-bottom: 1px solid var(--avoid-border);
}

.avoid-card h3::before {
  content: "\00D7";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  background: var(--avoid-ink);
  color: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 600;
  flex-shrink: 0;
}

.do-card ul,
.avoid-card ul {
  margin: 0;
  padding: 18px 22px 22px 38px;
  color: var(--text-secondary);
}

.do-card li,
.avoid-card li {
  margin-bottom: 10px;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
}

.do-card li:last-child,
.avoid-card li:last-child {
  margin-bottom: 0;
}

/* 6. Clean White Responsive Tables (.table-wrap) */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
  font-size: var(--fs-sm);
  text-align: left;
}

.table-wrap thead th {
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tr-ui);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table-wrap tbody td,
.table-wrap tbody th {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
  line-height: var(--lh-body);
}

.table-wrap tbody tr:last-child td,
.table-wrap tbody tr:last-child th {
  border-bottom: none;
}

.table-wrap tbody tr:hover {
  background: var(--bg);
}

.table-wrap tbody td:first-child,
.table-wrap tbody th[scope="row"] {
  color: var(--text);
  font-weight: 600;
  width: 28%;
}

/* ==========================================================================
   FAQ Accordion (Centered 800px Single-Column Daylight Cards)
   ========================================================================== */
.faq-section {
  max-width: 800px;
  margin: 48px auto 0;
  padding-top: 48px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 76px;
}

.faq-header {
  text-align: center;
  margin-bottom: 24px;
}

.faq-header h2 {
  margin: 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.faq-item[open] {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.faq-item summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 16px 22px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: var(--lh-ui);
  color: var(--text);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary:hover {
  color: var(--primary);
}

.faq-q {
  flex: 1 1 auto;
  min-width: 0;
}

.faq-icon {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: background-color 160ms ease, color 160ms ease, transform 200ms ease;
}

.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: currentColor;
  border-radius: var(--r-pill);
  transform: translate(-50%, -50%);
}

.faq-icon::before {
  width: 12px;
  height: 1.75px;
}

.faq-icon::after {
  width: 1.75px;
  height: 12px;
}

.faq-item[open] .faq-icon {
  background: var(--surface-tint);
  color: var(--primary);
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 22px 20px;
}

.faq-answer p {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
}

/* ==========================================================================
   Bottom Studio CTA Banner (.cta-band)
   ========================================================================== */
.cta-band {
  margin: 48px 0 64px;
  padding: 32px 36px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--surface-tint) 0%, color-mix(in srgb, var(--surface-tint) 45%, var(--surface)) 58%, var(--surface) 100%);
  border: 1px solid var(--accent-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cta-band-copy {
  flex: 1 1 360px;
  min-width: 0;
}

.cta-band-title {
  margin: 8px 0 6px;
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-h2);
  color: var(--text);
}

.cta-band-desc {
  margin: 0;
  max-width: 58ch;
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

.cta-band-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   Breadcrumbs & Content Page (page.html — Centered Hero, Wide 1240px)
   ========================================================================== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 20px 0 10px;
  font-size: var(--fs-sm);
  color: var(--muted-on-bg);
}

.breadcrumb a {
  color: var(--muted-on-bg);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.bc-sep {
  color: var(--border-hover);
}

.breadcrumb [aria-current="page"] {
  color: var(--text);
  font-weight: 500;
}

.doc-page {
  max-width: calc(860px + (var(--gutter) * 2));
}

.doc-page.is-wide,
.doc-page:has(.pricing-grid),
.doc-page:has(.formula-grid),
.doc-page:has(.account-shell) {
  max-width: var(--container);
}

.doc-page.is-wide .article-card,
.doc-page:has(.pricing-grid) .article-card,
.doc-page:has(.formula-grid) .article-card,
.doc-page:has(.account-shell) .article-card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.doc-page.is-wide .faq-section,
.doc-page:has(.pricing-grid) .faq-section,
.doc-page:has(.formula-grid) .faq-section {
  max-width: 800px;
}

/* Symmetrical Centered Inner-Page Hero (Pricing, Prompt Guide, Account) */
.page-hero {
  padding: 10px 0 24px;
  text-align: center;
  max-width: 820px;
  margin: 0 auto;
}

.page-hero h1 {
  margin: 10px 0 10px;
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-h1);
}

.page-intro {
  max-width: 780px;
  margin: 0 auto 10px;
  font-size: var(--fs-lead);
  line-height: var(--lh-body);
  color: var(--text-secondary);
  text-wrap: balance;
}

.meta-line {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted-on-bg);
}

.meta-line span {
  color: var(--text);
  font-weight: 500;
}

.page-foot-meta {
  margin: -36px 0 48px;
  text-align: center;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
}

.doc-page .faq-section {
  max-width: 100%;
  margin-top: 48px;
}

/* ==========================================================================
   Pricing Page (/pricing — Centered Hero/Tabs + Usage Strip + 3-Col Yearly)
   ========================================================================== */

/* Compact Neutral Pay Notice (zero 4px brown bar; clock icon in --warn-ink) */
.pay-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  max-width: 980px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  margin: 0 auto 22px;
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: var(--lh-ui);
}

.pay-notice-main,
.pay-notice-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 260px;
  min-width: 0;
}

.pay-notice svg,
.pay-notice-icon {
  width: 18px;
  height: 18px;
  color: var(--warn-ink);
  flex-shrink: 0;
}

.pay-notice strong {
  color: var(--text);
  font-weight: 600;
}

.pay-notice p,
.pay-notice-text {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: var(--lh-ui);
  color: var(--text);
}

.pay-notice-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.pay-notice .btn-primary,
.pay-notice button[data-gf-login] {
  min-height: 36px;
  padding: 7px 14px;
  font-size: var(--fs-xs);
  border-radius: var(--r-sm);
}

.pay-notice a,
.pay-notice-link {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--muted-on-bg);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.pay-notice a:hover,
.pay-notice-link:hover {
  color: var(--text);
}

[data-gf-if-paid],
[data-gf-if-pending] {
  max-width: 980px;
  border-radius: var(--r-sm);
  padding: 14px 18px;
  margin: 0 auto 20px;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: var(--lh-ui);
}

[data-gf-if-paid] {
  background: var(--do-bg);
  border: 1px solid var(--do-border);
  color: var(--do-ink);
}

[data-gf-if-pending] {
  background: var(--surface-tint);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
}

/* Visual 4-Tile Credit-to-Clip Usage Strip (.usage-strip) */
.usage-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 980px;
  margin: 0 auto 24px;
}

.usage-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.usage-dur,
.usage-badge,
.usage-pill {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface-tint);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.usage-tile:first-child .usage-dur,
.usage-tile:first-child .usage-badge,
.usage-tile:first-child .usage-pill,
.usage-dur.is-free,
.usage-dur.is-ok {
  background: var(--do-bg);
  border-color: var(--do-border);
  color: var(--do-ink);
}

.usage-tile:last-child .usage-dur,
.usage-tile:last-child .usage-badge,
.usage-tile:last-child .usage-pill,
.usage-dur.is-accent,
.usage-dur.is-coral,
.usage-dur.is-cinema {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--coral-ink);
}

.usage-copy,
.usage-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.usage-cr,
.usage-tile strong {
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.usage-desc,
.usage-tile span:not(.usage-dur):not(.usage-badge):not(.usage-pill) {
  font-size: var(--fs-2xs);
  line-height: 1.3;
  color: var(--muted-on-bg);
}

/* Shared "Every plan includes" inline strip — centered above/below tabs */
.pricing-includes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px 18px;
  padding: 0;
  margin: 0 auto 24px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: var(--fs-xs);
  line-height: var(--lh-ui);
  color: var(--muted-on-bg);
}

.pricing-includes strong,
.pricing-includes-label {
  color: var(--text);
  font-weight: 600;
}

.pricing-includes p {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: var(--lh-ui);
  color: var(--muted-on-bg);
}

.pricing-includes ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
}

.pricing-includes li {
  margin: 0;
  line-height: var(--lh-ui);
}

.pricing-includes span,
.pricing-includes-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.pricing-includes-check,
.pricing-includes .inc-check,
.pricing-includes .check {
  color: var(--do-ink);
  font-weight: 600;
}

/* Horizontally Centered Billing Tabs */
.pricing-tabs-center,
.pricing-tabs-wrap,
.pricing-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0 auto 24px;
}

.pricing-tabs {
  display: flex;
  width: fit-content;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  margin: 0 auto 24px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.pricing-tabs-center .pricing-tabs,
.pricing-tabs-wrap .pricing-tabs,
.pricing-controls .pricing-tabs,
.pricing-tabs-center .pricing-includes,
.pricing-tabs-wrap .pricing-includes,
.pricing-controls .pricing-includes {
  margin-bottom: 0;
}

.pricing-tab,
.pricing-tabs button,
.pricing-tabs [role="tab"] {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 20px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-on-bg);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: var(--tr-ui);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.pricing-tab:focus:not(:focus-visible),
.pricing-tabs button:focus:not(:focus-visible),
.pricing-tabs [role="tab"]:focus:not(:focus-visible) {
  outline: none;
}

.pricing-tab:hover,
.pricing-tabs button:hover {
  color: var(--text);
}

.pricing-tab[aria-selected="true"],
.pricing-tab.is-active,
.pricing-tabs button[aria-selected="true"],
.pricing-tabs .is-active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.tab-save,
.tab-badge,
.pricing-tab-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--coral);
  color: var(--coral-ink);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  line-height: 1.2;
}

.pricing-panel {
  width: 100%;
  min-width: 0;
}

/* 4-col grid for Monthly/One-Time + Clean Centered 3-col grid for Yearly */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 20px;
  align-items: stretch;
  margin: 0 0 32px;
}

.pricing-grid:has(> :nth-child(3):last-child) {
  grid-template-columns: repeat(3, minmax(0, 320px));
  justify-content: center;
}

.pricing-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.pricing-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.pricing-card.is-popular {
  border: 2px solid var(--primary);
  background: linear-gradient(180deg, var(--surface-tint) 0%, var(--surface) 30%);
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--primary) 30%, transparent);
}

.pricing-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pricing-card h3 {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--text);
}

/* Floating badge keeps Pro title & price aligned horizontally with siblings */
.pricing-badge,
.popular-badge {
  position: absolute;
  top: -11px;
  left: 20px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--primary-ink);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  line-height: 1.3;
}

.price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  padding: 2px 0 8px;
  border-bottom: 1px solid var(--border);
}

/* 40px display 700 -0.02em lead price with proportional decimal spacing */
.price-val {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: proportional-nums lining-nums;
}

.price-period,
.price-unit {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--muted-on-bg);
}

.pricing-card > p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-ui);
  color: var(--text-secondary);
}

.pricing-card .price-sub,
.pricing-card .price-billed,
.pricing-card .price-annual {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: var(--lh-ui);
  color: var(--muted-on-bg);
  font-variant-numeric: proportional-nums lining-nums;
}

.price-strike {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--muted-on-bg);
  text-decoration: line-through;
  font-variant-numeric: proportional-nums lining-nums;
}

.price-save {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--do-bg);
  border: 1px solid var(--do-border);
  color: var(--do-ink);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Mono $/sec efficiency badge */
.pricing-card .price-per-sec,
.price-per-sec {
  display: inline-block;
  align-self: flex-start;
  margin: 0;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.pricing-card.is-popular .price-per-sec {
  background: var(--surface-tint);
  border-color: var(--accent-border);
  color: var(--accent-text);
}

.pricing-card .price-credits,
.pricing-card .price-quota,
.pricing-card .pricing-meta,
.price-credits,
.price-quota,
.pricing-meta {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: var(--lh-ui);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.pricing-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
}

.pricing-card li {
  position: relative;
  margin: 0;
  padding-left: 20px;
  font-size: var(--fs-sm);
  line-height: var(--lh-ui);
  color: var(--text-secondary);
}

.pricing-card li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--do-ink);
  font-weight: 600;
}

.pricing-cta,
.pricing-card-cta {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pricing-card .btn-primary,
.pricing-card .btn-secondary,
.pricing-card [data-gf-buy],
.pricing-card [data-gf-subscribe] {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
}

.pricing-card button[data-gf-buy]:not(.btn-primary):not(.btn-secondary),
.pricing-card button[data-gf-subscribe]:not(.btn-primary):not(.btn-secondary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.pricing-card button[data-gf-buy]:not(.btn-primary):not(.btn-secondary):hover,
.pricing-card button[data-gf-subscribe]:not(.btn-primary):not(.btn-secondary):hover {
  background: var(--surface-2);
  border-color: var(--primary);
  color: var(--text);
}

.pricing-card.is-popular button[data-gf-buy],
.pricing-card.is-popular button[data-gf-subscribe] {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}

.pricing-card.is-popular button[data-gf-buy]:hover,
.pricing-card.is-popular button[data-gf-subscribe]:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.pricing-card button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Subtle paused fallback CTA pill when pay_paused is active */
.btn-paused-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted-on-bg);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: default;
  user-select: none;
}

.pricing-card:has(.btn-paused-pill:not([hidden])) button[data-gf-buy],
.pricing-card:has(.btn-paused-pill:not([hidden])) button[data-gf-subscribe] {
  display: none;
}

/* ==========================================================================
   Account Dashboard (/account — Profile, Credits, Creations, Orders, Delete)
   ========================================================================== */
.account-shell {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.account-card h2,
.account-card h3 {
  margin: 0;
  padding: 0;
  border: none;
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--text);
}

.account-card p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

.account-stat {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-h2);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.account-meta-row,
.account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.account-card button[data-gf-manage]:not(.btn-primary):not(.btn-secondary):not(.btn-danger-outline),
.account-card button[data-gf-cancel]:not(.btn-primary):not(.btn-secondary):not(.btn-danger-outline),
.account-card button[data-gf-resume]:not(.btn-primary):not(.btn-secondary):not(.btn-danger-outline),
.account-card button[data-gf-login]:not(.btn-primary):not(.btn-secondary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.account-card button[data-gf-login]:not(.btn-primary):not(.btn-secondary) {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}

.account-card button[data-gf-login]:not(.btn-primary):not(.btn-secondary):hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.account-card button[data-gf-manage]:not(.btn-primary):not(.btn-secondary):hover,
.account-card button[data-gf-cancel]:not(.btn-primary):not(.btn-secondary):hover,
.account-card button[data-gf-resume]:not(.btn-primary):not(.btn-secondary):hover {
  background: var(--surface-2);
  border-color: var(--border-hover);
}

.account-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.account-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  font-size: var(--fs-sm);
  text-align: left;
}

.account-table thead th {
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tr-ui);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.account-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}

.account-table tbody tr:last-child td {
  border-bottom: none;
}

.account-table tbody tr:hover {
  background: var(--bg);
}

.credit-plus {
  color: var(--do-ink);
  font-weight: 500;
  font-family: var(--font-mono);
}

.credit-minus {
  color: var(--text);
  font-weight: 500;
  font-family: var(--font-mono);
}

.account-empty {
  padding: 24px 20px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  text-align: center;
  color: var(--muted-on-bg);
  font-size: var(--fs-sm);
}

.account-empty p {
  margin: 0 0 12px;
}

.account-empty p:last-child {
  margin-bottom: 0;
}

.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.job-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.job-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--stage-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stage-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.job-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.job-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
}

.job-prompt {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--muted-on-bg);
  font-variant-numeric: tabular-nums;
}

.job-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  text-transform: uppercase;
  background: var(--surface-tint);
  color: var(--accent-text);
  border: 1px solid var(--accent-border);
}

.job-status.is-done {
  background: var(--do-bg);
  color: var(--do-ink);
  border-color: var(--do-border);
}

.job-status.is-failed {
  background: var(--avoid-bg);
  color: var(--avoid-ink);
  border-color: var(--avoid-border);
}

.job-actions {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--avoid-border);
  color: var(--avoid-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn-danger-outline:hover {
  background: var(--avoid-bg);
  border-color: var(--danger);
  color: var(--danger-hover);
}

.btn-danger-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-danger-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  background: var(--danger);
  border: 1px solid var(--danger);
  color: var(--primary-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.btn-danger-solid:hover {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

.btn-danger-solid:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.delete-confirm-box {
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: var(--r-sm);
  background: var(--avoid-bg);
  border: 1px solid var(--avoid-border);
  border-left: 4px solid var(--danger);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.delete-confirm-box p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--avoid-ink);
  line-height: var(--lh-body);
}

.delete-confirm-error {
  font-weight: 600;
  color: var(--danger-hover);
}

.delete-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   Help & Policy Center (legal.html — Full-Width Policy Header + Sticky Nav)
   ========================================================================== */
.policy-hero {
  padding: 6px 0 6px 20px;
  margin: 4px 0 28px;
  border-left: 4px solid var(--primary);
}

.policy-hero h1 {
  margin: 8px 0 10px;
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-h1);
}

/* Full policy header width — zero awkward 68ch right-side whitespace */
.policy-intro {
  max-width: none;
  margin: 0 0 10px;
  font-size: var(--fs-lead);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

.policy-updated {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted-on-bg);
}

.policy-updated span {
  color: var(--text);
  font-weight: 500;
}

.policy-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  padding-bottom: 72px;
}

.policy-aside {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.policy-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.policy-nav-title {
  margin: 0 0 10px;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--muted-on-bg);
}

.policy-nav-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.policy-nav-grid a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.policy-nav-grid a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.policy-nav-grid a[aria-current="page"] {
  background: var(--surface-2);
  border-color: var(--border);
  border-left: 3px solid var(--primary);
  color: var(--text);
  font-weight: 600;
}

.policy-help-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.policy-help-card p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--muted-on-bg);
}

.policy-help-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.policy-help-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.policy-article {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 36px 44px;
  box-shadow: var(--shadow-sm);
}

.policy-measure {
  max-width: 72ch;
}

.policy-prose h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-h2);
  margin: 34px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.policy-prose > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Callouts (.policy-callout, .policy-quick-answer, .is-warn) */
.policy-callout {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--r-sm);
  padding: 18px 20px;
  margin: 0 0 24px;
}

.policy-callout-label {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--accent-text);
}

.policy-callout p:last-child,
.policy-callout ul:last-child {
  margin-bottom: 0;
}

.policy-callout p,
.policy-callout li {
  color: var(--text);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
}

.policy-callout.is-warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  border-left-color: var(--warn-ink);
}

.policy-callout.is-warn .policy-callout-label {
  color: var(--warn-ink);
}

/* Contact Support Triage Cards (.triage-grid, .triage-card, .btn-triage) */
.triage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 28px;
}

.triage-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.triage-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.triage-card h3 {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
}

.triage-card p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--text-secondary);
  flex: 1 1 auto;
}

.btn-triage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 44px;
  padding: 10px 18px;
  margin-top: 4px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn-triage:hover {
  background: var(--surface-2);
  border-color: var(--primary);
  color: var(--text);
}

/* Unified Policy Bottom Contact CTA */
.policy-contact-cta {
  margin-top: 36px;
  padding: 24px 26px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.policy-contact-title {
  margin: 6px 0 6px;
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--text);
}

.policy-contact-copy p:last-child {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: var(--lh-body);
}

.policy-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   404 Page (404.html)
   ========================================================================== */
.error-page {
  padding: 72px var(--gutter) 96px;
  display: flex;
  justify-content: center;
}

.error-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 40px 36px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.error-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted-on-bg);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  margin-bottom: 16px;
}

.error-card h1 {
  margin: 0 0 12px;
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-h1);
}

.error-desc {
  margin: 0 auto 24px;
  max-width: 44ch;
  color: var(--text-secondary);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  text-wrap: balance;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.error-foot {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted-on-bg);
}

/* ==========================================================================
   Footer — Crisp Light 3-Column Surface (1240px)
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 44px var(--gutter) 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr;
  gap: 36px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.footer-brand .brand {
  min-height: auto;
  align-self: flex-start;
}

.footer-desc {
  margin: 0;
  max-width: 38ch;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--muted-on-bg);
}

.footer-email {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.footer-heading {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-caps);
  text-transform: uppercase;
  color: var(--text);
}

.footer-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-list a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: color 140ms ease;
}

.footer-list a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  font-size: var(--fs-xs);
  color: var(--muted-on-bg);
}

.footer-spec {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted-on-bg);
}

/* ==========================================================================
   Responsive Breakpoints (1060px, 820px, 640px)
   ========================================================================== */
@media (max-width: 1060px) {
  .cap-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .formula-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-grid:has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    display: none;
  }

  .header-actions .btn-header-auth,
  .header-actions .btn-header-ghost,
  .header-actions .member-pill {
    display: none !important;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .editorial-split {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .editorial-split > :first-child,
  .editorial-split > :nth-child(2) {
    grid-column: 1 / -1;
  }

  .usage-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare-grid,
  .timeline-grid,
  .diagram-grid,
  .showcase-cards {
    grid-template-columns: 1fr;
  }

  .whats-new {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .whats-new-list,
  .whats-new ul {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .showcase-panel,
  .showcase-split:has(> .showcase-input),
  .showcase-panel .showcase-row,
  .showcase-panel .showcase-pair,
  .showcase-panel .showcase-columns,
  .showcase-panel .showcase-grid {
    grid-template-columns: 1fr;
  }

  .steps-row,
  .steps-timeline {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .steps-row > :not(:last-child)::after,
  .steps-timeline > :not(:last-child)::after {
    display: none;
  }

  .do-avoid-grid {
    grid-template-columns: 1fr;
  }

  .pricing-grid:has(> :nth-child(3):last-child) {
    grid-template-columns: 1fr;
  }

  /* Policy Center Mobile: 2-Col Equal-Width Grid (3x2), Zero Horizontal Clip, No Nested Borders */
  .policy-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .policy-aside {
    position: static;
  }

  .policy-help-card {
    display: none;
  }

  .policy-nav {
    padding: 12px;
  }

  .policy-nav-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .policy-nav-grid a {
    justify-content: center;
    text-align: center;
    min-height: 44px;
    padding: 8px 10px;
    font-size: var(--fs-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left-width: 1px;
  }

  .policy-nav-grid a[aria-current="page"] {
    background: var(--surface-tint);
    border: 1.5px solid var(--primary);
    border-left-width: 3px;
  }

  .policy-article {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 4px 0 0;
  }

  .policy-measure {
    max-width: 100%;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }

  .studio-hero {
    padding: 6px 0 8px;
  }

  .hero-title {
    margin-bottom: 4px;
    min-height: 2.12em;
  }

  .hero-subtitle {
    font-size: 0.9375rem;
    line-height: 1.45;
    margin-bottom: 8px;
  }

  .hero-trust {
    gap: 5px 6px;
  }

  .hero-trust li {
    padding: 4px 10px 4px 7px;
    font-size: 12px;
  }

  .breadcrumb {
    padding: 12px 0 0;
  }

  .page-hero {
    padding: 18px 0 14px;
  }

  .page-hero .eyebrow {
    display: none;
  }

  .page-hero h1 {
    margin-top: 0;
    margin-bottom: 8px;
  }

  .page-intro {
    font-size: var(--fs-base);
    margin-bottom: 0;
  }

  .page-foot-meta {
    margin: -24px 0 36px;
  }

  .anatomy-card,
  .formula-card {
    padding: 16px;
  }

  .anatomy-track {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .anatomy-beats,
  .anatomy-beats.is-two {
    grid-template-columns: 1fr;
  }

  .formula-grid {
    grid-template-columns: 1fr;
  }

  .timeline-beat,
  .timeline-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .flow-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .usage-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .usage-tile {
    padding: 10px;
    gap: 8px;
  }

  .usage-dur,
  .usage-badge,
  .usage-pill {
    width: 34px;
    height: 34px;
  }

  .pricing-includes {
    margin-bottom: 14px;
    gap: 4px 12px;
  }

  .pricing-includes span,
  .pricing-includes-item {
    white-space: normal;
  }

  .workbench-shell {
    margin-bottom: 36px;
  }

  .home-sections > h2,
  .editorial-split,
  .section-head,
  .anatomy-head {
    margin-top: 36px;
    padding-top: 36px;
  }

  .home-sections > h2:first-child,
  .home-sections > .editorial-split:first-child,
  .home-sections > .section-head:first-child,
  .home-sections > .anatomy-head:first-child {
    margin-top: 0;
    padding-top: 0;
  }

  .showcase-split {
    padding: 16px;
  }

  .showcase-tabs {
    width: 100%;
    border-radius: var(--r-sm);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }

  .showcase-tabs button,
  .showcase-tabs [role="tab"] {
    min-height: 44px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    white-space: normal;
    text-align: center;
  }

  .cap-grid,
  .pricing-grid,
  .account-grid,
  .jobs-grid {
    grid-template-columns: 1fr;
  }

  .pay-notice {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }

  .pay-notice-main,
  .pay-notice-copy {
    flex: 1 1 auto;
  }

  .pay-notice-actions {
    justify-content: space-between;
  }

  .pricing-tabs {
    width: 100%;
    border-radius: var(--r-sm);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pricing-tab,
  .pricing-tabs button,
  .pricing-tabs [role="tab"] {
    min-height: 44px;
    padding: 8px 4px;
    gap: 5px;
    border-radius: var(--r-sm);
    font-size: var(--fs-xs);
    white-space: normal;
    text-align: center;
  }

  .whats-new {
    padding: 16px;
  }

  .mobile-auth .member-pill {
    min-height: 44px;
    padding: 8px 16px;
  }

  .triage-grid {
    grid-template-columns: 1fr;
  }

  .btn-triage {
    width: 100%;
  }

  .article-card {
    padding: 24px 18px;
  }

  .cta-band {
    padding: 24px 20px;
    margin: 40px 0 52px;
  }

  .cta-band-actions,
  .policy-contact-actions,
  .error-actions {
    width: 100%;
  }

  .cta-band-actions .btn-primary,
  .cta-band-actions .btn-secondary,
  .policy-contact-actions .btn-primary,
  .policy-contact-actions .btn-secondary,
  .error-actions .btn-primary,
  .error-actions .btn-secondary {
    flex: 1 1 100%;
  }

  .faq-item summary {
    padding: 14px 16px;
  }

  .faq-answer {
    padding: 0 16px 16px;
  }

  .error-card {
    padding: 28px 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-list a {
    min-height: 36px;
  }
}

/* ==========================================================================
   2048 Micro World ("Take a Break" Right-Panel Tab)
   Scoped under .m2w2-root, 100% mapped to Magi2Free :root theme tokens
   ========================================================================== */
.m2w2-root {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 8px;
  width: 100%;
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.4;
  user-select: none;
  -webkit-user-select: none;
}

.m2w2-root *,
.m2w2-root *::before,
.m2w2-root *::after {
  box-sizing: border-box;
}

.m2w2-root [hidden] {
  display: none !important;
}

.m2w2-root :focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.m2w2-stage {
  position: relative;
  width: 100%;
  flex: 1 1 366px;
  min-height: 340px;
  max-height: 460px;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--stage-bg);
  touch-action: none;
}

.m2w2-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.m2w2-canvas.is-orbiting {
  cursor: grabbing;
}

.m2w2-hud-top {
  position: absolute;
  top: 9px;
  left: 9px;
  right: 9px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
  z-index: 4;
}

.m2w2-hud-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  pointer-events: auto;
}

.m2w2-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  min-height: 28px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--stage-bg) 76%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 24%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-ink);
  font-variant-numeric: tabular-nums;
}

.m2w2-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.m2w2-stat-lbl {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: color-mix(in srgb, var(--primary-ink) 78%, transparent);
}

.m2w2-stat-val {
  color: var(--primary-ink);
  font-weight: 700;
}

.m2w2-stat-val.is-mint {
  color: var(--do-border);
}

.m2w2-sep {
  width: 1px;
  height: 11px;
  background: color-mix(in srgb, var(--surface) 24%, transparent);
}

.m2w2-icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  border: 1px solid color-mix(in srgb, var(--surface) 24%, transparent);
  background: color-mix(in srgb, var(--stage-bg) 76%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--primary-ink);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 140ms ease, border-color 140ms ease;
}

.m2w2-icon-btn:hover {
  background: color-mix(in srgb, var(--stage-bg) 92%, transparent);
  border-color: color-mix(in srgb, var(--surface) 48%, transparent);
}

.m2w2-icon-btn[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--accent-border);
  color: var(--primary-ink);
}

.m2w2-stage-foot {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  z-index: 4;
  transition: opacity 140ms ease;
}

.m2w2-stage.has-toast .m2w2-stage-foot {
  opacity: 0.2;
}

.m2w2-cam-bar {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--stage-bg) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 22%, transparent);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.m2w2-cam-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--primary-ink);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.m2w2-cam-btn:hover {
  background: color-mix(in srgb, var(--surface) 18%, transparent);
}

.m2w2-disc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--stage-bg) 72%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 22%, transparent);
  backdrop-filter: blur(8px);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-ink);
  pointer-events: auto;
}

.m2w2-disc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.m2w2-disc-bar {
  width: 44px;
  height: 5px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--surface) 24%, transparent);
  overflow: hidden;
}

.m2w2-disc-fill {
  display: block;
  height: 100%;
  background: var(--do-border);
  border-radius: 99px;
  transition: width 220ms ease;
}

.m2w2-toast {
  position: absolute;
  left: 50%;
  bottom: 11px;
  transform: translateX(-50%);
  z-index: 8;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--stage-bg) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 22%, transparent);
  color: var(--primary-ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  animation: m2w2Pop 140ms ease-out;
}

.m2w2-toast.is-discovery {
  background: var(--primary);
  border-color: var(--accent-border);
}

.m2w2-atlas-pop {
  position: absolute;
  top: 42px;
  right: 9px;
  width: 264px;
  max-height: calc(100% - 54px);
  overflow-y: auto;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 9px 11px;
  z-index: 9;
  color: var(--text);
}

.m2w2-atlas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  padding-bottom: 5px;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.m2w2-atlas-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
}

.m2w2-atlas-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  padding: 2px 4px;
  border-radius: 6px;
}

.m2w2-atlas-item.is-unlocked {
  color: var(--text);
  font-weight: 600;
  background: var(--bg);
}

.m2w2-atlas-l {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m2w2-atlas-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.m2w2-atlas-item.is-unlocked .m2w2-atlas-num {
  color: var(--primary);
}

.m2w2-ready-banner {
  position: absolute;
  top: 42px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px 5px 11px;
  border-radius: var(--r-pill);
  background: var(--stage-bg);
  color: var(--primary-ink);
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  max-width: calc(100% - 16px);
  animation: m2w2Pop 180ms ease-out;
}

.m2w2-ready-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--do-border);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--do-border) 32%, transparent);
  flex: 0 0 auto;
}

.m2w2-ready-btn {
  appearance: none;
  border: 0;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  cursor: pointer;
}

.m2w2-ready-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--primary-ink) 74%, transparent);
  font-size: 16px;
  line-height: 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.m2w2-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: color-mix(in srgb, var(--stage-bg) 44%, transparent);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.m2w2-card {
  width: 100%;
  max-width: 404px;
  max-height: 300px;
  overflow-y: auto;
  background: color-mix(in srgb, var(--surface) 98%, transparent);
  background-image: radial-gradient(ellipse 70% 42% at 50% 0%, color-mix(in srgb, var(--warn-border) 32%, transparent), transparent 72%);
  border: 1px solid var(--warn-border);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--text);
  animation: m2w2CardPop 160ms ease-out;
}

.m2w2-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.m2w2-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}

.m2w2-summary {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.m2w2-close-x {
  appearance: none;
  border: 0;
  background: var(--surface-2);
  color: var(--text);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.m2w2-lb {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--warn-border) 70%, var(--border));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: 8px 10px 0;
  overflow: hidden;
}

.m2w2-lb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.m2w2-lb-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.m2w2-lb-globe {
  color: var(--primary);
  flex: 0 0 auto;
}

.m2w2-lb-head-r {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.m2w2-lb-top-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warn-ink);
}

.m2w2-lb-scopes {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.m2w2-lb-scope {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  cursor: pointer;
}

.m2w2-lb-scope.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.m2w2-podium {
  display: grid;
  grid-template-columns: 1fr 1.16fr 1fr;
  align-items: end;
  gap: 7px;
  padding-top: 2px;
}

.m2w2-pod {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.m2w2-pod-medal {
  font-size: 14px;
  line-height: 1;
  margin-bottom: 1px;
}

.m2w2-pod.is-1 .m2w2-pod-medal {
  font-size: 17px;
}

.m2w2-pod-name {
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}

.m2w2-pod.is-1 .m2w2-pod-name {
  color: var(--text);
  font-weight: 700;
}

.m2w2-pod.is-me .m2w2-pod-name {
  color: var(--primary);
}

.m2w2-pod-score {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin: 2px 0 4px;
}

.m2w2-pod.is-1 .m2w2-pod-score {
  font-size: 20px;
  color: var(--warn-ink);
}

.m2w2-pod-bar {
  width: 100%;
  border-radius: 7px 7px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.m2w2-pod.is-1 .m2w2-pod-bar {
  height: 36px;
  background: linear-gradient(180deg, var(--warn-bg) 0%, var(--warn-border) 100%);
  color: var(--warn-ink);
  box-shadow: 0 -4px 14px -4px color-mix(in srgb, var(--warn-border) 65%, transparent);
}

.m2w2-pod.is-2 .m2w2-pod-bar {
  height: 28px;
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--border-strong) 100%);
  color: var(--text);
}

.m2w2-pod.is-3 .m2w2-pod-bar {
  height: 22px;
  background: var(--avoid-bg);
  background-image: linear-gradient(180deg, var(--avoid-bg) 0%, var(--warn-border) 100%);
  color: var(--text);
}

.m2w2-lb-foot {
  margin: 0 -10px;
  padding: 5px 10px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  min-height: 30px;
}

.m2w2-lb-me {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m2w2-lb-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.m2w2-lb-link:hover {
  background: var(--surface-tint);
  color: var(--accent-text);
}

.m2w2-nick-form {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.m2w2-nick-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 26px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.m2w2-card-acts {
  display: flex;
  gap: 7px;
}

.m2w2-card-acts > button {
  flex: 1 1 0;
}

.m2w2-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.m2w2-dock-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.m2w2-dpad {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
}

.m2w2-dir-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.m2w2-dir-btn:hover {
  background: var(--surface-tint);
  color: var(--primary);
}

.m2w2-key-hint {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.m2w2-dock-acts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.m2w2-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 4px 11px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.m2w2-btn:hover:not(:disabled) {
  border-color: var(--primary);
}

.m2w2-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.m2w2-btn.is-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}

.m2w2-btn.is-accent-soft {
  background: var(--surface-tint);
  border-color: var(--accent-border);
  color: var(--accent-text);
}

.m2w2-btn.is-accent-soft:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}

@keyframes m2w2Pop {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes m2w2CardPop {
  from { opacity: 0; transform: scale(0.97) translateY(5px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 980px) {
  .m2w2-stage {
    height: 340px;
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .m2w2-key-hint {
    display: none;
  }

  .m2w2-btn {
    min-height: 36px;
  }
}

/* ==========================================================================
   Magi2 Studio Prompt Helpers & Bottom-Left Reference PIP Overlay
   ========================================================================== */
.m2w-prompt-head-acts {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
}

.m2w-structure-trigger {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--m2w-muted-inset, var(--muted-on-bg));
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--m2w-r-sm, var(--r-sm));
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.m2w-structure-trigger:hover {
  background: var(--m2w-mist, var(--surface-2));
  color: var(--m2w-ink, var(--text));
}

.m2w-audio-guard {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.m2w-audio-guard-txt {
  font-size: 12px;
  color: var(--m2w-warn-ink, var(--warn-ink));
  white-space: nowrap;
}

.m2w-audio-guard-btn {
  appearance: none;
  border: 1px solid var(--m2w-warn-border, var(--warn-border));
  background: var(--m2w-warn-bg, var(--warn-bg));
  color: var(--m2w-warn-ink, var(--warn-ink));
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 2px 8px;
  border-radius: var(--m2w-r-pill, var(--r-pill));
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.m2w-audio-guard-btn:hover {
  background: var(--m2w-indigo-wash, var(--surface-tint));
  border-color: var(--m2w-primary, var(--primary));
  color: var(--m2w-indigo-ink, var(--accent-text));
}

.m2w-reel-refs {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 5;
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  padding: 5px 8px 5px 5px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--m2w-cinema, #121122) 76%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid color-mix(in srgb, var(--m2w-surface, #FFFFFF) 24%, transparent);
  box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--m2w-cinema, #121122) 65%, transparent);
  max-width: calc(100% - 16px);
}

.m2w-reel-refs.is-compact {
  padding: 4px;
}

.m2w-reel-video-wrap[data-ratio="9:16"] .m2w-reel-credit,
.m2w-reel-video-wrap[data-ratio="3:4"] .m2w-reel-credit {
  display: none;
}

.m2w-reel-ref-item {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid color-mix(in srgb, var(--m2w-surface, #FFFFFF) 88%, transparent);
  background: var(--m2w-cinema, #121122);
  flex: 0 0 auto;
  transition: transform 150ms ease, border-color 150ms ease;
}

.m2w-reel-ref-item.is-portrait {
  width: 36px;
  height: 58px;
}

.m2w-reel-ref-item:hover {
  transform: translateY(-2px) scale(1.06);
  border-color: var(--m2w-surface, #FFFFFF);
}

.m2w-reel-ref-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.m2w-reel-ref-tag {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 2px;
  padding: 0 2px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--m2w-cinema, #121122) 84%, transparent);
  color: var(--m2w-primary-ink, #FFFFFF);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m2w-reel-refs-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0 2px 1px 2px;
  color: var(--m2w-primary-ink, #FFFFFF);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.m2w-reel-refs-meta strong {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--m2w-primary-ink, #FFFFFF);
}

.m2w-reel-refs-meta span {
  opacity: 0.84;
}

@media (max-width: 640px) {
  .m2w-reel-refs {
    padding: 4px 6px 4px 4px;
    gap: 5px;
  }

  .m2w-reel-ref-item {
    width: 36px;
    height: 36px;
  }

  .m2w-reel-ref-item.is-portrait {
    width: 30px;
    height: 48px;
  }

  .m2w-reel-refs-meta {
    display: none;
  }
}

/* Compact 78px I2V Keyframe Cards (Start primary + Optional End subtle, keeps Generate above fold) */
[data-gf-tool="magi2-video-generator"] .m2w-frames-grid {
  grid-template-columns: 1.15fr 0.85fr;
  gap: 8px;
}

[data-gf-tool="magi2-video-generator"] .m2w-dropzone {
  min-height: 78px;
  height: 78px;
  padding: 5px 8px;
}

[data-gf-tool="magi2-video-generator"] .m2w-dropzone.has-image {
  padding: 0;
}

[data-gf-tool="magi2-video-generator"] .m2w-dropzone[data-m2w-dropzone="end"]:not(.has-image) {
  background: var(--bg);
  opacity: 0.88;
}

[data-gf-tool="magi2-video-generator"] .m2w-dropzone[data-m2w-dropzone="end"]:not(.has-image):hover {
  opacity: 1;
}

[data-gf-tool="magi2-video-generator"] .m2w-drop-empty {
  gap: 1px;
}

[data-gf-tool="magi2-video-generator"] .m2w-drop-ico {
  width: 15px;
  height: 15px;
  margin-bottom: 0;
}

[data-gf-tool="magi2-video-generator"] .m2w-drop-cta {
  font-size: 12px;
  line-height: 1.2;
}

[data-gf-tool="magi2-video-generator"] .m2w-drop-sub {
  font-size: 12px;
  line-height: 1.2;
}

[data-gf-tool="magi2-video-generator"] .m2w-left.has-upload-panel .m2w-left-body {
  padding: 12px 16px 10px;
  gap: 8px;
}

[data-gf-tool="magi2-video-generator"] .m2w-left.has-upload-panel .m2w-upload-panel {
  gap: 6px;
}

[data-gf-tool="magi2-video-generator"] .m2w-left.has-upload-panel .m2w-left-footer {
  padding: 10px 16px 12px;
  gap: 7px;
}

@media (max-width: 420px) {
  [data-gf-tool="magi2-video-generator"] .m2w-frames-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Accessible visually-hidden helper (preserves H1 -> H2 -> H3 outline with 0px height) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Pricing page first-screen density: pull billing tabs & all plan cards cleanly above fold */
.doc-page:has(.pricing-grid) .breadcrumb {
  padding: 12px 0 4px;
}

.doc-page:has(.pricing-grid) .page-hero {
  padding: 2px 0 14px;
}

.doc-page:has(.pricing-grid) .page-hero h1 {
  margin: 6px 0 6px;
}

.doc-page:has(.pricing-grid) .page-intro {
  margin: 0 auto 4px;
}

.pricing-tabs-center.is-lead {
  margin-top: 0;
  margin-bottom: 14px;
  gap: 8px;
}

.doc-page:has(.pricing-grid) .pricing-card {
  padding: 18px 20px;
  gap: 9px;
}

.doc-page:has(.pricing-grid) .pricing-grid {
  margin-bottom: 24px;
}

/* Home Studio Post-Checkout Return Banner & Paywall Loading Note */
[data-gf-tool="magi2-video-generator"] .m2w-pay-banner {
  margin: 4px 0 0;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

[data-gf-tool="magi2-video-generator"] .m2w-pay-banner.is-paid {
  background: var(--do-bg);
  border: 1px solid var(--do-border);
  color: var(--do-ink);
}

[data-gf-tool="magi2-video-generator"] .m2w-pay-banner.is-pending {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-ink);
}

[data-gf-tool="magi2-video-generator"] .m2w-pw-loading {
  margin: 4px 0;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--muted-on-bg);
}

/* Multi Reference Multimodal Tiles (@Image / @Video / @Audio) */
[data-gf-tool="magi2-video-generator"] .m2w-ref-media-bg {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px 22px;
}

[data-gf-tool="magi2-video-generator"] .m2w-ref-media-bg.is-video {
  background: #1B1835;
  color: #E5E1FF;
}

[data-gf-tool="magi2-video-generator"] .m2w-ref-media-bg.is-audio {
  background: var(--surface-tint);
  color: var(--accent-text);
}

[data-gf-tool="magi2-video-generator"] .m2w-ref-audio-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
}

[data-gf-tool="magi2-video-generator"] .m2w-ref-dur {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(18, 17, 34, 0.8);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  pointer-events: none;
}

[data-gf-tool="magi2-video-generator"] .m2w-ref-chip.is-video {
  background: rgba(24, 21, 56, 0.92);
  color: #FFFFFF;
}

[data-gf-tool="magi2-video-generator"] .m2w-ref-chip.is-audio {
  background: rgba(63, 36, 224, 0.92);
  color: #FFFFFF;
}

[data-gf-tool="magi2-video-generator"] .m2w-expand-ref-ico {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-tint);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

/* Balanced Desktop Split: wider prompt box (~44% : 56%) while keeping Generate CTA above fold */
@media (min-width: 981px) {
  [data-gf-tool="magi2-video-generator"] .m2w-workbench {
    grid-template-columns: minmax(460px, 44%) minmax(0, 1fr);
    gap: 18px;
  }

  [data-gf-tool="magi2-video-generator"] .m2w-textarea-box {
    min-height: 212px;
  }

  [data-gf-tool="magi2-video-generator"] .m2w-textarea {
    min-height: 176px;
    font-size: 14.5px;
    line-height: 1.56;
  }

  [data-gf-tool="magi2-video-generator"] .m2w-left.has-upload-panel .m2w-textarea-box {
    min-height: 128px;
  }

  [data-gf-tool="magi2-video-generator"] .m2w-left.has-upload-panel .m2w-textarea {
    min-height: 94px;
  }
}

/* Explicit Expand Prompt Editor Trigger & Focus Overlay (Pattern B) */
.m2w-expand-trigger {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-on-bg);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.m2w-expand-trigger:hover {
  background: var(--surface-2);
  color: var(--text);
}

.m2w-expand-trigger.is-suggested {
  background: var(--surface-tint);
  border-color: var(--accent-border);
  color: var(--accent-text);
}

.m2w-expand-trigger.is-suggested:hover {
  background: var(--accent-hover-tint);
  border-color: var(--primary);
}

.m2w-expand-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: color-mix(in srgb, var(--text) 42%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.m2w-expand-dialog {
  width: min(820px, calc(100vw - 40px));
  height: min(74vh, 660px);
  max-height: calc(100vh - 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 28px 64px -16px color-mix(in srgb, var(--text) 28%, transparent);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: m2wExpandIn 150ms ease-out;
}

@keyframes m2wExpandIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.m2w-expand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex: 0 0 auto;
}

.m2w-expand-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.m2w-expand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.m2w-expand-spec {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-text);
  background: var(--surface-tint);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-pill);
  padding: 2px 10px;
  white-space: nowrap;
}

.m2w-expand-head-acts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.m2w-expand-refs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  overflow-x: auto;
  flex: 0 0 auto;
}

.m2w-expand-refs-lbl {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-on-bg);
  white-space: nowrap;
  flex: 0 0 auto;
}

.m2w-expand-ref-chip {
  appearance: none;
  border: 1px solid var(--accent-border);
  background: var(--surface);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 3px 9px 3px 4px;
  border-radius: var(--r-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.m2w-expand-ref-chip img {
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  object-fit: cover;
  display: block;
}

.m2w-expand-ref-chip:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}

.m2w-expand-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  background: var(--surface);
}

.m2w-expand-textarea {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  padding: 16px 18px;
  resize: none;
  outline: none;
}

.m2w-expand-textarea::placeholder {
  color: var(--muted);
}

.m2w-expand-textarea:focus-visible {
  outline: none;
}

.m2w-expand-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  flex: 0 0 auto;
}

.m2w-expand-foot-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.m2w-expand-foot-left .m2w-char-count {
  margin-left: 0;
}

.m2w-expand-done-btn {
  appearance: none;
  border: 0;
  background: var(--primary);
  color: var(--primary-ink);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  min-height: 38px;
  padding: 8px 20px;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: background-color 140ms ease;
}

.m2w-expand-done-btn:hover {
  background: var(--primary-hover);
}

@media (max-width: 767px) {
  .m2w-expand-backdrop {
    padding: 0;
    align-items: stretch;
  }

  .m2w-expand-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .m2w-expand-spec {
    display: none;
  }

  .m2w-expand-done-btn {
    min-height: 44px;
    padding: 8px 18px;
  }
}

@media (min-width: 768px) {
  [data-gf-tool="magi2-video-generator"] .m2w-reel-stage {
    height: clamp(248px, 41vh, 344px);
  }
}

/* ==========================================================================
   Copyable Full-Prompt Blocks (Inner Guide Pages + Studio Callout Copy Button)
   ========================================================================== */
.guide-prompt-box {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  overflow: hidden;
}

.guide-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.guide-prompt-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-on-bg);
}

.guide-copy-btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  min-height: 30px;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.guide-copy-btn:hover {
  background: var(--surface-tint);
  border-color: var(--primary);
  color: var(--accent-text);
}

.guide-copy-btn.is-copied {
  background: var(--do-bg);
  border-color: var(--do-border);
  color: var(--do-ink);
}

.guide-prompt-code {
  margin: 0;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 168px;
  overflow-y: auto;
  background: transparent;
  border: 0;
}

[data-gf-tool="magi2-video-generator"] .m2w-callout-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.m2w-copy-btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  min-height: 40px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.m2w-copy-btn:hover {
  border-color: var(--primary);
  color: var(--accent-text);
  background: var(--surface-tint);
}

.m2w-copy-btn.is-copied {
  background: var(--do-bg);
  border-color: var(--do-border);
  color: var(--do-ink);
}

@media (max-width: 767px) {
  [data-gf-tool="magi2-video-generator"] .m2w-callout-act {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
  }

  .m2w-copy-btn {
    min-height: 44px;
  }
}

/* ==========================================================================
   Centered Conversion Modals, Right-Edge Countdown Card & Phone QR Specs
   (Referencing rapaivideos layout & pacing, tuned to Magi2Free V4 palette)
   ========================================================================== */
[data-gf-tool="magi2-video-generator"] .m2w-qr-popover {
  width: 248px;
}

[data-gf-tool="magi2-video-generator"] .m2w-qr-specs {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
}

[data-gf-tool="magi2-video-generator"] .m2w-qr-spec-line {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted-on-bg);
  text-align: center;
}

[data-gf-tool="magi2-video-generator"] .m2w-qr-foot-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

[data-gf-tool="magi2-video-generator"] .m2w-qr-ttl {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-on-bg);
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

[data-gf-tool="magi2-video-generator"] .m2w-qr-shimmer {
  width: 148px;
  height: 148px;
  border-radius: 8px;
  background: linear-gradient(
    110deg,
    var(--surface-2) 25%,
    var(--surface) 45%,
    var(--surface-2) 65%
  );
  background-size: 220% 100%;
  animation: m2wQrShimmer 1.15s ease-in-out infinite;
}

@keyframes m2wQrShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Centered Full-Viewport Modals (Paywall & First-Creator Pass) */
[data-gf-tool="magi2-video-generator"] .m2w-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  padding: 20px;
  background: color-mix(in srgb, var(--text) 56%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: m2wBackdropFade 180ms ease-out;
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-backdrop.is-exit-offer {
  z-index: 96;
}

@keyframes m2wBackdropFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-card {
  position: relative;
  width: 100%;
  max-width: 484px;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 30px 70px -18px color-mix(in srgb, var(--text) 34%, transparent), 0 8px 20px -8px color-mix(in srgb, var(--text) 14%, transparent);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: m2wModalPopIn 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-card.is-exit-card {
  border-color: var(--warn-border);
  box-shadow: 0 32px 76px -18px color-mix(in srgb, var(--text) 38%, transparent), 0 0 0 1px color-mix(in srgb, var(--warn-border) 55%, transparent);
}

@keyframes m2wModalPopIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.965);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-close:hover {
  background: var(--surface-2);
  border-color: var(--border-hover);
  color: var(--text);
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-kicker {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-tint);
  border: 1px solid var(--accent-border);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-kicker.is-offer {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-ink);
  font-variant-numeric: tabular-nums;
}

[data-gf-tool="magi2-video-generator"] .m2w-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--coral);
  flex: 0 0 auto;
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 36px;
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.022em;
  color: var(--text);
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.48;
  color: var(--muted-on-bg);
}

/* Compact 1-line Balance & Draft Status Bar (no noisy prompt text dump) */
[data-gf-tool="magi2-video-generator"] .m2w-modal-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-meta-spec {
  color: var(--text-secondary);
  font-weight: 500;
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-saved-tag {
  color: var(--do-ink);
  font-weight: 600;
  white-space: nowrap;
}

[data-gf-tool="magi2-video-generator"] .m2w-try4-banner {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--do-border);
  background: var(--do-bg);
  color: var(--do-ink);
  font-family: var(--font-sans);
  cursor: pointer;
  text-align: left;
  transition: filter 140ms ease, transform 120ms ease;
}

[data-gf-tool="magi2-video-generator"] .m2w-try4-banner:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

[data-gf-tool="magi2-video-generator"] .m2w-try4-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

[data-gf-tool="magi2-video-generator"] .m2w-try4-text strong {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

[data-gf-tool="magi2-video-generator"] .m2w-try4-text span {
  font-size: 12px;
  line-height: 1.35;
}

[data-gf-tool="magi2-video-generator"] .m2w-try4-go {
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  color: var(--do-ink);
  border: 1px solid var(--do-border);
  padding: 5px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  flex: 0 0 auto;
}

[data-gf-tool="magi2-video-generator"] .m2w-pw-paused {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}

[data-gf-tool="magi2-video-generator"] .m2w-pw-paused-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.48;
  color: var(--text-secondary);
}

[data-gf-tool="magi2-video-generator"] .m2w-pw-offers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

[data-gf-tool="magi2-video-generator"] .m2w-pack-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

[data-gf-tool="magi2-video-generator"] .m2w-pack-option {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 13px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
}

[data-gf-tool="magi2-video-generator"] .m2w-pack-option:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

[data-gf-tool="magi2-video-generator"] .m2w-pack-option[aria-checked="true"] {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 13%, transparent);
}

[data-gf-tool="magi2-video-generator"] .m2w-radio-dot {
  width: 18px;
  height: 18px;
  border-radius: var(--r-pill);
  border: 2px solid var(--border-hover);
  background: var(--surface);
  display: grid;
  place-items: center;
  transition: border-color 140ms ease, background-color 140ms ease;
}

[data-gf-tool="magi2-video-generator"] .m2w-pack-option[aria-checked="true"] .m2w-radio-dot {
  border-color: var(--primary);
  background: var(--primary);
}

[data-gf-tool="magi2-video-generator"] .m2w-pack-option[aria-checked="true"] .m2w-radio-dot::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--primary-ink);
}

[data-gf-tool="magi2-video-generator"] .m2w-pack-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

[data-gf-tool="magi2-video-generator"] .m2w-pack-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

[data-gf-tool="magi2-video-generator"] .m2w-pack-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

[data-gf-tool="magi2-video-generator"] .m2w-pack-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--text-secondary);
}

[data-gf-tool="magi2-video-generator"] .m2w-pack-badge.is-best {
  background: var(--surface-tint);
  color: var(--accent-text);
  border: 1px solid var(--accent-border);
}

[data-gf-tool="magi2-video-generator"] .m2w-pack-meta {
  font-size: 12.5px;
  color: var(--muted-on-bg);
  font-variant-numeric: tabular-nums;
}

[data-gf-tool="magi2-video-generator"] .m2w-pack-price {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-variant-numeric: tabular-nums;
}

[data-gf-tool="magi2-video-generator"] .m2w-pack-price strong {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}

[data-gf-tool="magi2-video-generator"] .m2w-pack-price small {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* First-Creator Pass Summary Card (rapaivideos .exit-offer-summary pattern) */
[data-gf-tool="magi2-video-generator"] .m2w-offer-summary {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 15px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--warn-bg) 100%);
  border: 1.5px solid var(--warn-border);
}

[data-gf-tool="magi2-video-generator"] .m2w-offer-thumb {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--warn-border);
  color: var(--danger);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

[data-gf-tool="magi2-video-generator"] .m2w-offer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

[data-gf-tool="magi2-video-generator"] .m2w-offer-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

[data-gf-tool="magi2-video-generator"] .m2w-offer-meta strong {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}

[data-gf-tool="magi2-video-generator"] .m2w-offer-meta span {
  font-size: 12px;
  color: var(--muted-on-bg);
}

[data-gf-tool="magi2-video-generator"] .m2w-offer-price {
  flex: 0 0 auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-variant-numeric: tabular-nums;
}

[data-gf-tool="magi2-video-generator"] .m2w-offer-price-top {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

[data-gf-tool="magi2-video-generator"] .m2w-offer-price s {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

[data-gf-tool="magi2-video-generator"] .m2w-offer-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--danger);
  color: var(--coral-ink);
  line-height: 1.25;
}

[data-gf-tool="magi2-video-generator"] .m2w-offer-price strong {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text);
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-link:hover {
  text-decoration: underline;
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-later {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted-on-bg);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  text-decoration: underline;
  text-decoration-color: var(--border-hover);
  text-underline-offset: 3px;
  cursor: pointer;
}

[data-gf-tool="magi2-video-generator"] .m2w-modal-later:hover {
  color: var(--text);
  background: var(--surface-2);
}

/* Right-Edge Vertically-Centered Countdown Card (replaces ugly bottom circular pulse!) */
[data-gf-tool="magi2-video-generator"] .m2w-pass-dock {
  position: fixed;
  right: 16px;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  z-index: 65;
  width: 176px;
  background: var(--surface);
  border: 1.5px solid var(--warn-border);
  border-radius: 15px;
  box-shadow: 0 18px 40px -14px color-mix(in srgb, var(--text) 24%, transparent), 0 4px 10px -4px color-mix(in srgb, var(--warn-ink) 14%, transparent);
  overflow: hidden;
  padding: 0;
  display: block;
  animation: m2wDockSlideIn 280ms cubic-bezier(0.22, 1, 0.36, 1);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms ease, border-color 180ms ease;
}

@keyframes m2wDockSlideIn {
  from {
    opacity: 0;
    transform: translate(22px, -50%);
  }
  to {
    opacity: 1;
    transform: translate(0, -50%);
  }
}

[data-gf-tool="magi2-video-generator"] .m2w-pass-dock:hover {
  transform: translate(-3px, -50%);
  border-color: var(--primary);
  box-shadow: 0 22px 46px -14px color-mix(in srgb, var(--primary) 24%, transparent), 0 4px 12px color-mix(in srgb, var(--text) 10%, transparent);
}

[data-gf-tool="magi2-video-generator"] .m2w-pass-dock-main {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  padding: 11px 12px 10px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
  font-family: var(--font-sans);
}

[data-gf-tool="magi2-video-generator"] .m2w-dock-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-right: 18px;
}

[data-gf-tool="magi2-video-generator"] .m2w-dock-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--warn-ink);
}

[data-gf-tool="magi2-video-generator"] .m2w-dock-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--avoid-bg);
  color: var(--avoid-ink);
  line-height: 1.2;
}

[data-gf-tool="magi2-video-generator"] .m2w-dock-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

[data-gf-tool="magi2-video-generator"] .m2w-dock-price {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

[data-gf-tool="magi2-video-generator"] .m2w-dock-timer {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 7px;
  background: var(--text);
  color: var(--surface);
  font-variant-numeric: tabular-nums;
}

[data-gf-tool="magi2-video-generator"] .m2w-dock-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-on-bg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-gf-tool="magi2-video-generator"] .m2w-dock-bar {
  height: 3px;
  width: 100%;
  background: var(--warn-bg);
}

[data-gf-tool="magi2-video-generator"] .m2w-dock-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--coral) 100%);
  transition: width 900ms linear;
}

[data-gf-tool="magi2-video-generator"] .m2w-pass-dock-close {
  position: absolute;
  top: 6px;
  right: 6px;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 24px;
  height: 24px;
  border-radius: var(--r-pill);
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

[data-gf-tool="magi2-video-generator"] .m2w-pass-dock-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

[data-gf-tool="magi2-video-generator"] .m2w-dock-toast {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 64;
  max-width: 296px;
  padding: 11px 14px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 3.5px solid var(--primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: m2wModalPopIn 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

[data-gf-tool="magi2-video-generator"] .m2w-dock-toast strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

[data-gf-tool="magi2-video-generator"] .m2w-dock-toast span {
  font-size: 12px;
  color: var(--muted-on-bg);
  line-height: 1.4;
}

@media (max-width: 640px) {
  [data-gf-tool="magi2-video-generator"] .m2w-modal-backdrop {
    place-items: end center;
    padding: 0;
  }

  [data-gf-tool="magi2-video-generator"] .m2w-modal-card {
    max-width: none;
    border-radius: 20px 20px 0 0;
    padding: 20px 16px max(20px, env(safe-area-inset-bottom));
    animation: m2wSheetUp 220ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  @keyframes m2wSheetUp {
    from {
      opacity: 0;
      transform: translateY(28px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  [data-gf-tool="magi2-video-generator"] .m2w-pass-dock {
    top: auto;
    bottom: max(16px, env(safe-area-inset-bottom));
    right: 12px;
    transform: none;
    width: 168px;
    animation: m2wModalPopIn 220ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  [data-gf-tool="magi2-video-generator"] .m2w-pass-dock:hover {
    transform: none;
  }

  [data-gf-tool="magi2-video-generator"] .m2w-dock-toast {
    left: 12px;
    right: 12px;
    bottom: calc(108px + env(safe-area-inset-bottom));
    max-width: none;
  }
}

/* ==========================================================================
   V5 Redesign — Daylight Credit Pill + Avatar Popover, Homepage Pricing H2,
   and Aspect-Ratio-Native Workflow Split Pages (/image-to-video, /multi-reference, /prompt-guide)
   ========================================================================== */

/* Header Guest Welcome Pill (shows welcome bonus for logged-out visitors) */
.guest-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.guest-welcome-pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--accent-border);
  background: var(--surface-tint);
  color: var(--accent-text);
  font-family: var(--font-sans);
  font-size: var(--fs-2xs);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.guest-welcome-pill:hover {
  background: var(--accent-hover-tint);
  border-color: var(--primary);
}

.guest-welcome-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--primary);
  flex-shrink: 0;
}

.guest-welcome-short {
  display: none;
}

@media (max-width: 1080px) {
  .guest-welcome-full {
    display: none;
  }

  .guest-welcome-short {
    display: inline;
  }
}

@media (max-width: 640px) {
  .guest-bar {
    gap: 6px;
  }

  .guest-welcome-pill {
    height: 34px;
    padding: 0 9px;
    font-size: 12px;
  }
}

@media (max-width: 374px) {
  .guest-welcome-pill {
    display: none;
  }
}

/* Header Member Bar (Scheme A: Daylight Soft-Indigo Pill + Circular Avatar) */
.member-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.credits-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px 0 11px;
  border-radius: var(--r-pill);
  background: var(--surface-tint);
  border: 1px solid var(--accent-border);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 120ms ease;
}

.credits-pill:hover {
  background: var(--accent-hover-tint);
  border-color: var(--primary);
  color: var(--text);
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--primary) 38%, transparent);
}

.credits-pill:active {
  transform: translateY(1px);
}

.credits-pill-ico {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
  display: block;
}

.credits-pill-val {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.credits-pill-topup {
  display: none;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--coral);
  color: var(--coral-ink);
  font-family: var(--font-sans);
  font-size: var(--fs-2xs);
  font-weight: 700;
  line-height: 1.25;
}

.credits-pill.is-empty {
  background: var(--coral-bg);
  border-color: var(--coral-border);
  color: var(--danger);
}

.credits-pill.is-empty:hover {
  border-color: var(--coral);
}

.credits-pill.is-empty .credits-pill-ico {
  color: var(--coral);
}

.credits-pill.is-empty .credits-pill-val {
  color: var(--danger);
}

.credits-pill.is-empty .credits-pill-topup {
  display: inline-flex;
  align-items: center;
}

.member-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.member-avatar-btn {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--r-pill);
  border: 2px solid var(--border-strong);
  background: var(--primary);
  color: var(--primary-ink);
  overflow: hidden;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 120ms ease;
}

.member-avatar-btn:hover,
.member-avatar-btn[aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.member-avatar-fallback {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: var(--primary-ink);
}

.member-avatar-fallback svg {
  width: 19px;
  height: 19px;
  display: block;
}

.member-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.member-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 90;
  width: 244px;
  padding: 8px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.member-pop-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

.member-pop-name {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-pop-email {
  margin: 2px 0 0;
  font-size: var(--fs-2xs);
  color: var(--muted-on-bg);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-pop-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  margin-bottom: 6px;
  border-radius: var(--r-sm);
  background: var(--surface-tint);
  border: 1px solid var(--accent-border);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.member-pop-balance strong {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.member-pop-balance:hover {
  background: var(--accent-hover-tint);
  border-color: var(--primary);
  color: var(--text);
}

.member-pop-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 10px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.member-pop-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.member-pop-item[aria-current="page"] {
  background: var(--surface-2);
  font-weight: 600;
}

.member-pop-item.is-danger {
  color: var(--danger);
}

.member-pop-item.is-danger:hover {
  background: var(--avoid-bg);
  color: var(--danger);
}

.member-pop-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 4px;
}

/* Compact Studio Hero (TC badge removed -> tighter top breathing room) */
.studio-hero {
  padding: 10px 0 12px;
}

/* Homepage Compact Pricing Summary H2 Section */
.home-pricing-section {
  margin: 48px 0 0;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}

.home-pricing-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 22px;
}

.home-pricing-head-copy {
  max-width: 680px;
  min-width: 0;
}

.home-pricing-head h2 {
  margin: 6px 0 8px;
  padding: 0;
  border: none;
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-h2);
  color: var(--text);
}

.home-pricing-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
}

.home-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.home-pricing-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.home-pricing-card.is-featured {
  border: 2px solid var(--primary);
  box-shadow: 0 12px 28px -18px color-mix(in srgb, var(--primary) 42%, transparent);
}

.home-pricing-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.home-pricing-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-2xs);
  font-weight: 600;
  line-height: 1.3;
  background: var(--surface-tint);
  color: var(--accent-text);
  border: 1px solid var(--accent-border);
}

.home-pricing-badge.is-free {
  background: var(--do-bg);
  color: var(--do-ink);
  border-color: var(--do-border);
}

.home-pricing-badge.is-primary {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}

.home-pricing-note {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--muted-on-bg);
  font-weight: 500;
}

.home-pricing-note.is-save {
  color: var(--do-ink);
  font-weight: 600;
}

.home-pricing-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.home-pricing-prefix,
.home-pricing-unit {
  font-size: var(--fs-xs);
  color: var(--muted-on-bg);
}

.home-pricing-val {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.home-pricing-card h3 {
  margin: 0 0 6px;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text);
}

.home-pricing-card p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

.home-pricing-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.home-pricing-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.home-pricing-bar {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  font-size: var(--fs-xs);
  color: var(--text-secondary);
}

.home-pricing-bar strong {
  color: var(--text);
}

.home-pricing-bar-ok {
  color: var(--do-ink);
  font-weight: 600;
}

/* ==========================================================================
   Workflow Split Pages (/image-to-video, /multi-reference, /prompt-guide)
   ========================================================================== */
.doc-page.is-workflow {
  padding-top: 18px;
  padding-bottom: 56px;
}

.workflow-shell {
  width: 100%;
  min-width: 0;
}

.workflow-shell > section + section,
.workflow-shell .wf-section {
  margin-top: 44px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.workflow-shell .wf-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* First-Screen Asymmetric Split Hero */
.wf-hero {
  display: grid;
  gap: 28px 36px;
  align-items: center;
  min-width: 0;
}

.wf-hero.is-portrait {
  grid-template-columns: minmax(0, 1.32fr) 316px;
}

.wf-hero.is-landscape {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

.wf-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.wf-hero-copy .breadcrumb {
  margin: 0;
}

.wf-hero-copy h1 {
  margin: 4px 0 0;
  font-size: clamp(1.875rem, 1.2rem + 1.8vw, 2.375rem);
  line-height: 1.08;
  letter-spacing: var(--tr-h1);
  color: var(--text);
  text-wrap: balance;
}

.wf-hero-lead {
  margin: 0;
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--muted-on-bg);
  max-width: 620px;
}

.wf-hero-lead code {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent-text);
}

.wf-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding-top: 2px;
}

.wf-trust-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: var(--fs-xs);
  color: var(--muted-on-bg);
  line-height: 1.4;
}

.wf-trust-ok {
  color: var(--do-ink);
  font-weight: 600;
}

.wf-trust-line a {
  color: var(--primary);
  font-weight: 600;
}

/* Multimodal Reference Chips (/multi-reference) */
.wf-cap-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wf-cap-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.wf-cap-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
}

.wf-cap-dot.is-img { background: var(--primary); }
.wf-cap-dot.is-vid { background: var(--coral); }
.wf-cap-dot.is-aud { background: var(--do-ink); }

/* Quick Jump Pills (/prompt-guide) */
.wf-jump-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wf-jump-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--fs-2xs);
  font-weight: 600;
  text-decoration: none;
  transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease;
}

.wf-jump-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface-tint);
}

/* Inline Start-Frame Recipe Card (/image-to-video Hero Left) */
.wf-recipe-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-top: 2px;
}

.wf-recipe-thumb-col {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wf-recipe-thumb-label {
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--muted-on-bg);
}

.wf-recipe-thumb {
  position: relative;
  width: 78px;
  aspect-ratio: 9 / 16;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 2px solid var(--primary);
  background: var(--stage-bg);
  box-shadow: var(--shadow-sm);
}

.wf-recipe-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wf-recipe-thumb-tag {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  padding: 2px 4px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--stage-bg) 82%, transparent);
  color: var(--stage-text);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}

.wf-recipe-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wf-recipe-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
}

.wf-recipe-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
}

.wf-recipe-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--do-bg);
  border: 1px solid var(--do-border);
  color: var(--do-ink);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
}

.wf-recipe-desc {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--text-secondary);
}

.wf-recipe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wf-mini-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: var(--fs-2xs);
  font-weight: 600;
}

.wf-mini-tag.is-accent {
  background: var(--surface-tint);
  color: var(--accent-text);
}

/* Tight 9:16 Vertical Cinema Bezel (/image-to-video Hero Right — ZERO dead voids!) */
.wf-portrait-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.wf-portrait-bezel {
  width: 100%;
  max-width: 312px;
  padding: 8px;
  border-radius: 22px;
  background: var(--stage-bg);
  border: 1px solid var(--stage-border);
  box-shadow: 0 22px 46px -20px color-mix(in srgb, var(--text) 48%, transparent);
}

.wf-portrait-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 15px;
  overflow: hidden;
  background: var(--stage-bg);
}

.wf-portrait-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  display: block;
}

.wf-stage-caption {
  margin: 0;
  font-size: var(--fs-2xs);
  color: var(--muted-on-bg);
  text-align: center;
  line-height: 1.4;
}

/* Input -> Output Proof Module (/multi-reference Hero Right) */
.wf-ref-module {
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.wf-ref-strip-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: var(--fs-2xs);
}

.wf-ref-strip-head strong {
  color: var(--text);
  font-weight: 700;
}

.wf-ref-strip-flow {
  font-family: var(--font-mono);
  color: var(--accent-text);
  font-weight: 600;
}

.wf-ref-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wf-ref-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  min-width: 0;
}

.wf-ref-tile img {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.wf-ref-tile-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.wf-ref-tile-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.wf-ref-tile-role {
  font-size: var(--fs-2xs);
  color: var(--muted-on-bg);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wf-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--stage-bg);
}

.wf-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Collapsible Exact Prompt Drawer (100% present in SSR HTML, zero visual wall!) */
.wf-prompt-drawer {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.wf-prompt-drawer.is-boxed {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg);
  padding: 10px 14px;
}

.wf-prompt-drawer > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--primary);
  user-select: none;
}

.wf-prompt-drawer > summary::-webkit-details-marker {
  display: none;
}

.wf-prompt-drawer.is-boxed > summary {
  color: var(--text);
}

.wf-drawer-chev {
  font-size: 1rem;
  line-height: 1;
  color: var(--primary);
  transition: transform 160ms ease;
  flex-shrink: 0;
}

.wf-prompt-drawer[open] .wf-drawer-chev {
  transform: rotate(180deg);
}

.wf-prompt-drawer-body {
  margin-top: 10px;
}

.wf-prompt-drawer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.wf-prompt-drawer-bar span {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--muted-on-bg);
}

.wf-prompt-drawer .guide-prompt-code {
  margin: 0;
  padding: 12px 14px;
  max-height: 220px;
  overflow-y: auto;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Interactive 5-Part Formula Blueprint Card (/prompt-guide Hero Right) */
.wf-blueprint-card {
  padding: 20px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.wf-blueprint-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wf-blueprint-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
}

.wf-blueprint-title span {
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--muted-on-bg);
  font-size: var(--fs-xs);
}

.wf-fp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wf-fp-btn {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--fs-2xs);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.wf-fp-btn:hover {
  border-color: var(--primary);
}

.wf-fp-btn.is-active[data-formula-part="all"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--surface);
}

.wf-fp-btn[data-formula-part="tc"] {
  background: var(--surface-tint);
  border-color: var(--accent-border);
  color: var(--accent-text);
}

.wf-fp-btn[data-formula-part="sub"] {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}

.wf-fp-btn[data-formula-part="cam"] {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-ink);
}

.wf-fp-btn[data-formula-part="voice"] {
  background: var(--coral-bg);
  border-color: var(--coral-border);
  color: var(--danger);
}

.wf-fp-btn[data-formula-part="sfx"] {
  background: var(--do-bg);
  border-color: var(--do-border);
  color: var(--do-ink);
}

.wf-fp-btn.is-active:not([data-formula-part="all"]) {
  box-shadow: 0 0 0 2px var(--primary);
}

.wf-blueprint-code {
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  line-height: 1.72;
  color: var(--text);
}

.wf-seg {
  padding: 2px 5px;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.wf-seg.is-dim {
  opacity: 0.36;
}

.wf-seg[data-seg="tc"].is-lit {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--accent-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 34%, transparent);
}

.wf-seg[data-seg="sub"].is-lit {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.wf-seg[data-seg="cam"].is-lit {
  background: var(--warn-bg);
  color: var(--warn-ink);
  box-shadow: inset 0 0 0 1px var(--warn-border);
}

.wf-seg[data-seg="voice"].is-lit {
  background: var(--coral-bg);
  color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--coral-border);
}

.wf-seg[data-seg="sfx"].is-lit {
  background: var(--do-bg);
  color: var(--do-ink);
  box-shadow: inset 0 0 0 1px var(--do-border);
}

.wf-blueprint-tip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  line-height: 1.4;
}

.wf-blueprint-tip strong {
  color: var(--text);
}

.wf-blueprint-rate {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--accent-text);
  flex-shrink: 0;
}

/* Section Headers inside Workflow Pages */
.wf-sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 20px;
}

.wf-sec-head h2 {
  margin: 6px 0 0;
  padding: 0;
  border: none;
  font-size: var(--fs-h2);
  line-height: var(--lh-snug);
  letter-spacing: var(--tr-h2);
  color: var(--text);
}

.wf-sec-lead {
  margin: 6px 0 0;
  font-size: var(--fs-base);
  color: var(--text-secondary);
  max-width: 720px;
}

/* 3-Column Fast Fixes Grid (/prompt-guide Section 1) */
.wf-fixes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.wf-fix-card {
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wf-fix-bad {
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--danger);
  line-height: 1.35;
}

.wf-fix-good {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--do-ink);
  line-height: 1.3;
}

.wf-fix-card p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text-secondary);
}

/* Compact Tabbed 2-Column Live Examples (/prompt-guide) */
.wf-ex-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.wf-ex-tab {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-on-bg);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.wf-ex-tab:hover {
  color: var(--text);
}

.wf-ex-tab.is-active,
.wf-ex-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.wf-ex-card {
  padding: 20px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.wf-ex-split {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 24px;
  align-items: start;
}

.wf-ex-media {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.wf-ex-media-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.wf-ex-media-foot h3 {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text);
}

.wf-ex-meta {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  color: var(--muted-on-bg);
  margin: 2px 0 0;
}

.wf-ex-beats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.wf-beat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wf-beat-item {
  padding: 11px 13px;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.wf-beat-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.wf-beat-time {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--primary);
}

.wf-beat-kind {
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--do-ink);
}

.wf-beat-kind.is-voice {
  color: var(--coral);
}

.wf-beat-item p {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--text);
}

.wf-sfx-note {
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--do-bg);
  border: 1px solid var(--do-border);
  font-size: var(--fs-xs);
  color: var(--do-ink);
  line-height: 1.45;
}

/* 2-Column Editorial Panels below the fold on Workflow Pages */
.wf-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.wf-2col.is-weighted {
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
}

.wf-panel {
  padding: 22px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.wf-panel h2,
.wf-panel h3 {
  margin: 0;
  padding: 0;
  border: none;
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
  color: var(--text);
}

.wf-panel p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

.wf-panel ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--text-secondary);
}

.wf-panel strong {
  color: var(--text);
}

.wf-panel code {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent-text);
}

/* Workflow Specs Table Card */
.workflow-shell .table-wrap {
  background: var(--surface);
  border-radius: var(--r-md);
}

.wf-foot-nav {
  margin: 24px 0 0;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Responsive Adjustments for V5 Redesign */
@media (max-width: 960px) {
  .home-pricing-grid,
  .wf-fixes-grid,
  .wf-2col,
  .wf-2col.is-weighted,
  .wf-ex-split,
  .wf-hero.is-portrait,
  .wf-hero.is-landscape {
    grid-template-columns: 1fr;
  }

  .wf-portrait-wrap {
    order: -1;
  }

  .wf-portrait-bezel {
    max-width: 286px;
  }
}

@media (max-width: 640px) {
  .member-bar {
    gap: 7px;
  }

  .credits-pill {
    height: 36px;
    padding: 0 11px 0 9px;
    gap: 6px;
  }

  .member-avatar-btn {
    width: 34px;
    height: 34px;
  }

  .member-popover {
    right: -46px;
    width: min(260px, calc(100vw - 24px));
  }

  .wf-recipe-card {
    flex-direction: column;
  }

  .wf-recipe-thumb {
    width: 96px;
  }

  .wf-ref-strip {
    grid-template-columns: 1fr;
  }

  .wf-hero-actions .btn-primary,
  .wf-hero-actions .btn-secondary {
    width: 100%;
  }
}

/* In-App Browser Sign-In Recovery Modal & Banner */
[data-gf-tool="magi2-video-generator"] .m2w-webview-acts {
  flex-wrap: wrap;
}

[data-gf-tool="magi2-video-generator"] .m2w-inline-btn.is-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
  text-decoration: none;
}

[data-gf-tool="magi2-video-generator"] .m2w-inapp-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

[data-gf-tool="magi2-video-generator"] .m2w-inapp-chrome-btn {
  text-decoration: none;
  justify-content: center;
}

[data-gf-tool="magi2-video-generator"] .m2w-inapp-copy-btn {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

[data-gf-tool="magi2-video-generator"] .m2w-inapp-copy-btn:hover {
  background: var(--surface-tint);
  border-color: var(--primary);
  color: var(--primary);
}

[data-gf-tool="magi2-video-generator"] .m2w-inapp-actions:has(.m2w-inapp-chrome-btn[hidden]) .m2w-inapp-copy-btn {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}

[data-gf-tool="magi2-video-generator"] .m2w-inapp-actions:has(.m2w-inapp-chrome-btn[hidden]) .m2w-inapp-copy-btn:hover {
  background: var(--primary-hover);
  color: var(--primary-ink);
}

[data-gf-tool="magi2-video-generator"] .m2w-inapp-url-field {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
}

[data-gf-tool="magi2-video-generator"] .m2w-inapp-qr-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}

[data-gf-tool="magi2-video-generator"] .m2w-inapp-qr-svg {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  padding: 6px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-gf-tool="magi2-video-generator"] .m2w-inapp-qr-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}

[data-gf-tool="magi2-video-generator"] .m2w-inapp-qr-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

[data-gf-tool="magi2-video-generator"] .m2w-inapp-qr-copy strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

[data-gf-tool="magi2-video-generator"] .m2w-inapp-qr-copy span {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted-on-bg);
}

[data-gf-tool="magi2-video-generator"] .m2w-inapp-anyway {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 6px 4px;
  cursor: pointer;
  font-family: var(--font-sans);
}

/* ==========================================================================
   Mobile Fixed Bottom Generate Dock (<=640px only; desktop untouched)
   ========================================================================== */
[data-gf-tool="magi2-video-generator"] .m2w-mobile-dock {
  display: none;
}

@media (max-width: 640px) {
  body:has([data-m2w-mobile-dock]) .site-footer {
    padding-bottom: calc(144px + env(safe-area-inset-bottom));
  }

  body.m2w-modal-open [data-gf-tool="magi2-video-generator"] .m2w-mobile-dock {
    display: none !important;
  }

  [data-gf-tool="magi2-video-generator"] .m2w-left-footer {
    position: static;
    box-shadow: none;
    border-top: none;
    padding: 0;
    background: transparent;
  }

  [data-gf-tool="magi2-video-generator"] .m2w-left-footer:has(.m2w-pay-banner:not([hidden]), .m2w-paused-note:not([hidden]), .m2w-signin-card:not([hidden]), .m2w-status:not([hidden])) {
    padding: 10px 14px 14px;
    border-top: 1px solid var(--border);
  }

  [data-gf-tool="magi2-video-generator"] .m2w-left-footer > .m2w-bar-row,
  [data-gf-tool="magi2-video-generator"] .m2w-left-footer > .m2w-cta-btn,
  [data-gf-tool="magi2-video-generator"] .m2w-left-footer > .m2w-auth-hint {
    display: none !important;
  }

  [data-gf-tool="magi2-video-generator"] .m2w-popover {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(122px + env(safe-area-inset-bottom));
    top: auto;
    z-index: 58;
    max-height: 62vh;
    overflow-y: auto;
    box-shadow: 0 22px 48px -12px color-mix(in srgb, var(--text) 34%, transparent);
  }

  [data-gf-tool="magi2-video-generator"] .m2w-mobile-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 14px max(10px, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-strong);
    box-shadow: 0 -10px 28px -14px color-mix(in srgb, var(--text) 24%, transparent);
  }

  [data-gf-tool="magi2-video-generator"] .m2w-mobile-dock-top {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  [data-gf-tool="magi2-video-generator"] .m2w-mobile-preset-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 28px;
    padding: 3px 11px;
    border-radius: var(--r-pill);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    max-width: 100%;
    white-space: nowrap;
  }

  [data-gf-tool="magi2-video-generator"] .m2w-mobile-preset-btn:active {
    background: var(--surface-tint);
    border-color: var(--primary);
  }

  [data-gf-tool="magi2-video-generator"] .m2w-mobile-dock-note {
    margin: 0;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    color: var(--do-ink);
  }

  [data-gf-tool="magi2-video-generator"] .m2w-mobile-dock-note[data-gf-if-member] {
    color: var(--muted-on-bg);
  }

  [data-gf-tool="magi2-video-generator"] .m2w-mobile-cta {
    width: 100%;
    min-height: 46px;
    font-size: 15px;
    border-radius: 12px;
  }

  [data-gf-tool="magi2-video-generator"] .m2w-pass-dock {
    bottom: calc(130px + env(safe-area-inset-bottom));
  }

  [data-gf-tool="magi2-video-generator"] .m2w-toast {
    bottom: calc(134px + env(safe-area-inset-bottom));
  }
}

/* ==========================================================================
   Reduced Motion Preference
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
