/* GenSyx public flow screens (index.html). Shared tokens, header and wallet live in site.css. */
/* Import crop dialog shares the public site's surfaces and accent. */
.crop-fullscreen-open, .crop-fullscreen-open body { overflow: hidden; }
.crop-dialog { width: min(1040px, calc(100vw - 32px)); height: min(860px, calc(100dvh - 32px)); max-width: none; max-height: none; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); color: var(--text); box-shadow: var(--shadow); overflow: hidden; }
.crop-dialog[open] { display: flex; flex-direction: column; }
.crop-dialog::backdrop { background: #030518cc; backdrop-filter: blur(10px); }
.crop-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.crop-dialog-heading h2 { margin: 0; font-size: 20px; }
.crop-dialog-heading button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 26px; }
.crop-dialog #workspace-stage { position: relative; display: block; flex: 1; min-height: 0; width: 100%; overflow: hidden; background: #060819; touch-action: none; user-select: none; }
.crop-dialog #workspace-stage figure, .crop-dialog #workspace-stage .image-frame { width: 100%; height: 100%; margin: 0; }
.crop-dialog #workspace-stage img { display: block; width: 100%; height: 100%; object-fit: contain; }
.crop-dialog #workspace-stage figcaption { display: none; }
.crop-overlay { position: absolute; overflow: hidden; touch-action: none; cursor: crosshair; }
.crop-rectangle { position: absolute; border: 2px solid white; box-shadow: 0 0 0 2000px #03051899; cursor: move; }
.crop-rectangle::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to right, transparent 33.1%, #ffffff45 33.1%, #ffffff45 33.4%, transparent 33.4%, transparent 66.4%, #ffffff45 66.4%, #ffffff45 66.7%, transparent 66.7%), linear-gradient(to bottom, transparent 33.1%, #ffffff45 33.1%, #ffffff45 33.4%, transparent 33.4%, transparent 66.4%, #ffffff45 66.4%, #ffffff45 66.7%, transparent 66.7%); }
.crop-rectangle [data-corner] { position: absolute; width: 28px; height: 28px; border: 4px solid var(--accent); }
.crop-rectangle [data-corner="nw"] { top: -2px; left: -2px; border-right: 0; border-bottom: 0; cursor: nwse-resize; }
.crop-rectangle [data-corner="ne"] { top: -2px; right: -2px; border-left: 0; border-bottom: 0; cursor: nesw-resize; }
.crop-rectangle [data-corner="sw"] { bottom: -2px; left: -2px; border-right: 0; border-top: 0; cursor: nesw-resize; }
.crop-rectangle [data-corner="se"] { bottom: -2px; right: -2px; border-left: 0; border-top: 0; cursor: nwse-resize; }
.crop-dialog-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: 18px 20px; }
.crop-dialog-error { flex-basis: 100%; margin: 0; color: var(--danger); font-size: 13px; }
.crop-dialog #crop-tools { flex: 1; color: var(--muted); font-size: 13px; }
.crop-dialog #crop-size { display: block; margin-top: 4px; color: var(--dim); font-size: 12px; }
.crop-dialog #crop-apply { min-height: 46px; padding: 10px 30px; border: 0; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-text); font-weight: 750; }
.crop-dialog button:disabled { opacity: .5; cursor: wait; }
@media (max-width: 600px) {
  .crop-dialog { width: 100vw; height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .crop-dialog-heading { padding: max(12px, env(safe-area-inset-top)) 16px 12px; }
  .crop-dialog-footer { flex-wrap: wrap; gap: 12px; padding: 14px 16px max(16px, env(safe-area-inset-bottom)); }
  .crop-dialog #crop-tools { flex-basis: 100%; }
  .crop-dialog-confirm, .crop-dialog #crop-apply { width: 100%; }
}
/* ---------------------------------------------------------------- shared */
#fx-app { width: min(1180px, 100%); margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left)); }
.fx-screen { animation: fx-enter .3s ease-out; }

/* media: sweep (auto before/after), video, comparison */
.fx-media { position: relative; overflow: hidden; background: radial-gradient(circle at 50% 40%, #3a2163, #141235 70%); }
.fx-media > img, .fx-media > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fx-media > .fx-compare { position: absolute; inset: 0; }
.fx-media-placeholder { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; color: var(--accent); }
@property --sweep { syntax: "<percentage>"; inherits: true; initial-value: 100%; }
.fx-sweep { --sweep: 100%; }
.fx-sweep .fx-sweep-before { clip-path: inset(0 calc(100% - var(--sweep)) 0 0); }
.fx-sweep-line { position: absolute; top: 0; bottom: 0; left: var(--sweep); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 14px 2px #f15bdacc; opacity: .9; z-index: 2; }
.fx-sweep.is-playing { animation: fx-sweep 5.4s ease-in-out infinite; animation-delay: var(--delay, 0s); }
.fx-sweep.fx-sweep-once.is-playing { animation: fx-sweep-once 4.6s ease-in-out .3s both; }
@keyframes fx-sweep { 0%, 12% { --sweep: 100%; } 45%, 62% { --sweep: 0%; } 95%, 100% { --sweep: 100%; } }
@keyframes fx-sweep-once { 0% { --sweep: 100%; } 55%, 100% { --sweep: 0%; } }
.fx-compare { --split: 50%; position: relative; overflow: hidden; width: 100%; height: 100%; touch-action: pan-y; user-select: none; }
.fx-compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.fx-compare-before { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.fx-compare-line { position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 16px 3px #f15bdaaa; pointer-events: none; z-index: 2; }
.fx-compare-range { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.fx-compare:has(.fx-compare-range:focus-visible) .fx-compare-handle { outline: 2px solid var(--accent); outline-offset: 3px; }
.fx-compare-handle { position: absolute; top: 50%; left: clamp(26px, var(--split), calc(100% - 26px)); z-index: 3; display: grid; place-items: center; width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 2px solid #fff; border-radius: 50%; background: #10112ecc; box-shadow: 0 4px 18px #02021a99, 0 0 18px #f15bda77; cursor: ew-resize; touch-action: none; backdrop-filter: blur(4px); }
.fx-compare-handle::before { content: "‹ ›"; color: #fff; font-size: 16px; font-weight: 800; letter-spacing: 2px; }
.fx-compare.is-dragging .fx-compare-handle { transform: scale(1.12); background: var(--accent); }
.fx-compare.at-edge:not(.touched) .fx-compare-handle { animation: fx-handle-hint 2.4s ease-in-out 1.4s 2; }
@keyframes fx-handle-hint { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(10px); } 60% { transform: translateX(-4px); } }
.fx-compare-tag { position: absolute; top: 10px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: #080a20b3; font-size: 12px; font-weight: 700; pointer-events: none; transition: opacity .2s; }
.fx-compare-tag-before { left: 10px; }
.fx-compare-tag-after { right: 10px; }
.fx-compare-hint { position: absolute; left: 50%; bottom: 12px; z-index: 2; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: #080a20cc; font-size: 12px; font-weight: 700; pointer-events: none; white-space: nowrap; transition: opacity .3s; }
.fx-compare.touched .fx-compare-hint { opacity: 0; }
.fx-compare-line { transition: opacity .25s; }
.fx-compare.at-edge .fx-compare-line { opacity: 0; }

/* ---------------------------------------------------------------- home */
.fx-hero { display: grid; gap: 14px; padding: 18px 0 4px; }
.fx-hero h1 { margin: 0; font-size: clamp(30px, 8.4vw, 54px); line-height: 1.02; font-weight: 850; letter-spacing: -.045em; }
.fx-hero h1 { background: linear-gradient(100deg, #fff 20%, #ffb3f3 55%, #9d8bff 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fx-hero p { margin: 8px 0 0; color: var(--muted); font-size: 16px; }
.fx-spotlight { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; padding: 0; overflow: hidden; border: 1px solid #f15bda44; border-radius: 22px; background: #120f33; box-shadow: var(--shadow), inset 0 0 60px #8b5cff22; text-align: left; }
.fx-spotlight-stage { position: absolute; inset: 0; }
.fx-spotlight-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease; }
.fx-spotlight-slide.is-active { opacity: 1; }
.fx-spotlight-slide > img, .fx-spotlight-slide > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fx-spotlight::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #080a20f0 0, #080a2066 30%, transparent 55%); pointer-events: none; }
.fx-spotlight-caption { position: absolute; left: 16px; right: 64px; bottom: 14px; z-index: 2; display: grid; gap: 2px; }
.fx-spotlight-caption small { color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.fx-spotlight-caption strong { font-size: 22px; font-weight: 850; letter-spacing: -.02em; }
.fx-spotlight-go { position: absolute; right: 14px; bottom: 14px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 20px; font-weight: 900; box-shadow: 0 6px 20px #f15bda66; }
.fx-resume { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 16px; padding: 10px 12px 10px 10px; border: 1px solid #43d9ff55; border-radius: 16px; background: linear-gradient(90deg, #0d2a46, #15183f); text-align: left; }
.fx-resume img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
.fx-resume span:not(.fx-resume-clear) { display: grid; flex: 1; min-width: 0; }
.fx-resume small { color: #a9dff0; }
.fx-resume-clear { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #ffffff14; font-size: 18px; }
.fx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fx-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); text-decoration: none; transition: transform .2s, border-color .2s, box-shadow .2s; }
.fx-card .fx-media { aspect-ratio: 4 / 5; }
.fx-card-body { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 12px; }
.fx-card-body strong { min-width: 0; overflow: hidden; font-size: 15px; font-weight: 800; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.fx-card.is-unavailable { opacity: .5; }
.fx-card.is-unavailable .fx-card-body { flex-direction: column; align-items: flex-start; gap: 2px; }
.fx-card-soon { color: var(--muted); font-size: 12px; }
.fx-card-skeleton { aspect-ratio: 4 / 5.8; background: linear-gradient(100deg, var(--surface) 30%, var(--raised) 50%, var(--surface) 70%); background-size: 300% 100%; animation: fx-shimmer 1.4s linear infinite; }
@media (hover: hover) { .fx-card:not(.is-unavailable):hover { transform: translateY(-3px); border-color: #f15bda66; box-shadow: var(--glow); } }

/* ---------------------------------------------------------------- topbar */
.fx-topbar { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top)); z-index: 20; display: flex; align-items: center; gap: 10px; margin: 0 calc(-1 * var(--gutter)); padding: 10px var(--gutter); background: #080a20e0; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.fx-back { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: #ffffff10; font-size: 28px; line-height: 1; text-decoration: none; padding-bottom: 3px; }
.fx-topbar-title { min-width: 0; flex: 1; }
.fx-topbar-title small { display: block; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.fx-topbar-title h2 { margin: 0; overflow: hidden; font-size: 20px; font-weight: 850; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.fx-job-nav { display: flex; gap: 6px; }
.fx-job-nav button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 22px; padding-bottom: 3px; }
.fx-job-nav button:disabled { opacity: .3; }

/* ---------------------------------------------------------------- effect screen */
body[data-screen=effect] #fx-app { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
.fx-create { display: grid; gap: 18px; }
.fx-create-media { display: grid; gap: 10px; }
.fx-effect-preview { overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line-soft); }
.fx-effect-preview .fx-media { aspect-ratio: 16 / 11; }
.fx-effect-preview .fx-compare img { object-fit: cover; }
.fx-effect-desc { margin: 0; color: var(--muted); font-size: 15px; }
.fx-step { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: #12163acc; }
.fx-step + .fx-step { margin-top: 14px; }
.fx-step h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 17px; font-weight: 850; letter-spacing: -.01em; }
.fx-step h3 span:first-child { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-dim); color: var(--accent); font-size: 13px; }
#fx-options:not(:has(.fx-opt-block:not([hidden]))) { display: none; }
#fx-options:has(#fx-image-options[hidden]):not(:has(#fx-video-options:not([hidden]))):not(:has(#fx-morpho:not([hidden]))) { display: none; }
#fx-options:has(#fx-effect-params[hidden]):has(#retouch-mode-controls[hidden]):not(:has(#fx-video-options:not([hidden]))):not(:has(#fx-morpho:not([hidden]))) { display: none; }
.fx-effect-params { display: grid; gap: 14px; }
.fx-photo { position: relative; }
.fx-photo-empty { display: grid; justify-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed #f15bda66; border-radius: var(--radius-sm); background: radial-gradient(circle at 50% 0, #f15bda1f, transparent 70%); text-align: center; cursor: pointer; transition: background .2s, border-color .2s; }
.fx-photo-empty:hover { border-color: var(--accent); }
.fx-photo-empty strong { font-size: 17px; }
.fx-photo-empty small { color: var(--muted); }
.fx-photo-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 24px #f15bda55; }
.fx-photo-icon svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; }
.fx-photo.is-uploading .fx-photo-icon { animation: fx-pulse 1s ease-in-out infinite; }
.fx-photo-filled { display: none; position: relative; margin: 0; overflow: hidden; border-radius: var(--radius-sm); background: #0b0d28; }
.fx-photo.has-photo .fx-photo-empty { display: none; }
.fx-photo.has-photo .fx-photo-filled { display: block; }
.fx-photo-filled img { width: 100%; max-height: 46vh; object-fit: contain; margin: 0 auto; }
.fx-photo-filled figcaption { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.fx-photo-state { margin-right: auto; padding: 6px 12px; border-radius: 999px; background: #080a20cc; font-size: 13px; font-weight: 700; }
.fx-chip-button { display: inline-flex; align-items: center; min-height: 38px; padding: 7px 16px; border-radius: 999px; background: #080a20cc; border: 1px solid #ffffff30; font-size: 14px; font-weight: 800; cursor: pointer; backdrop-filter: blur(6px); }
.fx-photo-scan { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: linear-gradient(180deg, transparent 0, #43d9ff55 48%, #f15bda88 50%, transparent 52%); background-size: 100% 220%; }
.fx-photo.is-analysing .fx-photo-scan { opacity: 1; animation: fx-scan 1.6s linear infinite; }
.fx-recents { display: grid; gap: 8px; }
.fx-recents small { color: var(--muted); font-weight: 700; font-size: 12px; }
.fx-recents-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.fx-recents-row::-webkit-scrollbar { display: none; }
.fx-recent { flex: none; width: 58px; height: 58px; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 12px; background: var(--raised); }
.fx-recent img { width: 100%; height: 100%; object-fit: cover; }
.fx-recent.is-current { border-color: var(--accent); box-shadow: 0 0 0 3px #f15bda33; }
.fx-field { display: grid; gap: 8px; }
.fx-field + .fx-field { margin-top: 12px; }
.fx-field-label { font-weight: 700; font-size: 14px; }
.fx-segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 4px; border-radius: 14px; background: #080a20; border: 1px solid var(--line); }
.fx-segmented button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 800; }
.fx-segmented button[aria-pressed=true] { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px #f15bda88; }

/* engine controls moved into the screen */
#fx-image-options { display: grid; gap: 14px; }
#fx-image-options .fx-opt-block { margin: 0; }
#full-image-prompt { display: grid; gap: 8px; }
#full-image-prompt label { font-weight: 700; font-size: 14px; }
#custom-prompt { width: 100%; min-height: 88px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #080a20; color: var(--text); resize: vertical; font-size: 16px; }
#custom-prompt:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.custom-prompt-help, .retouch-strength-controls p { margin: 0; color: var(--dim); font-size: 12px; }
.retouch-strength-controls { display: grid; gap: 8px; }
.retouch-strength-controls label { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.retouch-strength-controls output { color: var(--accent); font-variant-numeric: tabular-nums; }
input[type=range] { accent-color: var(--accent); }
#retouch-strength { width: 100%; height: 32px; }
.face-preservation-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 2px; font-weight: 700; font-size: 14px; cursor: pointer; }
.face-preservation-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { position: relative; flex: none; width: 50px; height: 30px; border-radius: 999px; background: #34325d; transition: background .2s; }
.toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 6px #0006; }
.face-preservation-toggle input:checked + .toggle-track { background: var(--accent); }
.face-preservation-toggle input:checked + .toggle-track::after { transform: translateX(20px); }
.face-preservation-toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.fx-morpho { border-top: 1px solid var(--line-soft); padding-top: 4px; }
.fx-morpho > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-weight: 800; cursor: pointer; list-style: none; }
.fx-morpho > summary::-webkit-details-marker { display: none; }
.fx-morpho > summary::after { content: "+"; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #ffffff10; font-size: 18px; }
.fx-morpho[open] > summary::after { content: "–"; }
#settings { margin: 0; }
#settings .retouch-panel, #settings .advanced, #settings .inspector-heading h2 { display: none !important; }
#settings .inspector-heading { display: flex; justify-content: flex-end; }
#reset-body { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; }
#reset-body svg, #settings summary svg, #settings legend svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.body-group { border-bottom: 1px solid var(--line-soft); }
.body-group > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 700; cursor: pointer; list-style: none; }
.body-group > summary::-webkit-details-marker { display: none; }
.body-group > summary small { margin-left: auto; color: var(--accent); }
.body-group fieldset, .workflow-control { margin: 0 0 14px; padding: 0; border: 0; }
.body-group legend, .workflow-control legend { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 700; font-size: 14px; }
.appearance-hint { margin: 0 0 8px; color: var(--dim); font-size: 12px; }
.appearance-warning { margin: 8px 0 0; color: #ffd28f; font-size: 12px; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span { display: inline-flex; align-items: center; min-height: 38px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 600; }
.choice input:checked + span { background: var(--accent-dim); border-color: var(--accent); color: #ffe1fa; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.workflow-slider { display: flex; align-items: center; gap: 8px; }
.workflow-slider input { flex: 1; }

/* sticky call to action — only on the effect screen */
.fx-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 12px max(var(--gutter), env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left)); background: linear-gradient(0deg, #080a20 55%, #080a20d0 80%, transparent); }
.fx-cta-inner { display: grid; gap: 8px; width: min(560px, 100%); margin: 0 auto; }
.fx-cta-hint { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
#fx-cta-status .job-status { margin: 0; }
#fx-cta-status #progress, #fx-cta-status #job-details { display: none !important; }
#fx-cta-status #status { margin: 0; padding: 8px 12px; border-radius: 12px; font-size: 13px; text-align: center; background: #ffffff0d; }
#fx-cta-status .job-status.error #status { background: #3a1427; color: var(--danger); }
#fx-cta-status #status:empty { display: none; }
#generate { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 56px; margin: 0; padding: 12px 22px; overflow: hidden; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--accent), #ff8af0 60%, #c09bff); background-size: 200% 100%; color: var(--accent-text); font-size: 18px; font-weight: 900; letter-spacing: -.01em; box-shadow: 0 10px 30px #f15bda66; transition: transform .15s, filter .2s, opacity .2s; animation: fx-shine 4s ease-in-out infinite; }
#generate:active:not(:disabled) { transform: scale(.98); }
#generate:disabled { filter: grayscale(.7) brightness(.6); box-shadow: none; animation: none; cursor: default; }
#generate.is-busy::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, #ffffff55, transparent); animation: fx-shimmer 1.2s linear infinite; background-size: 200% 100%; }
.generate-cost { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: #170b2422; font-size: 15px; }
.generate-cost .credit-icon { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- job screen */
.fx-job { display: grid; gap: 16px; }
.fx-stage { position: relative; display: grid; place-items: center; min-height: 52vh; overflow: hidden; border-radius: 22px; background: #050616; border: 1px solid var(--line-soft); }
.fx-stage-loading { padding: 40px; color: var(--accent); }
.fx-stage-loading .fx-spinner { width: 28px; height: 28px; }
.fx-running { position: relative; width: 100%; height: 100%; min-height: 52vh; }
.fx-running img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: saturate(.6) brightness(.7); }
.fx-running.is-stopped img { filter: grayscale(.8) brightness(.45); }
.fx-running-glow { position: absolute; inset: -20%; background: conic-gradient(from 0deg, #f15bda55, #8b5cff44, #43d9ff44, #f15bda55); filter: blur(40px); mix-blend-mode: screen; animation: fx-spin 6s linear infinite; opacity: .7; }
.fx-running-scan { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 0, #ffffff10 46%, #f15bdaaa 50%, transparent 54%); background-size: 100% 220%; animation: fx-scan 2.2s ease-in-out infinite; }
.fx-result { width: 100%; height: 100%; min-height: 52vh; display: grid; }
.fx-result { place-items: center; }
.fx-result .fx-compare { min-height: 40vh; height: 62vh; }
.fx-result .fx-compare.is-fitted { height: auto; min-height: 0; margin: 0 auto; }
.fx-compare.is-fitted img { object-fit: cover; }
.fx-result.is-new { animation: fx-pop .7s cubic-bezier(.2, .9, .3, 1.2); }
.fx-result-video video { width: 100%; max-height: 72vh; object-fit: contain; background: #000; }
.fx-burst { position: absolute; left: 50%; top: 50%; z-index: 5; pointer-events: none; }
.fx-burst i { position: absolute; width: 8px; height: 8px; border-radius: 2px; background: hsl(var(--h) 95% 70%); transform: rotate(var(--a)) translateY(0); animation: fx-burst 1.1s cubic-bezier(.1, .8, .3, 1) forwards; }
.fx-job-panel { display: grid; gap: 14px; }
.fx-panel-card { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); }
.fx-status { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 17px; font-weight: 800; }
.fx-status .fx-spinner { color: var(--accent); }
.fx-status.is-error { color: var(--danger); }
.fx-progress { position: relative; height: 8px; overflow: hidden; border-radius: 999px; background: #ffffff12; }
.fx-progress span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--accent-3)); transition: width .6s ease; }
.fx-progress.is-indeterminate span { width: 35% !important; animation: fx-indeterminate 1.3s ease-in-out infinite; }
.fx-phases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fx-phases span { height: 8px; border-radius: 999px; background: #ffffff12; }
.fx-phases span.done { background: var(--accent); }
.fx-phases span.active { background: linear-gradient(90deg, var(--accent), #ffffff33); background-size: 200% 100%; animation: fx-shimmer 1.2s linear infinite; }
.fx-progress-detail { color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.fx-progress-detail:empty { display: none; }
.fx-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fx-actions > * { flex: 1 1 140px; }
.fx-result-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; }
.fx-action { display: grid; justify-items: center; gap: 6px; min-height: 68px; padding: 10px 6px; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--surface); font-size: 13px; font-weight: 700; text-decoration: none; }
.fx-action svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fx-action-accent { background: linear-gradient(135deg, var(--accent), #ff8af0); border-color: transparent; color: var(--accent-text); box-shadow: 0 8px 24px #f15bda44; }
.fx-action-quiet { color: var(--dim); }
.fx-action-quiet span { display: none; }
.fx-feedback { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.fx-feedback button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 19px; filter: grayscale(1); opacity: .7; }
.fx-feedback .fx-delete { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; width: auto; padding: 0 14px; border-color: #ff8fa355; border-radius: 999px; filter: none; opacity: 1; color: var(--danger); font-size: 14px; font-weight: 700; }
.fx-feedback .fx-delete:active { transform: scale(.96); }
.fx-feedback .fx-delete svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fx-feedback button[aria-pressed=true] { filter: none; opacity: 1; border-color: var(--accent); background: var(--accent-dim); }
.fx-chain { display: grid; gap: 12px; }
.fx-chain-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.fx-chain h3 { margin: 8px 0 0; font-size: 17px; font-weight: 850; }
.fx-carousel { display: flex; gap: 10px; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter) 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.fx-carousel::-webkit-scrollbar { display: none; }
.fx-mini { flex: none; display: grid; gap: 6px; width: 128px; padding: 0 0 10px; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--surface); text-align: left; scroll-snap-align: start; }
.fx-mini .fx-media { aspect-ratio: 4 / 5; }
.fx-mini > span { padding: 0 10px; overflow: hidden; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.fx-mini .fx-cost { padding: 0 10px; font-size: 12px; }

/* ---------------------------------------------------------------- creations */
.fx-section-head { padding: 20px 0 0; }
.fx-section-head h1 { margin: 0; font-size: clamp(28px, 7.5vw, 44px); font-weight: 850; letter-spacing: -.04em; }
.fx-section-head p { margin: 6px 0 0; color: var(--muted); }
.fx-creations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.fx-tile { position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 12px; background: var(--surface); text-decoration: none; }
.fx-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.fx-tile .fx-badge { top: 6px; left: 6px; width: 24px; height: 24px; }
.fx-tile-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; background: linear-gradient(0deg, #080a20dd, transparent); overflow: hidden; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.fx-tile.is-running img { filter: brightness(.5) saturate(.6); }
.fx-tile.is-failed img { filter: grayscale(1) brightness(.4); }
.fx-tile-progress { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent); }
.fx-tile-progress .fx-spinner { width: 26px; height: 26px; border-width: 3px; }
.fx-tile-progress i { position: absolute; left: 8px; right: 8px; bottom: 30px; height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-3)); width: 0; max-width: calc(100% - 16px); transition: width .5s; }
.fx-tile-progress i.is-indeterminate { width: 40%; animation: fx-indeterminate 1.3s ease-in-out infinite; }
.fx-more { display: block; margin: 20px auto 0; min-height: 46px; padding: 10px 22px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-weight: 700; }
@media (hover: hover) { .fx-tile:hover img { transform: scale(1.04); } }
/* engine dialogs are never shown on the public page */
#engine { display: none !important; }

/* ---------------------------------------------------------------- responsive */
@media (min-width: 700px) {
    .fx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .fx-creations { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .fx-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 28px; padding-top: 28px; }
  .fx-mini { width: 150px; }
}
@media (min-width: 1000px) {
  .fx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fx-create { grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); align-items: start; gap: 28px; }
  .fx-create-media { position: sticky; top: calc(var(--header-h) + 76px); }
  .fx-effect-preview .fx-media { aspect-ratio: 4 / 5; max-height: 70vh; }
  .fx-job { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; }
  .fx-stage, .fx-running, .fx-result { min-height: 70vh; }
  .fx-result .fx-compare { --fit-height: 78vh; }
  .fx-cta { left: auto; right: max(24px, calc((100vw - 1180px) / 2 + 24px)); bottom: 16px; width: 440px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 26px; background: #0d1030ee; backdrop-filter: blur(14px); box-shadow: var(--shadow); }
  .fx-carousel { margin: 0; padding: 2px 0 8px; }
}
.fx-stage:has(.fx-compare.is-fitted), .fx-stage:has(.fx-compare.is-fitted) .fx-result { min-height: 0; }

.fx-secondary-source { justify-content: flex-start; gap: 10px; padding-left: 8px; grid-column: 1 / -1; }
.fx-secondary-source img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.fx-tile video { width: 100%; height: 100%; object-fit: cover; }

/* deletion */
.fx-delete.is-armed, .fx-tile-delete.is-armed { background: var(--danger) !important; border-color: var(--danger) !important; color: #2a0612 !important; animation: fx-armed .5s ease-in-out infinite alternate; }
@keyframes fx-armed { to { box-shadow: 0 0 0 4px #ff8fa344; } }
.fx-delete-wide { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; border: 1px solid #ff8fa355; border-radius: 999px; background: transparent; color: var(--danger); font-weight: 700; }
.fx-delete-wide svg, .fx-delete-bulk svg, .fx-tile-delete svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fx-delete-bulk { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; margin: 0 0 12px; padding: 6px 14px; border: 1px solid #ff8fa355; border-radius: 999px; background: #3a142733; color: var(--danger); font-size: 14px; font-weight: 700; }
.fx-tile-failed { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px; background: #3a1427e6; color: var(--danger); font-size: 11px; font-weight: 800; }
.fx-tile-delete { position: absolute; top: 6px; right: 6px; z-index: 3; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid #ff8fa388; border-radius: 999px; background: #080a20e6; color: var(--danger); font-size: 12px; font-weight: 800; white-space: nowrap; }
.fx-tile-delete span { display: none; }
.fx-tile-delete.is-armed span { display: inline; }
.fx-tile-failed { top: auto !important; bottom: 30px; }
.fx-tile.is-leaving { transition: transform .22s, opacity .22s; transform: scale(.8); opacity: 0; }
