.account-dialog, .account-dialog * { box-sizing: border-box; }
.account-dialog { width: min(460px,calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 34px; margin: auto; border: 1px solid #f7f1e32b; border-radius: 16px; background: #17171e; color: var(--ink); box-shadow: 0 30px 100px #0008; font-family: var(--body-font); }
.account-dialog::backdrop { background: #050508ba; backdrop-filter: blur(8px); }
.account-dialog [hidden], [data-account-control] [hidden], .history-sign-in[hidden] { display: none !important; }
.auth-close { position: absolute; top: 14px; right: 15px; display: grid; place-items: center; width: 31px; height: 31px; padding: 0; border: 1px solid #f7f1e31c; border-radius: 50%; background: transparent; color: var(--muted); font: 400 23px/1 var(--body-font); cursor: pointer; }
.auth-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; }
.auth-heading > span:last-child { color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: 1.5px; }
.account-dialog h2 { margin: 0 0 10px; font: 700 29px/1.18 var(--body-font); letter-spacing: -.9px; }
.auth-description { font-size: 12px; line-height: 1.75; margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.auth-benefits { display: flex; flex-direction: column; gap: 7px; margin: 18px 0 22px; color: var(--soft); font-size: 11px; }
.auth-draft-note { margin: 0 0 20px; padding: 10px 12px; border: 1px solid #2ee59d30; border-radius: 7px; background: #2ee59d08; color: var(--green); font-size: 11px; line-height: 1.6; }
.auth-google { min-height: 0; width: 100%; }
.auth-google-preview { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 44px; padding: 0 14px; border: 1px solid #dadce0; border-radius: 4px; background: #fff; color: #3c4043; font: 500 14px/1.4 var(--body-font); cursor: pointer; }
.auth-google-preview:hover { background: #f8faff; }
.auth-terms { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.8; text-align: center; }
.auth-terms a { color: var(--soft); text-underline-offset: 3px; }
.auth-error, .auth-progress { margin: 14px 0 0; font-size: 11px; line-height: 1.65; }
.auth-error { color: #ff9daf; }
.auth-progress { color: var(--green); }
.auth-footer { border-top: 1px solid #f7f1e314; margin: 22px 0 0; padding-top: 15px; font-size: 10px; line-height: 1.65; color: #96919a; }
.account-dialog :is(button,a):focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.global-auth-control { position: relative; }
.global-header .account-sign-in { font-size: 12px; }
.global-header .account-menu { position: relative; border: 0; }
.account-menu > summary { list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.global-header .account-menu > summary { max-width: 165px; min-height: 40px; gap: 8px; padding: 6px 10px; border: 1px solid transparent; }
.global-header .account-menu[open] > summary { border-color: #f7f1e326; background: #f7f1e30a; color: var(--ink); }
[data-account-name] { max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 12px; }
.account-chevron { margin-left: 2px; color: var(--muted); }
.account-initial { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; background: #2ee59d20; color: var(--green); font-size: 11px; font-weight: 700; }
.account-dropdown { position: absolute; z-index: 80; top: calc(100% + 12px); right: 0; width: 250px; padding: 10px; border: 1px solid #f7f1e326; border-radius: 11px; background: #18181f; box-shadow: 0 18px 50px #0007; }
.account-email { display: block; padding: 8px 10px 13px; border-bottom: 1px solid #f7f1e317; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.account-links { padding-top: 7px; }
.account-links > a, .account-links > button { display: block; width: 100%; padding: 10px; min-height: 37px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); text-decoration: none; text-align: left; font: 400 12px/1.4 var(--body-font); cursor: pointer; }
.account-links > a:hover, .account-links > button:hover { background: #f7f1e30a; }
.account-dropdown > p { margin: 6px 10px; font-size: 10px; color: #ff9daf; }
.draft-save-status { margin: 3px 0 0; font-size: 10px; color: var(--muted); min-height: 16px; }
.draft-save-status[data-state=saved] { color: var(--green); }
.draft-save-status[data-state=error] { color: #ff9daf; }
.creator-topline:has(.draft-save-status) { display: block; }
.history-sign-in { display: flex; align-items: center; flex-direction: column; justify-content: center; min-height: 285px; padding: 30px 15px; gap: 14px; text-align: center; }
.history-sign-in .global-brand-mark { margin-bottom: 5px; }
.history-sign-in h2 { font: 600 23px/1.3 var(--body-font); letter-spacing: -.5px; }
.history-sign-in p { max-width: 340px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.history-sign-in .button { margin-top: 6px; }
@media (max-width:760px) {
  .global-auth-control { width: 100%; }
  .global-header .account-menu > summary { max-width: 100%; }
  .account-dropdown { position: static; width: 100%; margin-top: 4px; border: 0; border-radius: 6px; box-shadow: none; background: #101014; }
}
@media (max-width:540px) {
  .account-dialog { padding: 30px 24px 24px; max-height: calc(100dvh - 24px); }
  .account-dialog h2 { font-size: 26px; }
  .auth-heading { margin-bottom: 20px; }
}

.global-header .global-credit-link { gap: 5px; min-width: 104px; border: 1px solid #f7f1e326; background: #f7f1e305; color: var(--ink); }
.global-header .global-credit-link strong { color: var(--green); font-size: 13px; font-weight: 700; }
.global-header .global-credit-link span { color: var(--muted); font-size: 10px; }
.global-header .global-credit-link:hover, .global-header .global-credit-link[aria-current] { border-color: #2ee59d5c; background: #2ee59d08; }
@media(max-width:760px){.global-header .global-credit-link { justify-content: flex-start; width: 100%; margin-top: 5px; }}


/* Shared TLPUR foundation for the website and creator. */
:root {
  color-scheme: dark;
  --ink: #f7f1e3;
  --muted: #b9b2a3;
  --soft: #ded3ba;
  --paper: #101014;
  --panel: #181820;
  --panel-strong: #20202a;
  --line: rgba(247, 241, 227, 0.16);
  --red: #ff375f;
  --yellow: #ffd166;
  --green: #2ee59d;
  --blue: #4dabf7;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.36);
  --body-font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --heading-font: Georgia, "Times New Roman", serif;
  --site-background:
    radial-gradient(circle at 18% 10%, rgba(255, 55, 95, 0.18), transparent 28rem),
    radial-gradient(circle at 86% 28%, rgba(46, 229, 157, 0.14), transparent 25rem),
    linear-gradient(135deg, #09090d 0%, #111015 48%, #10140f 100%);
}

body {
  margin: 0;
  background: var(--site-background);
  color: var(--ink);
  font-family: var(--body-font);
  line-height: 1.6;
}


:root {
  --surface: var(--panel);
  --surface-raised: var(--panel-strong);
  --surface-hover: rgba(247, 241, 227, .06);
  --control-line: rgba(247, 241, 227, .1);
  --accent-wash: rgba(46, 229, 157, .1);
  --error: #ff8fa5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .4; cursor: not-allowed; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, select { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
h1, h2, h3, p, figure { margin: 0; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.svg-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.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; }
.site-header { display: flex; align-items: center; gap: 20px; height: 64px; padding: 0 26px; border-bottom: 1px solid var(--control-line); }
.brand { display: flex; align-items: center; gap: 9px; font-size: 21px; font-weight: 800; letter-spacing: 0; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(135deg, var(--red), var(--yellow) 42%, var(--green)); color: #09090d; font-size: 16px; }
.header-divider { width: 1px; height: 17px; background: var(--line); }
.product-name { font-size: 12px; color: var(--muted); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.site-link { font-size: 12px; color: var(--muted); }
.site-link:hover { color: var(--ink); }
.site-link > span { margin-left: 7px; }
.preview-status, .stage-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.preview-status > span, .stage-status > span:first-child { width: 5px; height: 5px; border-radius: 50%; background: var(--yellow); }
.studio-shell { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: 16px; width: min(1880px, 100%); padding: 18px 20px 20px; margin: auto; align-items: stretch; }
.creator-panel, .preview-panel { min-width: 0; border: 1px solid var(--control-line); background: var(--surface); border-radius: 12px; }
.creator-panel { display: flex; flex-direction: column; padding: 19px; min-height: calc(100dvh - 104px); }
.creator-topline, .section-topline, .input-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.creator-topline h1 { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 700; line-height: 1.5; }
.creator-topline h1 .icon { color: var(--green); width: 18px; height: 18px; flex-basis: 18px; }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 4px; border-radius: 8px; background: var(--paper); margin: 16px 0 18px; }
.mode-tab { border: 0; border-radius: 5px; padding: 7px 12px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.mode-tab.is-active { color: var(--ink); background: var(--surface-raised); box-shadow: 0 1px 4px #0003; }
.creator-inputs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.creator-inputs > section { min-width: 0; }
.input-label { min-height: 20px; margin-bottom: 8px; }
.input-label > span, .input-label h2 { font-size: 12px; font-weight: 500; color: var(--soft); }
.text-button { border: 0; padding: 0; background: transparent; font-size: 11px; color: var(--muted); white-space: nowrap; }
.text-button:hover { color: var(--ink); }
.input-label .text-button { font-size: 10px; }
.media-input { height: 182px; position: relative; overflow: hidden; border: 1px dashed rgba(247,241,227,.22); border-radius: 8px; background: var(--paper); }
.media-input.is-dragover { border-color: var(--green); background: var(--accent-wash); }
.input-media { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.input-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 15%, rgba(9,9,13,.18) 35%, rgba(9,9,13,.96) 100%); pointer-events: none; }
.input-placeholder-icon { position: absolute; left: calc(50% - 16px); top: 34px; width: 32px; height: 32px; color: var(--muted); }
.input-caption { position: absolute; bottom: 51px; left: 11px; right: 11px; pointer-events: none; }
.input-caption strong { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.input-caption p { margin-top: 3px; font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-action { position: absolute; left: 11px; right: 11px; bottom: 11px; display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 31px; border: 1px solid rgba(247,241,227,.25); border-radius: 6px; background: rgba(24,24,32,.9); font-size: 11px; font-weight: 600; }
.tile-action:hover { background: var(--surface-raised); border-color: var(--green); }
.tile-action .icon { width: 13px; height: 13px; flex-basis: 13px; color: var(--green); }
.input-upload { display: flex; align-items: center; justify-content: center; gap: 5px; margin: 9px auto 0; min-height: 19px; font-size: 10px; }
.input-upload .icon { width: 12px; height: 12px; flex-basis: 12px; }
.photo-placeholder { position: absolute; inset: 0 0 39px; display: flex; align-items: center; justify-content: center; gap: 7px; flex-direction: column; color: var(--muted); }
.photo-placeholder .icon { width: 28px; height: 28px; margin-bottom: 4px; }
.photo-placeholder strong { color: var(--soft); font-size: 11px; font-weight: 500; }
.photo-placeholder > span { font-size: 9px; }
.character-input.is-empty .input-caption, .character-input.is-empty .input-shade { display: none; }
.character-input.is-preview-unavailable .photo-placeholder { color: var(--soft); background: radial-gradient(circle at 50% 28%, rgba(46,229,157,.09), transparent 56%); }
.character-input.is-preview-unavailable .photo-placeholder .icon { color: var(--green); }
.quick-library { margin: 20px 0 19px; }
.section-topline h2, .section-topline .field-label { font-size: 12px; font-weight: 500; }
.section-topline .text-button { font-size: 10px; }
.section-topline .text-button span:last-child { margin-left: 5px; }
.quick-templates { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; margin-top: 10px; }
.quick-template { position: relative; min-width: 0; padding: 0; aspect-ratio: 1; border: 2px solid transparent; border-radius: 7px; overflow: hidden; background: var(--paper); }
.quick-template img { width: 100%; height: 100%; object-fit: cover; transition: transform .15s; }
.quick-template:hover { border-color: var(--muted); }
.quick-template:hover img { transform: scale(1.06); }
.quick-template.is-selected { border-color: var(--green); }
.quick-template > span { position: absolute; bottom: 2px; right: 3px; width: 13px; height: 13px; display: grid; place-items: center; color: var(--paper); border-radius: 3px; background: var(--green); }
.quick-template > span .icon { width: 10px; height: 10px; }
.input-note { margin-top: 10px; font-size: 10px; color: var(--muted); }
.creator-settings { margin-top: auto; }
.plan-settings { margin-top: 14px; }
.field-label { display: block; margin-bottom: 7px; font-size: 12px; color: var(--soft); font-weight: 500; }
.field-label > span { color: var(--muted); margin-left: 4px; font-size: 10px; }
select, .trim-fields input { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 8px 10px; min-height: 36px; font-size: 12px; }
select:hover { border-color: rgba(247,241,227,.3); }
.setting-hint { margin-top: 6px; font-size: 10px; color: var(--muted); }
.trim-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 11px; }
.trim-fields label { font-size: 10px; color: var(--muted); }
.trim-fields input { margin-top: 4px; font-variant-numeric: tabular-nums; }
.trim-fields.is-test { grid-template-columns: 1fr; }
.extra-settings { margin-top: 10px; }
.extra-settings summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; min-height: 28px; font-size: 11px; color: var(--muted); }
.extra-settings summary::-webkit-details-marker { display: none; }
.extra-settings[open] summary { margin-bottom: 10px; }
.extra-settings[open] summary > span { transform: rotate(45deg); }
#h3-extra .field-label:not(:first-child) { margin-top: 12px; }
.model-settings { margin-bottom: 16px; }
.model-settings > div { margin-top: 12px; }
textarea { display: block; width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 12px; line-height: 1.8; resize: vertical; }
textarea::placeholder { color: var(--muted); }
textarea:focus, input:focus { outline: 1px solid var(--green); border-color: var(--green); }
.extra-settings textarea { font-size: 11px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.button .icon { width: 15px; height: 15px; flex-basis: 15px; }
.button-primary { color: var(--paper); background: var(--ink); border-color: var(--ink); font-weight: 800; }
.button-primary:hover { background: var(--soft); border-color: var(--soft); }
.button-outline { color: var(--ink); background: transparent; }
.button-outline:hover { background: var(--surface-hover); border-color: var(--muted); }
.generate-button { width: 100%; min-height: 56px; justify-content: space-between; padding: 14px 18px; font-size: 15px; }
.generate-button,
#mobile-generate {
  position: relative;
  isolation: isolate;
  color: #08251a;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 8px 24px rgba(46,229,157,.12);
  transition: transform 180ms cubic-bezier(.2,0,0,1), box-shadow 180ms ease-out, background-color 180ms ease-out;
}
.generate-button::before,
#mobile-generate::before {
  content: '';
  position: absolute;
  inset: -5px;
  border: 1px solid var(--green);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
}
.generate-button:not(:disabled)::before,
#mobile-generate:not(:disabled)::before {
  animation: generate-breathe 3.2s cubic-bezier(.4,0,.2,1) infinite;
}
.generate-button .icon,
#mobile-generate .icon {
  width: 18px; height: 18px; flex-basis: 18px;
  transition: transform 220ms cubic-bezier(.2,0,0,1);
}
.generate-button:not(:disabled) .icon,
#mobile-generate:not(:disabled) .icon {
  animation: generate-arrow 3.2s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes generate-breathe {
  0%, 100% { opacity: 0; transform: scale(.985,.96); }
  50% { opacity: .4; transform: scale(1.012,1.06); }
}
@keyframes generate-arrow {
  0%, 66%, 100% { transform: translateX(0); }
  78% { transform: translateX(4px); }
  90% { transform: translateX(0); }
}
@media (hover:hover) and (pointer:fine) {
  .generate-button:not(:disabled):hover,
  #mobile-generate:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(46,229,157,.2);
  }
  .generate-button:not(:disabled):hover .icon,
  #mobile-generate:not(:disabled):hover .icon {
    animation: none;
    transform: translateX(4px);
  }
}
.generate-button:not(:disabled):active,
#mobile-generate:not(:disabled):active {
  transform: translateY(0) scale(.985);
  transition-duration: 100ms;
}
.generate-button:hover,
#mobile-generate:hover {
  color: #071d14;
  background: #63edb7;
  border-color: #63edb7;
}
.generate-button:disabled,
#mobile-generate:disabled {
  color: #10271f;
  background: rgba(46,229,157,.5);
  border-color: transparent;
  box-shadow: none;
  opacity: .62;
}
.creator-buy-credits { width: 100%; margin-top: 8px; }
.generation-action-error { margin: 9px 2px 0; line-height: 1.5; }
.field-error { margin-top: 8px; color: var(--error); font-size: 10px; }
.prompt-panel { margin: 15px 0 22px; }
.prompt-panel .section-topline { margin-bottom: 8px; }
.prompt-panel .field-label { margin-bottom: 0; }
#prompt-count { font-size: 9px; color: var(--muted); }
.prompt-presets { display: flex; gap: 7px; margin-top: 10px; }
.prompt-presets button { padding: 4px 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: transparent; font-size: 10px; }
.prompt-presets button:hover, .prompt-presets button.is-active { color: var(--green); background: var(--accent-wash); border-color: rgba(46,229,157,.3); }
body.is-prompt .creator-inputs { grid-template-columns: 1fr; }
body.is-prompt .character-input { height: 115px; }
body.is-prompt .character-input .input-media { width: 88px; object-fit: cover; }
body.is-prompt .character-input .input-shade { display: none; }
body.is-prompt .character-input .input-caption { left: 104px; bottom: auto; top: 14px; }
body.is-prompt .character-input .tile-action { left: 104px; right: auto; padding: 0 12px; bottom: 16px; }
body.is-prompt .character-input .photo-placeholder { inset: 0 auto 0 0; width: 88px; }
body.is-prompt .character-input .photo-placeholder > strong, body.is-prompt .character-input .photo-placeholder > span { display: none; }
body.is-prompt .character-input.is-empty .tile-action { left: 104px; }
body.is-prompt .input-upload { display: none; }
body.is-prompt .quick-library { display: none; }

/* The preview remains spacious; media and labels carry the explanation. */
.preview-panel { display: flex; flex-direction: column; position: relative; min-height: calc(100dvh - 104px); background: rgba(16,16,20,.86); }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 20px; }
.stage-tabs { display: inline-flex; gap: 3px; padding: 4px; border-radius: 8px; background: var(--surface-raised); }
.stage-tab { padding: 7px 13px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; }
.stage-tab.is-active { background: rgba(247,241,227,.12); color: var(--ink); }
.stage-status { font-size: 10px; }
.stage-status > span:first-child { background: var(--green); }
.stage-content { padding: 38px 34px 50px; margin: auto 0; }
.stage-heading { text-align: center; margin: 0 auto 36px; max-width: 620px; }
.eyebrow { color: var(--green); font-size: 9px; font-weight: 600; letter-spacing: 2px; }
.stage-heading > .eyebrow { display: inline-flex; align-items: center; gap: 9px; }
.stage-heading > .eyebrow::before { content: ''; width: 25px; height: 3px; background: linear-gradient(90deg, var(--red) 0 25%, var(--yellow) 25% 50%, var(--green) 50% 75%, var(--blue) 75%); }
.stage-heading h2 { margin-top: 12px; font-family: var(--heading-font); font-size: clamp(23px, 2.4vw, 36px); line-height: 1.35; letter-spacing: 0; }
.stage-heading p { margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.8; }
.mix-demonstration, .current-media-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr); align-items: start; gap: 13px; max-width: 850px; margin: auto; }
.demo-card, .composition-card { min-width: 0; }
.demo-media, .plan-preview { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 10px; border: 1px solid var(--control-line); background: #09090d; }
.demo-media > img, .demo-media > video, .plan-preview > img, .plan-preview > video { width: 100%; height: 100%; object-fit: contain; }
.demo-media > img { object-fit: cover; }
.result-card .demo-media { border-color: rgba(46,229,157,.3); }
.media-badge { position: absolute; top: 9px; left: 9px; padding: 3px 6px; border: 1px solid rgba(247,241,227,.18); border-radius: 4px; background: rgba(9,9,13,.8); color: var(--soft); font-size: 8px; font-weight: 500; letter-spacing: .7px; pointer-events: none; }
.result-badge { border-color: rgba(46,229,157,.3); color: var(--green); }
.mix-operator { align-self: center; margin-top: -52px; color: var(--muted); text-align: center; font-size: 22px; font-weight: 400; }
.demo-card figcaption, .composition-card figcaption { margin-top: 13px; text-align: center; }
.demo-card figcaption strong, .composition-card figcaption strong { display: block; font-size: 12px; font-weight: 600; }
.demo-card figcaption > span, .composition-card figcaption > span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.verified-dot { display: inline-block; width: 5px; height: 5px; margin: 0 0 2px 4px; border-radius: 50%; background: var(--green); }
.demo-actions { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 30px; }
.demo-actions .button { min-height: 35px; font-size: 11px; }
.demo-actions .text-button { font-size: 10px; }
.demo-disclaimer, .composition-note { margin-top: 15px; font-size: 10px; text-align: center; color: var(--muted); }
.preview-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding: 14px 20px; color: var(--muted); border-top: 1px solid var(--control-line); font-size: 9px; }
.preview-footer > span:first-child { font-size: 8px; letter-spacing: 1.5px; }
.preview-footer a { font-size: 10px; }
.preview-footer a:hover { color: var(--yellow); }
.preview-footer a > span { margin-left: 5px; }
.selected-description { display: flex; align-items: center; gap: 7px; text-align: left !important; }
.selected-description > div { min-width: 0; flex: 1; }
.selected-description strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.selected-description p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.icon-button { display: grid; place-items: center; flex: 0 0 29px; width: 29px; height: 29px; padding: 0; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: transparent; }
.icon-button .icon { width: 14px; height: 14px; flex-basis: 14px; }
.icon-button:hover { background: var(--surface-hover); }
.preview-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 12px; }
.output-placeholder { border: 1px dashed rgba(247,241,227,.16); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; padding: 15px; background: var(--surface); text-align: center; }
.output-placeholder > .icon { width: 30px; height: 30px; flex-basis: 30px; color: var(--muted); margin-bottom: 4px; }
.output-placeholder > strong { font-size: 12px; font-weight: 500; }
.output-placeholder > p { font-size: 10px; color: var(--muted); }
.output-placeholder > span { padding: 3px 6px; border-radius: 4px; background: var(--surface-raised); color: var(--muted); font-size: 8px; margin-top: 5px; }
.composition-note { margin-top: 24px; }
body.is-prompt .current-character, body.is-prompt .current-plus { display: none; }
body.is-prompt .current-media-grid { grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr); max-width: 570px; }
.mobile-action-bar { display: none; }

/* Search and previews stay out of the primary workspace. */
.studio-dialog { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px; width: min(90vw, 650px); max-height: 91dvh; overflow: auto; box-shadow: var(--shadow); }
.studio-dialog::backdrop { background: rgba(5,5,7,.75); }
.dialog-close { position: absolute; top: 16px; right: 16px; z-index: 3; background: rgba(16,16,20,.95); }
.studio-dialog h2 { font-size: 22px; font-weight: 600; line-height: 1.4; }
.dialog-intro { margin-top: 9px; max-width: 90%; color: var(--muted); font-size: 12px; }
.library-dialog { padding: 0; width: min(calc(100vw - 48px), 1040px); max-height: min(840px,91dvh); }
.library-dialog[open] { display: flex; flex-direction: column; }
.library-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 23px; border-bottom: 1px solid var(--control-line); flex-shrink: 0; }
.library-dialog-header h2 { font-size: 19px; }
.library-dialog-header p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.library-dialog-body { min-height: 0; overflow-y: auto; padding: 18px 23px 22px; }
.library-filters { position: sticky; top: -18px; z-index: 2; padding-top: 2px; background: var(--surface); }
.library-toolbar { display: flex; align-items: center; gap: 12px; }
.search-box { display: flex; align-items: center; gap: 9px; padding: 0 11px; height: 39px; flex: 1; min-width: 0; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.search-box .icon { width: 15px; height: 15px; flex-basis: 15px; }
.search-box input { width: 100%; min-width: 0; color: var(--ink); background: transparent; border: 0; outline: 0; font-size: 12px; }
.search-box:focus-within { border-color: var(--green); }
.search-key { font-size: 9px; }
.upload-motion { font-size: 11px; }
.categories { display: flex; gap: 6px; margin: 13px 0 10px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
.categories::-webkit-scrollbar { display: none; }
.category-button { min-height: 30px; border: 1px solid transparent; border-radius: 5px; padding: 4px 10px; color: var(--muted); background: transparent; font-size: 11px; white-space: nowrap; }
.category-button:hover { background: var(--surface-hover); }
.category-button.is-active { border-color: rgba(46,229,157,.2); color: var(--green); background: var(--accent-wash); }
.library-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 13px; font-size: 10px; color: var(--muted); }
.sort-control { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.sort-control select { width: auto; min-height: 25px; padding: 2px 5px; border: 0; font-size: 10px; }
.template-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 18px 13px; }
.template-card { min-width: 0; }
.template-cover { position: relative; display: block; width: 100%; aspect-ratio: 3/4; overflow: hidden; padding: 0; border: 2px solid transparent; border-radius: 7px; background: var(--paper); }
.template-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .15s; }
.template-cover:hover img { transform: scale(1.025); }
.template-card.is-selected .template-cover { border-color: var(--green); }
.template-duration { position: absolute; right: 6px; bottom: 7px; padding: 1px 5px; border-radius: 3px; background: rgba(9,9,13,.8); color: var(--ink); font-size: 10px; }
.template-play { position: absolute; left: 7px; bottom: 7px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--paper); background: var(--ink); }
.template-play .icon { width: 12px; height: 12px; }
.template-check { position: absolute; right: 6px; top: 7px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--paper); background: var(--green); }
.template-check .icon { width: 13px; height: 13px; }
.template-tested { position: absolute; left: 6px; top: 7px; padding: 2px 5px; border-radius: 3px; color: var(--green); background: rgba(16,16,20,.92); font-size: 8px; }
.template-curated { position: absolute; left: 6px; top: 7px; padding: 3px 6px; border-radius: 3px; color: #20351a; background: #e8f1d9; font-size: 9px; font-weight: 600; }
.template-cover.has-curation .template-tested { top: 29px; }
.template-name { display: block; width: 100%; padding: 8px 0 0; color: var(--ink); background: transparent; border: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-size: 11px; font-weight: 500; }
.template-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: 5px; }
.template-category { min-width: 0; font-size: 9px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-template { padding: 3px 7px; min-height: 25px; border: 1px solid var(--control-line); border-radius: 4px; color: var(--soft); background: var(--surface-raised); font-size: 9px; white-space: nowrap; }
.template-card.is-selected .select-template { color: var(--green); background: var(--accent-wash); }
.select-template:hover { border-color: var(--muted); }
.load-more { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 22px auto 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; }
.load-more .icon { width: 13px; height: 13px; }
.library-footnote { margin-top: 18px; color: var(--muted); font-size: 10px; }
.empty-state, .library-error { padding: 55px 15px; text-align: center; }
.empty-state .icon { width: 28px; height: 28px; margin-bottom: 15px; color: var(--muted); }
.empty-state h3 { font-size: 16px; }
.empty-state p, .library-error p { margin: 8px 0 18px; font-size: 11px; color: var(--muted); }
.template-dialog { display: none; grid-template-columns: 1fr 1fr; padding: 0; width: min(88vw,700px); overflow: hidden; }
.template-dialog[open] { display: grid; }
.dialog-template-stage { height: min(69dvh,550px); background: #09090d; }
.dialog-template-stage video { width: 100%; height: 100%; object-fit: contain; }
.template-dialog-information { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 45px 27px 27px; }
.template-dialog-information h2 { margin-top: 12px; font-size: 23px; overflow-wrap: anywhere; }
#template-dialog-meta { margin-top: 12px; font-size: 11px; color: var(--muted); }
.template-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 16px; }
.template-tags span { padding: 3px 7px; border-radius: 4px; background: var(--surface-raised); color: var(--soft); font-size: 10px; }
.template-dialog-actions { display: flex; flex-direction: column-reverse; gap: 20px; margin-top: 28px; text-align: center; }
.sample-dialog { width: min(91vw,750px); padding: 30px; }
.sample-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
.sample-comparison video { width: 100%; height: min(49dvh,410px); border-radius: 8px; object-fit: contain; background: #09090d; }
.sample-comparison figcaption { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 11px; }
.sample-comparison figcaption small { font-size: 10px; color: var(--muted); }
.sample-note { margin: 18px 0; color: var(--muted); font-size: 11px; }
.repeat-generation-dialog { width: min(calc(100vw - 32px), 470px); padding: 30px; }
.repeat-generation-dialog .eyebrow { color: var(--green); }
.repeat-generation-dialog h2 { margin-top: 10px; max-width: 390px; }
.repeat-generation-copy { margin-top: 13px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.repeat-generation-copy strong { color: var(--ink); font-weight: 600; }
.repeat-generation-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; margin-top: 27px; }
.repeat-generation-actions .button { min-width: 0; padding-left: 12px; padding-right: 12px; }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); z-index: 100; max-width: calc(100% - 32px); padding: 11px 17px; color: var(--ink); background: var(--surface-raised); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); font-size: 12px; }
.noscript-note { padding: 30px; color: var(--error); }

@media (min-width:1700px) {
  .studio-shell { grid-template-columns: 430px minmax(0,1fr); }
  .media-input { height: 215px; }
  .mix-demonstration, .current-media-grid { max-width: 990px; gap: 20px; }
  .stage-heading { margin-bottom: 44px; }
}
@media (max-width:1180px) {
  .studio-shell { grid-template-columns: 350px minmax(0,1fr); gap: 12px; padding: 14px; }
  .creator-panel { padding: 16px; }
  .creator-inputs { gap: 10px; }
  .media-input { height: 175px; }
  .stage-content { padding: 32px 23px 38px; }
  .stage-heading p { font-size: 11px; }
  .mix-demonstration, .current-media-grid { gap: 8px; grid-template-columns: minmax(0,1fr) 13px minmax(0,1fr) 13px minmax(0,1fr); }
  .demo-card figcaption > span, .composition-card figcaption > span { font-size: 9px; }
  .demo-card figcaption strong, .composition-card figcaption strong { font-size: 11px; }
  .mix-operator { font-size: 18px; }
  .media-badge { font-size: 7px; top: 6px; left: 6px; padding: 2px 4px; }
  .stage-status { display: none; }
  .output-placeholder { padding: 8px; gap: 7px; }
  .output-placeholder strong { font-size: 10px; }
  .output-placeholder p, .output-placeholder span { font-size: 8px; }
}
@media (min-width:901px) and (max-height:860px) {
  .creator-panel { min-height: 0; }
  .media-input { height: 155px; }
  .quick-library { margin: 15px 0; }
  .mode-tabs { margin: 12px 0; }
  .stage-content { padding-top: 26px; padding-bottom: 30px; }
  .stage-heading { margin-bottom: 25px; }
}
@media (max-width:900px) {
  body { padding-bottom: 85px; }
  .site-header { height: 60px; padding: 0 18px; gap: 14px; }
  .studio-shell { grid-template-columns: minmax(0,1fr); padding: 14px; gap: 14px; max-width: 760px; }
  .creator-panel { min-height: 0; padding: 18px; }
  .media-input { height: 205px; }
  .creator-inputs { gap: 14px; }
  .quick-templates { grid-template-columns: repeat(6,minmax(0,1fr)); max-width: 460px; }
  .quick-library { margin-bottom: 18px; }
  .creator-settings { margin-top: 0; }
  .plan-settings { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
  .extra-settings { margin-top: 0; padding-top: 20px; }
  .extra-settings[open] { grid-column: 1/-1; padding-top: 0; }
  .generate-button { display: none; }
  .mobile-action-bar { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 73px; padding: 12px 20px max(12px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(16,16,20,.96); backdrop-filter: blur(12px); }
  .mobile-action-bar > div { display: grid; gap: 3px; min-width: 0; }
  .mobile-action-bar strong { font-size: 12px; font-weight: 500; }
  .mobile-action-bar span { font-size: 10px; color: var(--muted); }
  .mobile-action-bar .button { min-height: 48px; min-width: 148px; font-size: 14px; }
  .mobile-action-bar #mobile-generate span { color: inherit; font-size: inherit; }
  .preview-panel { min-height: 0; }
  .preview-toolbar { padding: 15px 16px; }
  .stage-status { display: flex; }
  .stage-content { padding: 22px 25px 32px; }
  .stage-heading { margin-bottom: 27px; }
  .stage-heading h2 { font-size: 28px; }
  .mix-demonstration, .current-media-grid { gap: 11px; grid-template-columns: minmax(0,1fr) 15px minmax(0,1fr) 15px minmax(0,1fr); }
  .demo-media, .plan-preview { border-radius: 8px; }
  .preview-footer { padding: 13px 16px; }
  .toast { bottom: 90px; }
  .template-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media (max-width:540px) {
  .site-header { padding: 0 15px; gap: 12px; }
  .brand { font-size: 19px; gap: 7px; }
  .brand-mark { width: 29px; height: 29px; }
  .product-name { font-size: 10px; }
  .site-link { display: none; }
  .preview-status { font-size: 9px; gap: 5px; }
  .studio-shell { padding: 11px; gap: 12px; }
  .creator-panel { padding: 15px; }
  .creator-topline h1 { font-size: 16px; }
  .mode-tabs { margin: 14px 0 15px; }
  .creator-inputs { gap: 10px; }
  .media-input { height: 179px; }
  .input-label { gap: 6px; }
  .input-label > span, .input-label h2 { font-size: 11px; }
  .input-caption { left: 9px; right: 9px; }
  .tile-action { left: 9px; right: 9px; }
  .input-caption strong { font-size: 10px; }
  .input-caption p { font-size: 8px; }
  .tile-action { font-size: 10px; }
  .quick-library { margin-top: 17px; }
  .quick-templates { gap: 6px; }
  select, .trim-fields input { font-size: 12px; }
  textarea, #motion-prompt, .extra-settings textarea { font-size: 16px; }
  .stage-content { padding: 20px 14px 27px; }
  .stage-heading { margin-bottom: 22px; }
  .stage-heading h2 { font-size: 22px; }
  .stage-heading p { font-size: 10px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.5px; }
  .mix-demonstration, .current-media-grid { gap: 5px; grid-template-columns: minmax(0,1fr) 11px minmax(0,1fr) 11px minmax(0,1fr); }
  .demo-card figcaption, .composition-card figcaption { margin-top: 9px; }
  .demo-card figcaption strong, .composition-card figcaption strong { font-size: 10px; }
  .demo-card figcaption > span, .composition-card figcaption > span { font-size: 8px; line-height: 1.7; }
  .mix-operator { font-size: 15px; margin-top: -44px; }
  .media-badge { font-size: 6px; padding: 2px 3px; top: 5px; left: 5px; letter-spacing: .3px; }
  .demo-actions { gap: 18px; margin-top: 25px; }
  .demo-actions .button { font-size: 10px; padding: 8px 10px; }
  .demo-disclaimer, .composition-note { font-size: 9px; line-height: 1.8; }
  .preview-footer { font-size: 8px; flex-wrap: wrap; gap: 5px; }
  .preview-footer > span:first-child { font-size: 7px; }
  .stage-status { font-size: 8px; gap: 4px; }
  .stage-tab { font-size: 10px; padding: 6px 10px; }
  .preview-toolbar { padding: 13px; gap: 10px; }
  .output-placeholder { gap: 7px; padding: 7px; }
  .output-placeholder .icon { width: 22px; height: 22px; flex-basis: 22px; }
  .output-placeholder strong { font-size: 9px; }
  .output-placeholder p, .output-placeholder > span { display: none; }
  .selected-description { position: relative; }
  .selected-description strong { font-size: 9px !important; }
  .selected-description p { font-size: 8px; }
  .selected-description .icon-button { position: absolute; top: -37px; right: 5px; width: 23px; height: 23px; background: rgba(16,16,20,.8); }
  .library-dialog { width: calc(100vw - 16px); max-height: 93dvh; }
  .library-dialog-header { padding: 16px; }
  .library-dialog-header h2 { font-size: 18px; }
  .library-dialog-header p { font-size: 10px; }
  .library-dialog-body { padding: 15px; }
  .library-filters { top: -15px; }
  .library-toolbar { gap: 7px; }
  .search-box { height: 38px; padding: 0 9px; }
  .search-box input { font-size: 16px; }
  .search-key { display: none; }
  .upload-motion { font-size: 0; width: 38px; min-height: 38px; padding: 8px; }
  .upload-motion .icon { width: 17px; height: 17px; }
  .categories { gap: 4px; }
  .category-button { min-height: 32px; font-size: 11px; padding: 4px 9px; }
  .library-meta { font-size: 9px; }
  .template-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px 11px; }
  .select-template { min-height: 32px; padding: 4px 8px; font-size: 11px; }
  .template-name { font-size: 12px; }
  .studio-dialog { padding: 26px 20px; width: calc(100vw - 24px); }
  .library-dialog { padding: 0; width: calc(100vw - 16px); }
  .studio-dialog h2 { font-size: 20px; }
  .template-dialog { padding: 0; grid-template-columns: 1fr; overflow: auto; }
  .dialog-template-stage { height: 43dvh; }
  .template-dialog-information { padding: 20px; }
  .template-dialog-information h2 { margin-top: 8px; }
  .template-dialog-actions { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; }
  .template-dialog-actions .button { font-size: 11px; padding: 8px 11px; }
  .sample-dialog { padding: 27px 18px; }
  .sample-comparison { gap: 10px; margin-top: 17px; }
  .sample-comparison video { height: 34dvh; }
  .sample-comparison figcaption { flex-wrap: wrap; gap: 5px; font-size: 10px; }
  .sample-note { font-size: 10px; }
  .dialog-intro { font-size: 11px; }
  .repeat-generation-dialog { padding: 25px 19px; }
  .repeat-generation-actions { grid-template-columns: 1fr; }
  .mobile-action-bar { padding-left: 16px; padding-right: 16px; }
  .mobile-action-bar span { font-size: 9px; }
}
@media (max-width:360px) {
  .header-divider { display: none; }
  .site-header { gap: 9px; }
  .creator-panel { padding: 13px; }
  .media-input { height: 170px; }
  .stage-status { display: none; }
  .stage-heading h2 { font-size: 20px; }
  .preview-footer > span:last-child { display: none; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .generate-button, #mobile-generate,
  .generate-button::before, #mobile-generate::before,
  .generate-button .icon, #mobile-generate .icon {
    animation: none !important;
    transform: none !important;
  }
}

/* Connected generation: keep the existing workbench layout. */
.plan-preview > .output-placeholder { width:100%; height:100%; min-height:260px; }
#generated-video { width:100%; height:100%; object-fit:contain; background:#111; }
#task-reference { max-width:100%; overflow-wrap:anywhere; font-size:10px; }
#task-message { max-width:240px; }
#download-result, #refresh-task { margin-top:8px; font-size:12px; }
#api-status { white-space:nowrap; }

/* Local style editing complements the existing generation workbench. */
.studio-shell { grid-template-columns: minmax(0,3fr) minmax(0,7fr); height: calc(100dvh - 64px); gap: 16px; padding: 16px 20px; }
.creator-panel, .preview-panel { height: 100%; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #41414a transparent; }
.creator-panel { padding: 20px; overflow: hidden; }
.creator-scroll { min-height: 0; overflow-y: auto; flex: 1; padding-right: 5px; scrollbar-width: thin; scrollbar-color: #41414a transparent; }
.creator-topline h1 { font-size: 20px; letter-spacing: -.5px; }
.mode-tabs { grid-template-columns: 1fr 1fr; margin: 0 0 16px; }
.mode-tab { padding: 10px 5px; font-size: 12px; }
.media-input { height: 150px; }
.quick-library { display: none; }
.quick-templates { gap: 6px; }
.input-note { line-height: 1.6; }
.creator-settings { margin-top: 8px; flex-shrink: 0; }
.creator-settings .generate-button { margin: 0; }
.meme-settings { border-top: 1px solid var(--control-line); padding-top: 16px; margin-top: 1px; }
.meme-settings .section-topline h2 { font-size: 13px; color: var(--ink); }
.style-header-actions { display: flex; align-items: center; gap: 14px; }
#jump-to-edit { display: none; }
.style-presets { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; margin: 12px 0 17px; }
.style-preset { min-width: 0; padding: 0; border: 0; background: none; text-align: center; font-size: 10px; color: var(--muted); }
.style-preset > span:last-child { display: block; margin-top: 6px; }
.style-swatch { display: grid; place-items: center; aspect-ratio: 1.3; border: 2px solid transparent; border-radius: 7px; background-size: cover; background-position: 50% 35%; overflow: hidden; }
.swatch-rainbow { background-image: linear-gradient(120deg,#f52f926e,#28f5a466,#f3ff235e),url("/assets/generator/cat-character-stage.png"); }
.swatch-acid { background-image: linear-gradient(135deg,#e1ff00aa,#37ff0777),url("/assets/generator/cat-character-stage.png"); }
.swatch-night { background-image: linear-gradient(135deg,#1322e099,#f00d8988),url("/assets/generator/cat-character-stage.png"); }
.swatch-clean { background-image: url("/assets/generator/cat-character-stage.png"); }
.style-preset:hover .style-swatch { border-color: #77737b; }
.style-preset.is-selected { color: var(--green); }
.style-preset.is-selected .style-swatch { border-color: var(--green); box-shadow: 0 0 0 2px #2ee59d18; }
.caption-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 11px; }
.caption-label > span { font-size: 9px; color: var(--muted); }
.meme-caption-input, #meme-scene { width: 100%; padding: 10px 11px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 6px; font-size: 12px; }
.caption-suggestions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.caption-suggestions button { padding: 3px 6px; border: 1px solid var(--control-line); border-radius: 4px; background: none; color: var(--muted); font-size: 9px; }
.caption-suggestions button:hover { color: var(--ink); border-color: var(--muted); }
.remix-details { margin-top: 9px; font-size: 11px; }
.remix-details summary, .generation-details > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; list-style: none; cursor: pointer; color: var(--muted); }
.remix-details summary::-webkit-details-marker, .generation-details > summary::-webkit-details-marker { display: none; }
.remix-details[open] summary { margin-bottom: 9px; }
.remix-details[open] summary > span, .generation-details[open] > summary > span { transform: rotate(45deg); }
.remix-details .field-label { font-size: 11px; display: flex; justify-content: space-between; }
.remix-details output { font-size: 10px; color: var(--muted); }
.advanced-edit { margin-top: 8px; border-top: 1px solid var(--control-line); }
.advanced-edit > summary { font-size: 12px; min-height: 32px; }
.advanced-edit .caption-suggestions { margin: 0 0 16px; }
.scene-setting { border-top: 1px solid var(--control-line); padding-top: 14px; margin-top: 12px; }
.save-edit-settings { margin: 14px 0 8px; font-size: 11px; }
input[type=range] { accent-color: var(--green); cursor: pointer; }
#meme-intensity { width: 100%; height: 14px; margin: 3px 0 10px; }
.remix-option-row, .remix-check { display: flex; justify-content: space-between; align-items: center; min-height: 33px; gap: 10px; color: var(--soft); }
.position-picker { display: flex; padding: 2px; background: var(--paper); border-radius: 5px; }
.position-picker button { padding: 3px 8px; border: 0; background: transparent; color: var(--muted); border-radius: 4px; font-size: 9px; }
.position-picker .is-selected { background: var(--surface-raised); color: var(--ink); }
.remix-check input { accent-color: var(--green); width: 15px; height: 15px; }
.scene-setting p { color: var(--muted); font-size: 10px; margin-top: 6px; }
.clip-panel { margin-bottom: 18px; }
.clip-upload { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 9px; width: 100%; min-height: 170px; padding: 20px; border: 1px dashed var(--line); border-radius: 8px; background: var(--paper); }
.clip-upload .icon { width: 25px; height: 25px; color: var(--green); }
.clip-upload strong { font-size: 13px; font-weight: 500; }
.clip-upload > span, .clip-file-name { color: var(--muted); font-size: 10px; }
.clip-upload:hover, .clip-upload.is-dragover { border-color: var(--green); background: var(--accent-wash); }
.clip-file-name { margin-top: 8px; overflow-wrap: anywhere; }
body.is-clip .creator-inputs, body.is-clip .quick-library, body.is-clip .prompt-panel, body.is-clip .creator-settings, body.is-clip .plan-settings, body.is-clip .scene-setting, body.is-clip .mobile-action-bar { display: none !important; }
body.is-clip .meme-settings { margin-top: 0; }
.preview-toolbar { padding: 20px 24px 16px; }
.preview-toolbar h2 { font: 600 14px var(--body-font); margin: 0; }
.stage-tabs { padding: 0; background: transparent; }
.stage-tab { font-size: 10px; }
.stage-tab.is-active { background: var(--surface-raised); }
.meme-workspace { display: flex; align-items: center; flex-direction: column; padding: 8px 24px 24px; flex: 1; }
.meme-workspace-heading { text-align: center; margin-bottom: 13px; }
.meme-workspace-heading .eyebrow { font-size: 8px; letter-spacing: 2px; }
.meme-workspace-heading h2 { font-family: var(--body-font); font-size: clamp(24px,2.8vw,38px); letter-spacing: -1.3px; font-weight: 750; margin: 4px 0 6px; line-height: 1.25; }
.meme-workspace-heading p { font-size: 11px; color: var(--muted); }
.meme-player-shell { width: min(100%,320px); border-radius: 10px; border: 1px solid #f7f1e32b; overflow: hidden; background: #08080b; box-shadow: 0 18px 45px #0004; }
.meme-player-topline { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; font-size: 8px; letter-spacing: .7px; color: var(--muted); border-bottom: 1px solid #ffffff14; }
.preview-live-dot { color: var(--green); white-space: nowrap; }
.preview-live-dot::before { content: ''; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: middle; }
.meme-canvas-wrap { position: relative; height: clamp(260px,47dvh,480px); display: flex; justify-content: center; background: #08080b; overflow: hidden; }
#meme-canvas { display: block; height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.canvas-play { position: absolute; left: calc(50% - 23px); top: calc(50% - 23px); width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid #ffffff80; border-radius: 50%; background: #0b0b0f99; backdrop-filter: blur(6px); color: white; }
.canvas-play .icon { width: 21px; height: 21px; margin-left: 3px; }
.canvas-play:hover { background: #ffffff40; }
.before-label { position: absolute; top: 12px; left: 12px; padding: 3px 7px; border-radius: 4px; background: #0009; color: white; font-size: 9px; }
.meme-playback { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-top: 1px solid #ffffff14; }
.meme-playback .icon-button { width: 25px; height: 25px; flex-basis: 25px; border: 0; }
#meme-seek { width: 100%; min-width: 30px; height: 12px; }
#meme-time { color: var(--muted); font-size: 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.before-button { background: transparent; border: 1px solid #ffffff25; padding: 4px 7px; border-radius: 4px; color: var(--muted); font-size: 9px; }
.before-button[aria-pressed=true] { border-color: var(--green); color: var(--green); }
.edit-summary { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; max-width: 100%; font-size: 10px; color: var(--soft); }
.edit-summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.edit-summary span + span::before { content: '·'; color: #747078; padding-right: 8px; }
.meme-preview-note { max-width: 450px; margin-top: 8px; color: var(--muted); font-size: 10px; text-align: center; line-height: 1.6; }
.meme-export-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.meme-export-row .button { min-height: 44px; min-width: 230px; font-size: 13px; }
.download-icon { transform: rotate(180deg); }
.meme-export-row #download-result { margin: 0; font-size: 11px; }
body.is-clip #download-result { display: none; }
.meme-export-row .text-button { font-size: 10px; }
.export-progress { font-size: 11px; color: var(--green); margin-top: 10px; max-width: 450px; text-align: center; }
.export-file-link { font-size: 11px; color: var(--green); margin-top: 8px; text-decoration: underline; text-underline-offset: 4px; }
#meme-exported-preview { max-height: 180px; max-width: 300px; margin-top: 12px; border-radius: 6px; background: #09090d; }
.generation-details { border-top: 1px solid var(--control-line); margin: 0 20px; }
.generation-details > summary { font-size: 10px; min-height: 40px; }
.generation-details > .stage-tabs { display: flex; margin: 8px 0 0; width: fit-content; }
.generation-details .stage-content { margin: 0; padding: 20px 10px 30px; }
.generation-details .stage-heading h2 { font-size: 22px; }
.generation-details .stage-heading { margin-bottom: 20px; }
.generation-details .demo-media, .generation-details .plan-preview { max-height: 330px; }
.review-remix-summary { margin: 15px 0 0; font-size: 11px; line-height: 1.7; color: var(--soft); }
body.is-clip .generation-details, body.is-clip .preview-toolbar .stage-tabs { display: none; }
.preview-footer { flex-shrink: 0; }
body.is-recording .meme-settings, body.is-recording .mode-tabs, body.is-recording .creator-inputs, body.is-recording .quick-library, body.is-recording .clip-panel { pointer-events: none; opacity: .55; }
body.is-recording .canvas-play { display: none; }
@media (min-width:1700px) { .media-input { height: 165px; } }
@media (min-width:901px) {
  .creator-settings { padding-top: 12px; border-top: 1px solid var(--control-line); }
}
@media (min-width:901px) and (max-width:1450px) {
  .mode-tab { padding-inline: 3px; font-size: 11px; }
}
@media (max-width:1180px) { .studio-shell { padding: 14px; } .creator-panel { padding: 17px; } .meme-workspace { padding-inline: 20px; } }
@media (min-width:901px) and (max-height:820px) {
  .mode-tabs { margin: 0 0 12px; }
  .media-input { height: 110px; }
  .input-caption { bottom: 45px; left: 8px; right: 8px; }
  .input-caption strong { font-size: 10px; }
  .input-caption p { display: none; }
  .tile-action { left: 8px; right: 8px; bottom: 8px; min-height: 28px; }
  .input-upload { margin-top: 5px; }
  .meme-settings { padding-top: 11px; }
  .style-presets { margin-top: 9px; margin-bottom: 9px; }
  .style-swatch { aspect-ratio: 2.3; }
  .meme-canvas-wrap { height: clamp(260px,45dvh,365px); }
  .meme-workspace-heading h2 { font-size: 29px; }
  .meme-workspace-heading { margin-bottom: 10px; }
}
@media (max-width:900px) {
  .studio-shell { display: flex; flex-direction: column; height: auto; padding: 14px; }
  .creator-panel, .preview-panel { height: auto; overflow: visible; }
  .creator-panel { min-height: 0; padding: 20px; }
  .creator-scroll { overflow: visible; padding-right: 0; flex: initial; }
  #jump-to-edit { display: inline-block; color: var(--green); }
  .creator-inputs { gap: 14px; }
  .media-input { height: 170px; }
  .style-presets { max-width: 450px; }
  .style-swatch { aspect-ratio: 1.8; }
  .caption-suggestions button { font-size: 11px; padding: 4px 8px; }
  .meme-settings { margin-top: 0; }
  .plan-settings { display: block; }
  .extra-settings { padding-top: 0; margin-top: 6px; }
  .meme-workspace { padding: 18px 20px 28px; }
  .meme-workspace-heading h2 { font-size: 29px; }
  .meme-canvas-wrap { height: 420px; }
  .meme-settings .remix-check { min-height: 37px; }
  .position-picker button { padding: 5px 10px; }
  .stage-status { display: flex; }
  .mobile-action-bar { z-index: 20; }
}
@media (max-width:540px) {
  .studio-shell { padding: 10px; gap: 12px; }
  .creator-panel { padding: 16px; }
  .creator-topline h1 { font-size: 19px; }
  .mode-tab { min-height: 36px; font-size: 12px; }
  .media-input { height: 165px; }
  .meme-caption-input, #meme-scene { font-size: 16px; }
  .caption-label { font-size: 12px; }
  .style-preset { font-size: 11px; }
  .meme-workspace { padding: 19px 14px 23px; }
  .meme-workspace-heading h2 { font-size: 25px; letter-spacing: -.8px; }
  .meme-workspace-heading p { font-size: 10px; max-width: 270px; margin: auto; }
  .meme-player-topline { font-size: 7px; padding: 9px; }
  .meme-canvas-wrap { height: 390px; }
  .meme-playback { gap: 7px; padding: 9px; }
  .meme-export-row { gap: 13px; }
  .generation-details { margin: 0 14px; }
  .edit-summary { font-size: 9px; gap: 5px; }
  .edit-summary span { max-width: 135px; }
  .meme-preview-note { font-size: 9px; }
}

/* Generation, library, and post-production are separate steps. */
.studio-nav { display: flex; align-items: center; gap: 22px; font-size: 12px; color: var(--muted); }
.studio-nav a[aria-current=page] { color: var(--ink); }
.studio-nav a:hover { color: var(--green); }
.generation-page .mode-tabs { grid-template-columns: 1fr 1fr; }
.generation-settings { border-top: 1px solid var(--control-line); margin-top: 18px; padding-top: 2px; }
.generation-settings .scene-setting { border: 0; margin: 0 0 16px; padding: 0; }
.generation-settings .plan-settings { display: block; }
.generation-settings .extra-settings > summary { min-height: 36px; }
.generation-page .preview-panel { overflow: hidden; }
.generation-workspace { display: flex; align-items: center; justify-content: center; flex-direction: column; flex: 1; min-height: 0; padding: 8px 24px 24px; }
.generation-player { position: relative; width: min(100%,420px); overflow: hidden; border: 1px solid #f7f1e32b; border-radius: 10px; background: #08080b; }
.generation-player.is-generating { border-color: rgba(46,229,157,.42); box-shadow: 0 0 0 1px rgba(46,229,157,.08), 0 18px 45px #0004; }
.generation-player.is-generating::after { content: 'CREATING'; position: absolute; top: 44px; right: 12px; padding: 5px 8px; border: 1px solid rgba(46,229,157,.35); border-radius: 999px; color: var(--green); background: rgba(8,8,11,.86); font-size: 8px; font-weight: 700; letter-spacing: 1.2px; pointer-events: none; }
.generation-preview-media { height: clamp(260px,45dvh,440px); display: flex; justify-content: center; }
.generation-preview-media video, .generation-preview-media img { width: 100%; height: 100%; object-fit: contain; }
.generation-workspace .meme-preview-note { margin-top: 18px; font-size: 11px; }
.generation-task { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; width: min(100%,420px); margin-top: 14px; padding: 12px 14px; border: 1px solid rgba(46,229,157,.24); border-radius: 9px; background: rgba(46,229,157,.055); }
.generation-task[hidden] { display: none; }
.generation-task-indicator { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(46,229,157,.45); animation: generation-pulse 1.7s ease-out infinite; }
.generation-task-copy { min-width: 0; }
.generation-task-copy strong { display: block; font-size: 11px; font-weight: 700; color: var(--ink); }
.generation-task-copy p { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.generation-task-eta { display: block; margin-top: 5px; color: var(--green); font-size: 8px; line-height: 1.4; }
.generation-task-eta[hidden] { display: none; }
.generation-task-progress, .history-progress { height: 4px; overflow: hidden; border-radius: 999px; background: rgba(247,241,227,.1); }
.generation-task-progress { margin-top: 8px; }
.generation-task-progress span, .history-progress span { display: block; width: 12%; height: 100%; border-radius: inherit; background: var(--green); transition: width .7s ease; }
.generation-task[data-status="preparing"] .generation-task-progress span,
.history-progress[data-status="preparing"] span { width: 22%; }
.generation-task[data-status="submitting"] .generation-task-progress span,
.history-progress[data-status="submitting"] span { width: 32%; }
.generation-task[data-status="queued"] .generation-task-progress span,
.history-progress[data-status="queued"] span { width: 40%; }
.generation-task[data-status="processing"] .generation-task-progress span,
.history-progress[data-status="processing"] span { width: 72%; animation: estimated-progress 2.2s ease-in-out infinite alternate; }
.generation-task[data-status="storing"] .generation-task-progress span,
.history-progress[data-status="storing"] span { width: 92%; }
.generation-task[data-status="succeeded"] .generation-task-progress span { width: 100%; }
.generation-task[data-status="failed"] .generation-task-progress span,
.generation-task[data-status="cancelled"] .generation-task-progress span { width: 100%; background: var(--error); }
.generation-task[data-status="submission_unknown"] .generation-task-progress span,
.history-progress[data-status="submission_unknown"] span { width: 100%; background: var(--yellow); }
.generation-task > .text-button { font-size: 9px; }
.generation-task[data-status="succeeded"] .generation-task-indicator,
.generation-task[data-status="failed"] .generation-task-indicator,
.generation-task[data-status="cancelled"] .generation-task-indicator,
.generation-task[data-status="submission_unknown"] .generation-task-indicator { animation: none; box-shadow: none; }
.generation-task[data-status="failed"] .generation-task-indicator,
.generation-task[data-status="cancelled"] .generation-task-indicator { background: var(--error); }
@keyframes generation-pulse { 70%,100% { box-shadow: 0 0 0 8px rgba(46,229,157,0); } }
@keyframes estimated-progress { from { width: 62%; } to { width: 78%; } }
.result-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.result-actions .button { min-height: 42px; }
.free-badge { display: inline-flex; align-items: center; min-height: 16px; padding: 2px 5px; border-radius: 999px; background: var(--green); color: #10271e; font-size: 8px; font-weight: 800; line-height: 1; letter-spacing: .55px; }
.button-primary .free-badge { background: #10271e; color: var(--green); }
.after-generation-note { font-size: 10px; line-height: 1.7; text-align: center; color: var(--muted); margin-top: 18px; max-width: 370px; }
.after-generation-note a { color: var(--soft); white-space: nowrap; }
.editor-intro { font-size: 11px; color: var(--muted); margin: 5px 0 19px; }
.style-editor-page .clip-panel { margin-bottom: 7px; }
.style-editor-page .clip-upload { min-height: 115px; padding: 16px 10px; gap: 7px; }
.style-editor-page .clip-upload > span { font-size: 9px; }
.style-editor-page .clip-file-name { line-height: 1.6; }
.editor-source-actions { display: flex; justify-content: space-between; gap: 10px; margin: 10px 0 18px; }
.editor-source-actions .text-button { font-size: 10px; }
.editor-source-actions .button { min-height: 34px; padding: 7px 10px; font-size: 10px; }
.video-picker-dialog { width: min(92vw,860px); padding: 0; }
.video-picker-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 24px 18px; border-bottom: 1px solid var(--control-line); }
.video-picker-header h2 { margin-top: 7px; }
.video-picker-header p { margin-top: 6px; color: var(--muted); font-size: 11px; }
.video-picker-status { margin: 24px; color: var(--muted); font-size: 12px; }
.video-picker-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; max-height: min(620px,65dvh); overflow-y: auto; padding: 20px 24px 24px; }
.video-picker-grid:empty { display: none; }
.video-picker-card { min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--control-line); border-radius: 9px; color: var(--ink); background: var(--paper); text-align: left; }
.video-picker-card:hover { border-color: rgba(46,229,157,.48); background: var(--surface-hover); }
.video-picker-preview { display: block; height: 190px; background: #08080b; }
.video-picker-preview video { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.video-picker-copy { display: block; padding: 12px; }
.video-picker-copy strong, .video-picker-copy > span { display: block; }
.video-picker-copy strong { font-size: 11px; }
.video-picker-copy > span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.editor-local-note { font-size: 10px; line-height: 1.6; color: var(--muted); border-top: 1px solid var(--control-line); padding-top: 12px; margin-top: 12px; }
.style-editor-page .preview-footer { display: none; }
.editor-empty { display: flex; justify-content: center; align-items: center; flex-direction: column; gap: 12px; text-align: center; padding: 24px; color: var(--muted); }
.editor-empty .icon { width: 30px; height: 30px; }
.editor-empty strong { font-size: 14px; font-weight: 500; color: var(--soft); }
.editor-empty span { max-width: 200px; font-size: 11px; line-height: 1.7; }
body.is-recording .editor-source-actions { pointer-events: none; opacity: .55; }
.video-library { width: min(1160px,100%); margin: 0 auto; padding: 50px 30px; }
.library-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 38px; }
.library-page-heading .eyebrow, .library-style-entry .eyebrow { font-size: 9px; letter-spacing: 1.8px; color: var(--green); }
.library-page-heading h1 { font-size: 36px; letter-spacing: -1px; margin: 7px 0 10px; }
.library-page-heading p { font-size: 13px; color: var(--muted); }
.library-page-toolbar { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--control-line); padding-bottom: 16px; color: var(--muted); font-size: 12px; }
.history-status { font-size: 13px; color: var(--soft); border: 1px solid var(--control-line); background: var(--surface); padding: 24px; margin: 24px 0; border-radius: 10px; }
.history-empty { display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 290px; gap: 15px; text-align: center; }
.history-empty > .icon { width: 32px; height: 32px; color: var(--muted); }
.history-empty h2 { font-size: 22px; font-weight: 600; letter-spacing: -.5px; }
.history-empty p { font-size: 12px; line-height: 1.7; color: var(--muted); max-width: 310px; }
.history-empty .button { margin-top: 6px; }
.video-history-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 22px; margin-top: 24px; }
.video-history-grid:empty { display: none; }
.history-video-card { border: 1px solid var(--control-line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.history-video-preview { position: relative; height: 260px; display: grid; place-items: center; overflow: hidden; background: #08080b; color: var(--muted); font-size: 13px; }
.history-video-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.history-video-playback-error { position: relative; z-index: 1; width: min(260px, calc(100% - 36px)); padding: 12px 14px; border: 1px solid var(--control-line); border-radius: 8px; background: rgba(16,16,20,.92); color: var(--soft); font-size: 11px; line-height: 1.5; text-align: center; }
.history-video-info { padding: 18px; }
.history-video-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.history-video-name { min-width: 0; flex: 1; }
.history-video-name h2 { overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.history-video-name-button { display: inline-flex; align-items: center; max-width: 100%; gap: 7px; padding: 0; border: 0; background: transparent; color: var(--ink); font: 600 14px/1.35 var(--body-font); text-align: left; cursor: text; }
.history-video-name-button > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-name-pencil { flex: 0 0 auto; color: var(--muted); font-size: 12px; opacity: .65; transition: opacity .16s ease, color .16s ease; }
.history-video-name-button:hover .history-name-pencil, .history-video-name-button:focus-visible .history-name-pencil { color: var(--green); opacity: 1; }
.history-name-form { display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 6px; }
.history-name-form input { min-width: 0; height: 31px; padding: 6px 8px; border: 1px solid var(--green); border-radius: 5px; background: var(--paper); color: var(--ink); font: 600 12px/1 var(--body-font); }
.history-name-form button { height: 31px; padding: 0 8px; border: 1px solid var(--green); border-radius: 5px; background: var(--green); color: #10271e; font: 700 9px/1 var(--body-font); cursor: pointer; }
.history-name-form .history-name-cancel { border-color: var(--control-line); background: transparent; color: var(--muted); }
.history-name-error { grid-column: 1/-1; color: var(--error); font-size: 9px; }
.history-task-status { font-size: 10px; color: var(--muted); }
.history-task-status.is-ready { color: var(--green); }
.history-video-facts { font-size: 10px; color: var(--muted); margin-top: 7px; }
.history-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.history-card-actions .button { font-size: 11px; min-height: 35px; padding: 8px 10px; }
.history-card-actions .text-button { font-size: 10px; }
.history-retry-button { font-size: 10px !important; }
.history-progress { margin-top: 18px; }
.history-retry { display: inline-flex; margin-top: 13px; font-size: 10px; }
.history-task-note { margin-top: 18px; font-size: 11px; color: var(--muted); line-height: 1.7; }
.library-style-entry { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 44px; padding: 28px; border: 1px solid var(--control-line); border-radius: 12px; background: var(--surface); }
.library-style-entry h2 { font-size: 25px; margin: 6px 0 9px; letter-spacing: -.6px; }
.library-style-entry p { font-size: 12px; color: var(--muted); line-height: 1.7; max-width: 430px; }
.library-style-actions { display: flex; align-items: center; flex-direction: column; gap: 16px; flex-shrink: 0; }
@media (max-width:1000px) {
  .video-history-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:900px) {
  .generation-page .preview-panel { overflow: visible; }
  .generation-settings .plan-settings { display: block; }
  .generation-preview-media { height: 430px; }
  .generation-workspace { padding: 15px 20px 26px; }
  .style-editor-page .clip-upload { min-height: 145px; }
  .video-picker-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:540px) {
  .studio-nav { gap: 18px; font-size: 11px; }
  .generation-page .header-actions { gap: 16px; }
  .generation-page #api-status { display: none; }
  .generation-preview-media { height: 390px; }
  .generation-workspace { padding-inline: 14px; }
  .generation-workspace .meme-preview-note { font-size: 10px; }
  .result-actions .button { font-size: 11px; }
  .video-library { padding: 30px 20px; }
  .library-page-heading { align-items: flex-start; flex-direction: column; gap: 20px; margin-bottom: 30px; }
  .library-page-heading h1 { font-size: 31px; }
  .video-history-grid { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .history-video-preview { height: 310px; }
  .library-style-entry { align-items: flex-start; flex-direction: column; padding: 23px; margin-top: 30px; }
  .library-style-actions { align-items: flex-start; }
  .editor-local-note { margin-top: 18px; }
  .video-picker-dialog { width: calc(100vw - 22px); }
  .video-picker-header { padding: 18px; }
  .video-picker-grid { grid-template-columns: minmax(0,1fr); padding: 14px 18px 18px; }
  .video-picker-preview { height: 240px; }
}

/* One navigation system for the guide, creator, and video library. */
.global-header { position: sticky; top: 0; z-index: 50; width: 100%; border-bottom: 1px solid #f7f1e313; background: #0b0b0fe8; backdrop-filter: blur(18px); }
.global-header-inner { position: relative; display: flex; align-items: center; gap: 22px; width: min(1120px,calc(100% - 40px)); height: 71px; margin: 0 auto; }
.global-brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; margin-right: auto; color: var(--ink); text-decoration: none; font: 800 19px/1 var(--body-font); letter-spacing: -.3px; }
.global-brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #f7f1e333; border-radius: 9px; background: linear-gradient(135deg,var(--red),var(--yellow) 42%,var(--green)); color: #09090d; font: 800 17px/1 var(--body-font); }
.global-nav-panel, .global-primary-nav { display: flex; align-items: center; gap: 6px; width: auto; overflow: visible; }
.global-header .global-nav-link, .global-learn > summary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); text-decoration: none; white-space: nowrap; font: 500 13px/1.3 var(--body-font); cursor: pointer; }
.global-header .global-nav-link:hover, .global-learn > summary:hover { color: var(--ink); background: #f7f1e30a; }
.global-header .global-nav-link[aria-current], .global-header .global-nav-link[data-active=true], .global-learn > summary[data-active=true] { color: var(--ink); background: #f7f1e30d; }
.global-nav-icon { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.global-header .global-my-videos { margin-left: 15px; }
.global-nav-panel::after { content: ''; width: 1px; height: 20px; background: #f7f1e31c; margin-left: 9px; }
.global-header .global-learn { position: relative; border: 0; }
.global-learn > summary { list-style: none; }
.global-learn > summary::-webkit-details-marker { display: none; }
.global-learn > summary .global-nav-icon { width: 13px; height: 13px; flex-basis: 13px; }
.global-learn[open] > summary .global-nav-icon { transform: rotate(180deg); }
.global-learn[open] > summary { color: var(--ink); background: #f7f1e30d; }
.global-learn-links { position: absolute; top: calc(100% + 12px); right: 0; width: 278px; padding: 7px; border: 1px solid #f7f1e324; border-radius: 12px; background: #18181f; box-shadow: 0 18px 50px #0007; }
.global-header .global-learn-links a { display: flex; flex-direction: column; justify-content: center; min-height: 62px; gap: 4px; padding: 11px 13px; border-radius: 7px; color: var(--ink); text-decoration: none; }
.global-learn-links a:hover, .global-learn-links a[aria-current] { background: #f7f1e309; }
.global-learn-links strong { font: 600 13px/1.3 var(--body-font); }
.global-learn-links span { color: var(--muted); font: 400 11px/1.4 var(--body-font); }
.global-create { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; flex-shrink: 0; padding: 9px 14px; border: 1px solid var(--ink); border-radius: 7px; background: var(--ink); color: #101014; text-decoration: none; font: 700 12px/1.3 var(--body-font); white-space: nowrap; }
.global-create:hover { background: var(--soft); border-color: var(--soft); }
.global-create[aria-current=page] { background: #f7f1e30a; border-color: #f7f1e340; color: var(--ink); }
.global-menu-toggle { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 1px solid #f7f1e326; border-radius: 7px; background: transparent; color: var(--ink); cursor: pointer; }
.global-menu-toggle .global-nav-icon { width: 19px; height: 19px; }
.global-menu-close-icon { display: none; }
.global-header[data-menu-open=true] .global-menu-open-icon { display: none; }
.global-header[data-menu-open=true] .global-menu-close-icon { display: block; }
.global-header :is(a,button,summary):focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
body:is(.generation-page,.style-editor-page) .global-header-inner { width: 100%; max-width: 1880px; padding: 0 26px; }
.generator-copy .generator-style-link { font-size: 13px; color: var(--muted); margin: 16px 0 0; line-height: 1.7; }
.generator-style-link a { color: var(--ink); text-decoration: none; border-bottom: 1px solid #f7f1e340; padding-bottom: 2px; white-space: nowrap; }
main :is(section[id],#meaning) { scroll-margin-top: 96px; }
@media (min-width:901px) {
  body:is(.generation-page,.style-editor-page) .studio-shell { height: calc(100dvh - 72px); }
}
@media (max-width:760px) {
  .global-header-inner, body:is(.generation-page,.style-editor-page) .global-header-inner { width: 100%; height: 63px; padding: 0 16px; gap: 12px; }
  .global-brand { font-size: 18px; gap: 8px; }
  .global-brand-mark { width: 32px; height: 32px; border-radius: 8px; }
  .global-create { min-height: 36px; padding: 8px 11px; font-size: 11px; }
  .global-create .global-nav-icon { width: 14px; height: 14px; flex-basis: 14px; }
  .global-menu-toggle { display: inline-flex; }
  .global-nav-panel { position: absolute; top: calc(100% + 8px); left: 12px; right: 12px; display: flex; align-items: stretch; flex-direction: column; gap: 0; padding: 9px; border: 1px solid #f7f1e324; border-radius: 12px; background: #18181f; box-shadow: 0 18px 50px #0008; max-height: calc(100dvh - 90px); overflow-y: auto; }
  .global-header.is-enhanced:not([data-menu-open=true]) .global-nav-panel { display: none; }
  .global-primary-nav { display: block; width: 100%; overflow: visible; }
  .global-header .global-nav-link, .global-learn > summary { display: flex; justify-content: flex-start; width: 100%; min-height: 44px; font-size: 13px; }
  .global-learn > summary { justify-content: space-between; }
  .global-learn-links { position: static; width: 100%; padding: 2px 0 7px 12px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .global-header .global-learn-links a { min-height: 58px; }
  .global-header .global-my-videos { margin: 7px 0 0; padding-top: 14px; border-top: 1px solid #f7f1e317; border-radius: 0 0 7px 7px; min-height: 49px; }
  .global-nav-panel::after { display: none; }
}
@media (max-width:360px) {
  .global-header-inner, body:is(.generation-page,.style-editor-page) .global-header-inner { padding-inline: 12px; gap: 9px; }
  .global-brand { font-size: 17px; }
  .global-create { padding-inline: 9px; gap: 5px; }
}
