/* Built from /prompt/video/flow/flow.css by try/build.mjs. Edit the source, then rebuild. */
/* Titans phone flow: one task per screen, phone first. Tokens (colors, fonts) come from video.css. */
body.flow { background: var(--bg); font-size: 16px; }
body.flow main.fl-main { display: block; max-width: none; margin: 0; padding: 4px 16px 24px; grid-template-columns: none; }
.fl-app { --nav-h: calc(60px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.fl-main { flex: 1 0 auto; }
.fl-ribbon { margin: 0; padding: 6px 16px; font-size: 12px; text-align: center; color: var(--amber); background: var(--amber-soft); border-bottom: 1px solid #f0dfae; }

/* Header: wordmark left, Account right */
header.fl-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
.fl-brand { display: grid; align-content: center; gap: 3px; min-height: 44px; margin-right: auto; text-decoration: none; color: var(--ink); }
.fl-brand strong { font: 800 21px/1 var(--display); letter-spacing: .05em; }
.fl-brand span { font: 700 10.5px/1 var(--body); letter-spacing: .22em; color: var(--coral); }
.fl-tag { font: 700 10px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--coral-2); background: var(--coral-soft); border: 1px solid #f3cfc2; border-radius: 99px; padding: 5px 9px; }
.fl-account { min-height: 44px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--paper); font-weight: 600; font-size: 15px; cursor: pointer; }

/* Progress */
.fl-progress { padding: 14px 0 4px; }
.fl-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.fl-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px 0 0; border: 0; background: none; font-weight: 600; font-size: 15px; color: var(--ink); cursor: pointer; }
.fl-back[hidden] { display: inline-flex !important; visibility: hidden; }
.fl-step-label { font-size: 14px; color: var(--muted); text-align: right; }
.fl-bars { display: grid; gap: 8px; margin-top: 4px; }
.fl-bars span { height: 4px; border-radius: 4px; background: var(--line); }
.fl-bars span.on { background: var(--coral); }

/* Step content */
.fl-step { padding-top: 14px; }
.fl-h { font: 800 28px/1.15 var(--display); letter-spacing: -.015em; margin: 0 0 8px; outline: none; }
.fl-sub { color: var(--muted); margin: 0 0 18px; font-size: 16px; line-height: 1.5; }
.fl-section-title { font-weight: 700; font-size: 15px; margin: 22px 0 10px; }
.fl-mini { font-size: 13px; color: var(--muted); }

/* Step 1: swap choices */
.fl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fl-opt { min-height: 60px; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 14px; background: var(--paper); font: 700 16px/1.25 var(--body); color: var(--ink); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.fl-opt[aria-pressed="true"] { border-color: var(--coral); background: var(--coral-soft); color: var(--coral-2); box-shadow: inset 0 0 0 1px var(--coral); }
.fl-opt[aria-pressed="true"]::after { content: " ✓"; }
.fl-note { margin: 16px 0 0; padding: 16px; border-radius: 14px; background: var(--coral-soft); border: 1px solid #f6d9cd; }
.fl-note strong { display: block; font-size: 16px; margin-bottom: 4px; }
.fl-note p { margin: 0; color: #5b4a43; font-size: 15px; line-height: 1.5; }
.fl-text-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; padding: 0; border: 0; background: none; color: var(--coral-2); font: 600 15px/1.3 var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Upload controls + media rows */
.fl-upload { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 96px; padding: 16px; border: 1.5px dashed var(--line-2); border-radius: 16px; background: var(--paper); text-align: center; cursor: pointer; }
.fl-upload strong { font-size: 17px; } .fl-upload span { font-size: 14px; color: var(--muted); }
.fl-upload:hover, .fl-upload:focus-within { border-color: var(--coral); }
.fl-choices { display: grid; gap: 10px; }
.fl-choice { display: flex; align-items: center; gap: 12px; min-height: 64px; width: 100%; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 14px; background: var(--paper); text-align: left; cursor: pointer; color: var(--ink); text-decoration: none; }
.fl-choice:hover, .fl-choice:focus-within { border-color: var(--coral); }
.fl-choice .fl-ci { flex: 0 0 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--sand); font-size: 18px; }
.fl-choice strong { display: block; font-size: 16px; } .fl-choice small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.fl-choice.primary { border-color: var(--coral); background: var(--coral-soft); }
.fl-choice[aria-disabled="true"] { opacity: .5; cursor: default; }
.fl-media { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.fl-thumb { flex: 0 0 72px; width: 72px; height: 96px; border-radius: 10px; overflow: hidden; background: #111; display: grid; place-items: center; color: #fff; font-size: 12px; }
.fl-thumb video, .fl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fl-media-info { flex: 1; min-width: 0; }
.fl-media-info strong { display: block; font-size: 16px; } .fl-media-info span { display: block; font-size: 14px; color: var(--muted); }
.fl-media-actions { display: flex; flex-direction: column; gap: 6px; }
.fl-small-btn { min-height: 40px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--paper); font-weight: 600; font-size: 14px; cursor: pointer; color: var(--ink); white-space: nowrap; }
.fl-link-row { display: flex; gap: 8px; margin-top: 10px; }
.fl-link-row input { flex: 1; min-width: 0; min-height: 48px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--paper); font-size: 16px; }
.fl-msg { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.fl-msg.err, .fl-warn { color: #a12e12; }
.fl-warn { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--red-soft); font-size: 14.5px; line-height: 1.45; }
.fl-ok { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-size: 14.5px; }

/* Step 3: replacement images with plain roles */
.fl-refs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.fl-ref { position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); overflow: hidden; }
.fl-ref img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--sand); }
.fl-ref-meta { padding: 8px 10px 10px; display: grid; gap: 4px; }
.fl-ref-meta strong { font-size: 14px; } .fl-ref-meta .fl-tagline { font-size: 12px; color: var(--muted); }
.fl-ref-meta select { width: 100%; min-height: 40px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--paper); padding: 0 8px; font-size: 16px; }
.fl-ref .fl-x { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(23,21,18,.65); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.fl-ref .fl-busy { position: absolute; inset: 0 0 auto; aspect-ratio: 3 / 4; display: grid; place-items: center; background: rgba(250,249,246,.8); font-size: 13px; font-weight: 600; text-align: center; padding: 8px; }
.fl-ref.bad { border-color: #e7a796; }
.fl-cost { margin: 8px 2px 0; font-size: 13.5px; color: var(--muted); }
.fl-field { display: grid; gap: 6px; margin-top: 14px; }
.fl-field > span { font-weight: 700; font-size: 15px; }
.fl-field textarea, .fl-field input[type="text"] { width: 100%; min-height: 48px; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--paper); font-size: 16px; line-height: 1.45; }
.fl-field textarea { min-height: 96px; resize: vertical; }
.fl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fl-chip { min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--paper); font-weight: 600; font-size: 15px; cursor: pointer; color: var(--ink); }
.fl-chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.fl-toggle { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 15.5px; cursor: pointer; }
.fl-toggle input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--coral); }

/* Step 4: review */
.fl-summary { padding: 16px; border-radius: 16px; background: var(--coral-soft); border: 1px solid #f6d9cd; }
.fl-summary strong { display: block; font: 800 20px/1.25 var(--display); }
.fl-summary span { display: block; margin-top: 4px; color: #5b4a43; }
.fl-rows { margin-top: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.fl-rowi { display: flex; align-items: center; gap: 12px; padding: 10px 12px; min-height: 64px; }
.fl-rowi + .fl-rowi { border-top: 1px solid var(--line); }
.fl-rowi .fl-mthumb { flex: 0 0 44px; width: 44px; height: 58px; border-radius: 8px; overflow: hidden; background: var(--sand); }
.fl-rowi .fl-mthumb video, .fl-rowi .fl-mthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fl-rowi .fl-rtext { flex: 1; min-width: 0; } .fl-rowi .fl-rtext strong { display: block; font-size: 15px; } .fl-rowi .fl-rtext span { display: block; font-size: 13.5px; color: var(--muted); }
.fl-edit { min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--coral-2); font-weight: 700; font-size: 15px; cursor: pointer; }
.fl-card { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.fl-card h3 { margin: 0 0 6px; font-size: 16px; }
.fl-specs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.fl-specs span { padding: 4px 10px; border-radius: 99px; background: var(--sand); font-size: 13.5px; font-weight: 600; }
.fl-reason { margin: 6px 0 0; font-size: 14.5px; color: #4d4842; line-height: 1.5; }
.fl-reason.changed { padding: 10px 12px; border-radius: 12px; background: var(--amber-soft); color: var(--amber); }
details.fl-more { margin-top: 10px; border-top: 1px solid var(--line); }
details.fl-more > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-weight: 700; font-size: 15px; cursor: pointer; list-style: none; }
details.fl-more > summary::-webkit-details-marker { display: none; }
details.fl-more > summary::after { content: "+"; font-size: 20px; color: var(--muted); }
details.fl-more[open] > summary::after { content: "−"; }
.fl-models { display: grid; gap: 8px; }
.fl-model { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; min-height: 52px; border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--paper); cursor: pointer; }
.fl-model input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--coral); flex: 0 0 auto; }
.fl-model strong { display: block; font-size: 15px; } .fl-model small { display: block; color: var(--muted); font-size: 13px; }
.fl-model:has(input:checked) { border-color: var(--coral); background: var(--coral-soft); }
.fl-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.fl-settings label { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.fl-settings select { width: 100%; min-height: 48px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--paper); font-size: 16px; color: var(--ink); }
.fl-settings select:disabled { background: var(--sand); color: var(--muted); }
.fl-prompt-peek { margin: 8px 0 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.fl-quote .fl-big { font: 800 30px/1.1 var(--display); }
.fl-quote .fl-big small { font: 600 15px/1 var(--body); color: var(--muted); margin-left: 4px; }
.fl-quote p { margin: 6px 0 0; font-size: 14.5px; color: #4d4842; }
.fl-quote .fl-buy { display: inline-flex; align-items: center; min-height: 44px; color: var(--coral-2); font-weight: 700; }
.fl-consent { display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); font-size: 15px; line-height: 1.45; cursor: pointer; }
.fl-consent input { width: 22px; height: 22px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--coral); }
.fl-consent a { color: var(--coral-2); font-weight: 600; }
.fl-result { margin-top: 14px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); }
.fl-result video { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; display: block; }
.fl-result .fl-wait { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.fl-result .spin { width: 24px; height: 24px; border: 3px solid var(--line); border-top-color: var(--coral); border-radius: 50%; animation: fl-spin 1s linear infinite; }
@keyframes fl-spin { to { transform: rotate(360deg); } }
.fl-result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fl-sim { display: inline-block; margin-bottom: 8px; padding: 3px 9px; border-radius: 99px; background: var(--amber-soft); color: var(--amber); font-size: 12px; font-weight: 700; letter-spacing: .04em; }

/* Sticky action area (above the bottom nav). In flow, so at the end of the page it never covers anything. */
.fl-actions { position: sticky; bottom: var(--nav-h); z-index: 15; padding: 10px 16px 8px; background: linear-gradient(to bottom, rgba(250,249,246,0), var(--bg) 18px); }
.fl-action-note { margin: 0 0 8px; font-size: 14px; text-align: center; color: var(--muted); }
.fl-action-note:empty { display: none; }
.fl-action-note.err { color: #a12e12; }
.fl-primary { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 54px; padding: 0 18px; border: 0; border-radius: 14px; background: var(--coral); color: #fff; font: 700 17px/1.2 var(--body); cursor: pointer; text-decoration: none; text-align: center; }
.fl-primary:disabled { background: #e9b3a5; cursor: default; }
.fl-primary.spend { background: var(--coral-2); }
.fl-help-link { display: block; width: 100%; min-height: 44px; margin-top: 2px; border: 0; background: none; color: var(--muted); font-size: 14.5px; cursor: pointer; }
.fl-secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--paper); color: var(--ink); font-weight: 700; font-size: 15.5px; text-decoration: none; cursor: pointer; }

/* Bottom nav: Create / Library / Learn */
.fl-nav { position: sticky; bottom: 0; z-index: 16; display: grid; grid-template-columns: repeat(3, 1fr); height: var(--nav-h); padding-bottom: env(safe-area-inset-bottom); background: var(--paper); border-top: 1px solid var(--line); }
.fl-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px; color: var(--muted); text-decoration: none; font-size: 12.5px; font-weight: 600; }
.fl-nav .fl-ico { font-size: 19px; line-height: 1; }
.fl-nav a[aria-current="page"] { color: var(--coral-2); }
/* Keyboard open on a phone: get the bars out of the way of the field being typed in. */
body.kb .fl-nav { display: none; }
body.kb .fl-actions { position: static; }

/* Sheets (account, help, library, prompt editor) */
dialog.fl-sheet { width: min(560px, 100vw); max-width: 100vw; max-height: 90dvh; margin: auto auto 0; border: 0; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); background: var(--bg); color: var(--ink); overflow: auto; }
dialog.fl-sheet::backdrop { background: rgba(23, 21, 18, .5); }
.fl-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.fl-sheet-head h2 { margin: 0; font: 800 22px/1.2 var(--display); }
.fl-sheet .sheet-x { width: 44px; height: 44px; }
.fl-balances { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.fl-balances > div { padding: 12px 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.fl-k { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fl-balances strong { font: 800 24px/1.2 var(--display); }
.fl-link-btn { margin-bottom: 8px; }
.fl-menu { list-style: none; margin: 8px 0 0; padding: 0; }
.fl-menu a { display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.fl-help-list { margin: 0 0 16px; padding-left: 20px; line-height: 1.55; } .fl-help-list li { margin: 6px 0; }
.fl-lib-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fl-lib-grid button { padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; background: var(--sand); cursor: pointer; aspect-ratio: 3 / 4; }
.fl-lib-grid button:focus-visible, .fl-lib-grid button:hover { border-color: var(--coral); }
.fl-lib-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
dialog.fl-editor[open] { display: flex; flex-direction: column; height: 90dvh; }
.fl-editor textarea { flex: 1; width: 100%; min-height: 200px; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--paper); font-size: 16px; line-height: 1.5; resize: none; }
.fl-editor-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.fl-soon { padding-top: 30px; }

/* Narrowest phones */
@media (max-width: 340px) {
  .fl-h { font-size: 25px; }
  .fl-opt { font-size: 15px; padding: 12px; }
  .fl-settings { grid-template-columns: 1fr; }
}
/* Wider screens: the same flow as a centered phone-width column on a quiet dotted page. */
@media (min-width: 760px) {
  body.flow { background-color: #f3efe8; background-image: radial-gradient(#ddd5c9 1px, transparent 1px); background-size: 18px 18px; }
  .fl-app { margin: 24px auto; min-height: calc(100dvh - 48px); border: 1px solid var(--line); border-radius: 28px; box-shadow: 0 18px 50px rgba(23,21,18,.10); overflow: clip; }
  .fl-nav { border-radius: 0 0 28px 28px; }
  dialog.fl-sheet { margin: auto; border-radius: 20px; }
}

/* "Continue your project": the free try (/try/) saved on this phone, picked up after joining */
.fl-resume { margin: 0 0 18px; }
.fl-resume-actions { display: grid; gap: 4px; margin-top: 12px; }
.fl-resume-actions .fl-text-link { justify-self: center; margin-top: 2px; }

/* Step 1 link to AI Video & Audio (beta) */
.fl-step > a.fl-choice { margin-top: 14px; text-decoration: none; color: inherit; }
.fl-step > a.fl-choice .fl-tag { margin-left: 6px; vertical-align: 2px; } /* .fl-dub-choice */

/* Account sheet: the balance in videos ("About 40 videos (5-second Wan 3.0 Prime at 720p)") */
.fl-balances #acctVideos { display: block; margin-top: 4px; font-size: 12px; line-height: 1.4; letter-spacing: 0; text-transform: none; color: var(--muted); }
.fl-balances #acctVideos:empty { display: none; }

/* Buy credits without leaving the page (phone flow and AI Video & Audio): packs + Square's form in a sheet, the video kept */
.buy-sheet .buy-saved { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--green, #1f7a4d); }
.buy-sheet .tiers { grid-template-columns: 1fr 1fr; gap: 8px; }
.buy-sheet .tier { min-height: 44px; }
.buy-sheet .pay-box { margin-top: 12px; }
.buy-sheet .buy-status { margin: 10px 0 0; font-size: 14px; } .buy-sheet .buy-status:empty { display: none; }
.buy-sheet .buy-status.err { color: #a12e12; }
.buy-sheet .buy-fine { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
button.fl-buy { border: 0; background: none; padding: 0; font: inherit; color: var(--coral-2); font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 44px; }
/* A link that can't be used: why, what to do instead, and the upload button right there */
.fl-msg.err span { display: block; }
.fl-msg .fl-link-upload { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 8px; color: var(--ink); cursor: pointer; }
.fl-thumb:not(:has(video)) { display: grid; place-items: center; font-size: 20px; color: var(--muted); }
