:root {
  color-scheme: dark;
  --bg: #151514; --surface: #1f1f1d; --surface-raised: #292926; --line: #46443f;
  --text: #f7f5ee; --muted: #bdb9ae; --accent: #ffd36b; --accent-ink: #241b09;
  --accent-hover: #ffe39a; --accent-wash: #ffd36b12;
  --green: #b5e398; --focus: #fff1c4; --control-line: #817c70;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
:root[data-app-accent="mint"] { --accent: #a7ebca; --accent-ink: #102b1d; --accent-hover: #c2f4db; --accent-wash: #a7ebca19; --focus: #d8ffe9; }
:root[data-app-accent="blue"] { --accent: #afd9ff; --accent-ink: #102536; --accent-hover: #c9e7ff; --accent-wash: #afd9ff19; --focus: #e2f1ff; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: radial-gradient(ellipse at 84% 8%, #232321 0%, transparent 45%), var(--bg); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .66; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
svg { display: inline-block; width: 20px; height: 20px; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.symbols, .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; }
.shell { width: min(1100px, 100%); padding: 0 36px; margin: 0 auto; }
.top { min-height: 77px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; min-height: 44px; align-items: center; color: var(--text); text-decoration: none; font-size: 30px; font-weight: 820; letter-spacing: -.065em; }
.brand-period { color: var(--accent); }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; margin-right: 9px; border-radius: 10px; color: var(--accent-ink); background: var(--accent); }
.brand-mark svg { width: 24px; height: 24px; stroke: none; }
.top nav { display: flex; align-items: center; gap: 22px; min-width: 0; }
.top nav a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 620; }
.top nav a:hover { color: var(--text); }
.top nav svg { width: 13px; height: 13px; }
.pilot, .format-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 100px; white-space: nowrap; font-size: 12px; color: var(--muted); }
.pilot span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .83fr); gap: clamp(38px, 8vw, 108px); padding: 60px 0 54px; align-items: start; }
.studio, .examples { min-width: 0; scroll-margin-top: 16px; }
.overline { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; line-height: 1.4; font-weight: 770; letter-spacing: .12em; text-transform: uppercase; }
.overline svg { width: 16px; height: 16px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(40px, 5.1vw, 62px); font-weight: 780; line-height: 1.06; letter-spacing: -.052em; }
.lead { max-width: 40ch; margin: 12px 0 20px; color: var(--muted); }
.workspace { min-width: 0; }
#signed-in, .example-card { container-type: inline-size; }
.auth-card, #signed-in { padding: clamp(17px, 2.6vw, 26px); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
.auth-intro { display: flex; gap: 13px; align-items: center; margin-bottom: 18px; }
.auth-intro h2, .form-step h2 { font-size: 17px; line-height: 1.2; letter-spacing: -.02em; }
.auth-intro p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.icon-box { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 13px; background: #403521; color: var(--accent); }
.primary { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 11px 14px; border: 0; border-radius: 13px; background: var(--accent); color: var(--accent-ink); text-decoration: none; text-align: center; font-weight: 790; }
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.primary .end-icon { width: 16px; height: 16px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.47; }
.under-button { margin-top: 9px; text-align: center; }
.auth-example { margin-top: 4px; }
.form-step { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.dropzone { display: flex; position: relative; align-items: center; gap: 12px; padding: 12px; min-height: 75px; border: 1px dashed #969185; border-radius: 14px; background: #262622; cursor: pointer; }
.dropzone:hover { background: #30302a; }
.dropzone:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.dropzone:has(input:disabled) { opacity: .65; }
.dropzone input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-copy { display: flex; flex: 1; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.upload-copy strong { font-size: 15px; }
.upload-copy span { margin-top: 2px; font-size: 12px; color: var(--muted); }
.upload-arrow { color: var(--accent); width: 17px; height: 17px; }
.selected-file { margin-top: 6px; display: flex; align-items: center; gap: 9px; font-size: 13px; }
.selected-file > div { overflow-wrap: anywhere; min-width: 0; flex: 1; }
#file-error:empty { display: none; }
.upload-recovery { display: grid; gap: 6px; margin-bottom: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.upload-recovery h3 { font-size: 14px; }
#upload-recovery-check-progress { width: 100%; accent-color: var(--accent); }
.recovery-source { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; overflow-wrap: anywhere; }
.upload-feedback { display: grid; gap: 6px; margin-top: 8px; }
.upload-feedback progress { width: 100%; accent-color: var(--accent); }
.upload-feedback button { justify-self: start; }
.upload-actions:not(:has(button:not([hidden]))) { display: none; }
#upload-pause[aria-disabled="true"] { opacity: .7; cursor: wait; }
.dropzone:has([aria-invalid="true"]) { border-color: #ffc3b1; }
.selected-file button, .account button { padding: 0 6px; min-height: 44px; background: transparent; border: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.mode-step { margin-top: 18px; justify-content: space-between; flex-wrap: wrap; }
.text-action { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-size: 13px; }
#result-title, #examples-title { scroll-margin-top: max(12px, env(safe-area-inset-top)); }
#result-source, #result-appearance, #repeat-form-note, #reuse-source-note, #next-source-note { overflow-wrap: anywhere; }
.mode-choices, .example-types, .comparison { display: flex; align-items: stretch; gap: 8px; padding: 0; margin: 0; min-width: 0; border: 0; }
.mode-choices > label { flex: 1; }
.mode-choices label, .example-types label, .comparison label { display: block; min-width: 0; position: relative; cursor: pointer; }
.mode-choices input, .example-controls input, #caption-presets input { position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.mode-tile { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 7px; height: 100%; min-height: 48px; padding: 10px 9px; border: 1px solid var(--control-line); border-radius: 12px; background: var(--surface-raised); align-content: center; line-height: 1.25; }
.mode-tile svg { width: 16px; height: 16px; color: var(--accent); }
.mode-tile strong { font-size: 14px; }
.mode-tile strong { overflow-wrap: anywhere; }
.mode-choices input:checked + span { border-color: var(--accent); background: #373021; box-shadow: inset 0 0 0 1px var(--accent); }
.mode-choices input:focus-visible + span, .example-controls input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.mode-hint { margin-top: 9px; }
.editor-options { display: grid; gap: 8px; margin-top: 12px; }
.format-control { margin-bottom: 3px; }
.editor-options details { background: var(--surface-raised); border: 1px solid var(--line); border-radius: 12px; }
.editor-options summary { padding: 10px 12px; min-height: 46px; font-size: 14px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 7px; cursor: pointer; list-style: none; }
.editor-options summary::-webkit-details-marker { display: none; }
.editor-options summary svg { width: 15px; height: 15px; color: var(--accent); }
.editor-options details[open] summary svg { transform: rotate(180deg); }
.option-content { display: grid; gap: 10px; padding: 0 12px 12px; }
.switch { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; cursor: pointer; }
.switch input { appearance: none; flex: none; margin: 0; width: 44px; height: 25px; border-radius: 99px; border: 1px solid #a49e91; background: #45433d; position: relative; cursor: pointer; }
.switch input::after { content: ''; position: absolute; width: 17px; height: 17px; border-radius: 50%; background: #e3ded3; top: 3px; left: 3px; }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { background: var(--accent-ink); left: 22px; }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.control { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.control input, .control select, .control textarea, #series-choice { width: 100%; min-width: 0; min-height: 44px; color: var(--text); background: var(--bg); border: 1px solid #827e71; border-radius: 8px; padding: 6px 8px; font-size: 14px; }
:is(#auto-settings, .editor-option-screen) select {
  appearance: none;
  padding-inline-end: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 16px center, right 11px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
@media (forced-colors: active) {
  :is(#auto-settings, .editor-option-screen) select { appearance: auto; background-image: none; }
}
.control textarea { resize: vertical; }
.review-phrases { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; padding: 4px; }
@media (max-width: 720px) {
  .review-phrases { max-height: none; overflow: visible; }
}
.review-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 8px; }
.review-row .control { margin: 0; }
.review-row button { font-variant-numeric: tabular-nums; }
.review-row button[data-excerpt-active], .result-stage button[data-excerpt-active], #review-play-cut[data-excerpt-active] { border-color: var(--accent); color: var(--accent); }
.review-row textarea { padding-block: 10px; field-sizing: content; }
.review-row:has([data-edited="true"]) textarea { border-color: var(--accent); }
.review-row textarea:focus { scroll-margin-block: 8px; }
.review-neighbor-actions { display: none; }
@media (max-width: 720px) {
  .review-row:focus-within .review-neighbor-actions { display: flex; }
  .review-row textarea, #review-search { font-size: 16px; }
}
.review-caption-context { overflow-wrap: anywhere; }
.review-row .review-pending-note { color: var(--accent); }
.review-conflict { display: grid; gap: 6px; overflow-wrap: anywhere; }
.review-undo { justify-self: end; }
#review-edit-count:empty { display: none; }
#review-cuts-panel { display: grid; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
#caption-controls .hint { margin-top: 7px; }
.caption-preview { --caption: #ff9dab; display: flex; justify-content: center; align-items: center; min-height: 118px; padding: 12px; text-align: center; margin-block: 8px; border-radius: 8px; overflow: hidden; background: linear-gradient(#14131038, #14131087), url("./examples/action-after.jpg") center 47% / cover; }
.caption-preview[data-color="classic"] { --caption: #ffda81; }
.caption-preview[data-color="mint"] { --caption: #90f3c1; }
.caption-preview[data-placement="top"] { align-items: flex-start; }
.caption-preview[data-placement="bottom"] { align-items: flex-end; }
.caption-sample { padding: 3px 9px; font-weight: 850; font-size: 20px; color: white; text-shadow: 0 2px 4px #000, 0 1px 9px #000; }
.caption-sample b { color: var(--caption); }
.caption-preview[data-style="word"] .caption-sample span { display: none; }
.caption-preview[data-style="accent_v1"] .caption-sample b { font-size: 1.5em; }
.caption-preview[data-style="line"] .caption-sample b { color: inherit; }
.caption-preview[data-size="small"] .caption-sample { font-size: 16px; }
.caption-preview[data-size="large"] .caption-sample { font-size: 25px; }
.consent { margin: 13px 0 12px; padding-top: 4px; border-top: 1px solid var(--line); }
.consent > label { display: flex; align-items: center; gap: 9px; min-height: 44px; font-size: 13px; cursor: pointer; }
.consent input { width: 19px; height: 19px; margin: 0; flex: none; accent-color: var(--accent); }
.processing-details summary { display: list-item; width: fit-content; min-height: 44px; padding-top: 12px; color: var(--muted); font-size: 12px; cursor: pointer; }
.consent > .hint { margin-left: 28px; }
#consent-settings { margin-top: 8px; }
#consent-error:empty { display: none; }
.processing-details p { margin-bottom: 9px; }
.job { display: grid; gap: 7px; }
.job progress { display: block; width: 100%; margin-top: 9px; accent-color: var(--accent); }
#editor-status { color: var(--muted); font-size: 14px; }
#editor-status:empty { margin: 0; }
.job-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.result-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.result-actions button { padding-inline: 7px; overflow-wrap: anywhere; }
.pending-editorial { margin-bottom: 12px; }
.secondary { min-height: 44px; padding: 7px 12px; border: 1px solid #8b8577; border-radius: 9px; background: var(--surface-raised); color: var(--text); font-size: 13px; }
.source-launch { display: grid; gap: 6px; margin-block: 10px; }
.source-launch .hint { overflow-wrap: anywhere; }
.source-tools { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: 8px; }
.source-tools > * { max-width: 100%; overflow-wrap: anywhere; }
#source-edit-settings { justify-self: start; }
#source-result { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 7px; overflow-wrap: anywhere; }
#launch-back-to-source { justify-self: start; }
#launch-pending-link { display: flex; align-items: center; justify-content: center; margin-top: 7px; text-decoration: none; }
#upload-forget-confirmation { margin-top: 8px; padding: 0; }
.quiet { background: transparent; }
.result-panel { display: grid; gap: 9px; min-width: 0; }
.result-panel h2 { font-size: 17px; }
#result-retention-alert { color: var(--accent); }
.result-downloads, .version-downloads { display: grid; gap: 7px; }
.file-extras:not(:has(.brand-content :is(a, button):not([hidden]), #review-srt-status:not(:empty))) { display: none; }
.file-extras > .brand-content { padding: 0; }
.file-extras .brand-content > .job-actions:not(:has(> :not([hidden]))) { display: none; }
#share-video, #review-share-video { justify-self: start; }
.cover-frame-link { display: inline-flex; gap: 8px; align-items: center; justify-self: start; }
.cover-frame-link img { width: 40px; height: 64px; object-fit: contain; border-radius: 3px; }
.cover-frame-step { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.cover-frame-step output { min-width: 58px; text-align: center; font-size: 13px; }
.insert-dialog {
  width: min(440px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
}
.insert-dialog::backdrop { background: #000b; }
.insert-dialog-content { display: grid; gap: 8px; padding: 14px; }
.insert-dialog-content h2 { margin: 0; font-size: 18px; }
#cover-editor { overscroll-behavior: contain; }
.cover-sources, .cover-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.cover-footer { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.cover-sources button, .cover-footer button { min-height: 44px; }
.cover-sources [aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.cover-edit-layout { display: grid; grid-template-columns: minmax(90px, 2fr) minmax(0, 3fr); gap: 12px; }
.cover-edit-stage, .cover-edit-controls { display: grid; align-content: start; min-width: 0; gap: 6px; }
.cover-canvas-wrap { position: relative; overflow: hidden; border-radius: 9px; background: #1b1e22; }
#cover-canvas { display: block; width: 100%; height: auto; }
#cover-grid { position: absolute; inset: 12.5% 0; border-block: 1px dashed #fff; box-shadow: 0 0 0 80px #0006; pointer-events: none; }
.cover-guide { display: flex; align-items: center; min-height: 44px; gap: 5px; font-size: 12px; }
.cover-edit-controls .control { gap: 2px; }
.cover-edit-controls input[type="range"] { width: 100%; min-height: 44px; padding: 0; accent-color: var(--accent); }
.cover-edit-controls input[type="file"] { width: 100%; min-width: 0; min-height: 44px; }
.cover-series { display: grid; }
.cover-series .switch { min-height: 44px; }
.insert-photo-stage {
  width: min(100%, 216px, 27dvh);
  aspect-ratio: 9 / 16;
  justify-self: center;
  overflow: hidden;
  border-radius: 8px;
  background: #111;
}
.insert-photo-stage img { display: block; width: 100%; height: 100%; object-fit: cover; }
.insert-photo-stage[data-fit="full"] img { object-fit: contain; }
.insert-photo-stage[data-pan] { cursor: grab; user-select: none; }
.insert-photo-stage[data-pan="x"] { touch-action: pan-y pinch-zoom; }
.insert-photo-stage[data-pan="y"] { touch-action: pan-x pinch-zoom; }
.insert-photo-stage[data-dragging] { cursor: grabbing; }
#insert-frame-video { width: 100%; max-height: 32dvh; object-fit: contain; background: #111; }
#insert-frame-time, #insert-photo-position { accent-color: var(--accent); }
#result-jump-download { justify-self: start; }
:is(#download, #review-download).secondary { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
#jump-to-review { justify-self: start; }
.compare-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compare-actions:has(> [hidden]) { grid-template-columns: minmax(0, 1fr); }
.compare-actions:not(:has(> :not([hidden]))) { display: none; }
.compare-actions > :is(button, a) { padding-inline: 6px; }
.compare-actions:has(#compare-insert-other:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compare-actions:has(#compare-insert-other:not([hidden])) #compare-export { grid-column: 1 / -1; }
#review-insert-list button[data-excerpt-active] { border-color: var(--accent); color: var(--accent); }
#result-preview:has(img:not([hidden])) { display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 7px 12px; }
#result-preview-cover { width: 32px; height: 56px; flex: none; object-fit: contain; border-radius: 5px; }
.file-download-note:empty { display: none; }
.browser-download { display: inline-flex; align-items: center; justify-self: start; text-decoration: none; }
.asset-retry { justify-self: start; }
.asset-retry[aria-disabled="true"] { opacity: .7; cursor: wait; }
.result-stage video { display: block; width: 100%; max-height: 57vh; border-radius: 10px; background: #0d0d0c; }
.result-stage, .result-preview-stage { display: grid; gap: 5px; }
#review-current-phrase { display: none; }
.result-stage:has(.result-preview-stage:not([hidden]) video:not([hidden])) #review-current-phrase { display: block; }
#excerpt-status:not(:empty) { padding-inline: 6px; }
#excerpt-status:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.result-stage .preview-progress { height: 6px; margin: 1px 0; }
.result-stage button[id$="-preview-cancel"] { justify-self: start; }
.result-stage:has(#result-revised-stage[hidden]) #compare-draft-warning { display: none; }
.result-comparison label { flex: 1; }
.result-comparison input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.result-comparison label span { display: grid; place-items: center; min-height: 44px; padding: 4px 5px; border-radius: 9px; font-size: 13px; text-align: center; overflow-wrap: anywhere; }
.result-comparison input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.result-panel:has(#phrase-review[open]) .result-stage {
  position: sticky; top: max(5px, env(safe-area-inset-top)); z-index: 3;
  border-radius: 10px; background: #0d0d0c;
}
.result-panel:has(#phrase-review[open]) .result-stage:not([data-expanded]) video { max-height: min(28vh, 220px); }
.result-panel:has(#phrase-review[open]) .result-stage[data-expanded] { position: static; }
.result-stage[data-expanded] video { max-height: 68dvh; }
#expand-review-preview { justify-self: start; }
#expand-review-preview[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
@media (max-height: 480px) {
  .result-panel:has(#phrase-review[open]) .result-stage { position: static; }
}
.result-panel:has(#phrase-review[open]) .result-stage[data-review-keyboard] { position: static; }
.account { display: flex; gap: 9px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 2px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.message { margin-top: 10px; color: #ffc3b1; }
.example-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.example-heading h2 { margin-top: 3px; font-size: clamp(25px, 3.1vw, 39px); letter-spacing: -.042em; line-height: 1.12; }
.example-card { padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; }
.example-controls { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px; margin-bottom: 11px; }
.example-types, .comparison { gap: 3px; align-items: center; }
.example-controls label span { display: flex; gap: 4px; justify-content: center; align-items: center; min-height: 44px; min-width: 44px; border-radius: 9px; padding: 5px 8px; font-weight: 700; color: var(--muted); font-size: 13px; }
.comparison label span { flex-direction: column; gap: 0; line-height: 1.2; }
.comparison small { font-size: .85em; font-variant-numeric: tabular-nums; }
.example-types svg { width: 15px; height: 15px; }
@container (max-width: 220px) {
  .dropzone .icon-box, .dropzone .upload-arrow { display: none; }
  .consent > .hint { margin-left: 0; }
  .consent, .primary { overflow-wrap: anywhere; }
  .example-controls fieldset { flex-wrap: wrap; }
  .example-controls label span { min-width: 0; overflow-wrap: anywhere; }
}
.example-types input:checked + span { color: var(--accent); background: #3b3222; }
.comparison { border: 1px solid var(--line); border-radius: 11px; padding: 0 2px; }
.comparison input:checked + span { background: var(--accent); color: var(--accent-ink); }
.example-stage { position: relative; display: grid; place-items: center; overflow: hidden; border-radius: 13px; background: radial-gradient(ellipse at center, #363531, #262521 67%); }
.example-stage video { width: 100%; max-width: 270px; max-height: 51vh; min-height: 250px; aspect-ratio: 9 / 16; display: block; object-fit: contain; background: #10100e; }
.demo-badge { pointer-events: none; position: absolute; z-index: 1; top: 12px; left: max(12px, calc((100% - 270px) / 2 + 12px)); padding: 4px 9px; border-radius: 100px; background: #171612e8; color: white; font-size: 11px; font-weight: 720; }
.example-copy { padding: 12px 4px 3px; }
.example-copy h3 { margin-bottom: 2px; font-size: 17px; letter-spacing: -.025em; }
.example-copy p { color: var(--muted); font-size: 13px; }
.example-journey { align-items: center; margin-top: 8px; }
.example-note { display: flex; gap: 0 12px; justify-content: space-between; flex-wrap: wrap; margin-top: 9px; }
.return-link { color: var(--text); font-weight: 650; }
.example-note a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 2px; }
@media (max-width: 720px) {
  .shell { padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); max-width: 525px; }
  .top { min-height: 58px; gap: 4px 8px; flex-wrap: wrap; }
  .top nav { gap: 8px 12px; flex-wrap: wrap; }
  .top nav a { font-size: 13px; }
  .brand { font-size: 26px; }
  .brand-mark { margin-right: 6px; width: 29px; height: 29px; }
  .brand-mark svg { width: 21px; height: 21px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 20px 0 26px; }
  h1 { font-size: clamp(34px, 9vw, 50px); overflow-wrap: anywhere; }
  .lead { margin: 11px 0 16px; font-size: 14px; }
  .studio:has(#signed-in:not([hidden])) > .lead { display: none; }
  .studio:has(#signed-in:not([hidden])) > .workspace { margin-top: 12px; }
  .example-stage video { max-height: min(62vh, 430px); }
  .source-tools { display: grid; grid-template-columns: minmax(0, 1fr); }
  .source-tools .secondary { text-align: left; }
  .source-tools .text-action { justify-self: start; }
  .file-extras .brand-content > .job-actions, .result-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .file-extras .job-actions > *, .result-actions > * { min-width: 0; overflow-wrap: anywhere; }
  .file-extras .job-actions a { justify-content: center; text-align: center; }
  #share-video, #review-share-video { justify-self: stretch; }
  .control :is(input:not([type="file"]), textarea) { font-size: 16px; }
}
@media (max-width: 359px) {
  .top nav { gap: 8px; }
  .top nav svg { display: none; }
  .top .pilot { font-size: 10px; padding-inline: 7px; }
  h1 { font-size: clamp(29px, 9.7vw, 34px); }
  .layout { padding-top: 12px; }
  .lead { margin: 9px 0 12px; font-size: 13px; }
  #signed-in { padding: 14px; }
  .dropzone { min-height: 65px; padding: 8px; }
  .mode-step { margin-top: 13px; }
  .consent { margin-bottom: 8px; }
  .mode-tile { grid-template-columns: minmax(0, 1fr); }
  .mode-tile strong { font-size: 13px; }
  .mode-tile svg { display: none; }
  #create-video > svg { display: none; }
  #create-video { font-size: 14px; }
  .example-heading { flex-wrap: wrap; }
  .example-controls label span { padding-inline: 5px; }
  .control-grid { grid-template-columns: 1fr; }
}
@container (max-width: 190px) {
  .mode-choices, .example-controls { flex-direction: column; align-items: stretch; }
}
@media (forced-colors: active) {
  .switch input { appearance: auto; width: 22px; height: 22px; }
  .switch input::after { display: none; }
  .mode-choices input:checked + span, .example-controls input:checked + span { outline: 2px solid Highlight; outline-offset: -2px; }
}

.auto-options { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-raised); }
.auto-settings { display: grid; gap: 8px; margin-top: 10px; }
.series-tools { grid-column: 1 / -1; display: grid; gap: 6px; }
.series-tools > button { justify-self: start; }
.series-picker { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 8px; }
.series-picker > p { grid-column: 1 / -1; padding-top: 3px; overflow-wrap: anywhere; }
#series-status:empty { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
#series-manage-status:empty { display: none; }
.auto-settings > details, #brand-options { margin-top: 0; min-width: 0; }
.auto-settings > details > summary > span { min-width: 0; }
.auto-options > summary { min-height: 44px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 6px; list-style: none; font-size: 14px; font-weight: 700; cursor: pointer; }
.auto-options > summary::-webkit-details-marker { display: none; }
.auto-options > summary svg { flex: none; width: 15px; height: 15px; color: var(--accent); }
.auto-options[open] > summary svg { transform: rotate(180deg); }
.auto-content { padding: 0 12px 12px; display: grid; gap: 8px; }
.caption-style-quick { display: grid; gap: 6px; }
.caption-style-quick .brand-actions { align-items: stretch; }
.caption-style-quick .brand-actions button { flex: 1 1 140px; }
.setting-example { display: grid; min-width: 0; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); overflow-wrap: anywhere; }
.cut-example-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; }
.cut-example-strip span { display: grid; place-items: center; padding: 3px 2px; border-radius: 4px; background: #403521; color: var(--text); text-align: center; font-size: 11px; }
.cut-example-strip .cut-example-pause { background: var(--surface-raised); color: var(--muted); }
.cut-example-strip[data-cut="light"] { grid-template-columns: minmax(0, 1fr) minmax(0, .65fr) repeat(2, minmax(0, 1fr)); }
.cut-example-video { width: 100%; max-height: min(42vh, 300px); border-radius: 6px; background: #0d0d0c; }
.setting-frame-example { grid-template-columns: minmax(0, 104px) minmax(0, 1fr); align-items: center; gap: 9px; }
.setting-frame-example .secondary { margin-top: 6px; padding-inline: 7px; }
.setting-frame { position: relative; width: 100%; aspect-ratio: 9 / 16; overflow: hidden; border-radius: 6px; background: var(--surface) url('./examples/caption-before.jpg') center / cover; }
.setting-frame .preset-hook { inset: 10% 4px auto; padding: 3px; font-size: 11px; line-height: 1.2; }
.setting-frame .preset-logo { max-height: 12%; }
.setting-frame .preset-photo { border-width: 1px; }
#insert-setting-frame img { position: absolute; top: 23%; left: 8%; width: 35%; max-height: 28%; object-fit: cover; border: 1px solid white; border-radius: 3px; }
.insert-setting-label, #insert-setting-emoji { position: absolute; padding: 2px 4px; background: var(--bg); border-radius: 4px; font-size: 10px; }
.insert-setting-label { top: 53%; left: 8%; }
#insert-setting-emoji { bottom: 18%; right: 8%; }
#insert-setting-frame:not([data-images="auto"]) img { display: none; }
#insert-setting-symbol {
  position: absolute; inset: 25% auto auto 10%; padding: 2px 5px;
  border-radius: 4px; background: var(--bg); color: var(--accent);
}
#editorial-camera-frame img { width: 100%; height: 100%; object-fit: cover; }
#editorial-camera-frame[data-close] img { transform: scale(1.16); transform-origin: 52% 36%; }
@media (prefers-reduced-motion: no-preference) {
  #editorial-camera-frame img { transition: transform 420ms ease-out; }
}
.preset-preview[data-captions-off] .preset-sample,
.setting-frame[data-captions-off] .preset-sample { visibility: hidden; }
#caption-presets { flex-wrap: wrap; }
#caption-presets legend { margin-bottom: 4px; font-size: 13px; color: var(--muted); }
#caption-presets label span { display: grid; place-items: center; min-height: 44px; padding: 5px 8px; border: 1px solid var(--control-line); border-radius: 8px; font-size: 13px; }
#caption-presets input:checked + span { border-color: var(--accent); color: var(--accent); background: #373021; }
#caption-presets input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.preset-preview { display: grid; gap: 8px; justify-items: center; }
.preset-frame { position: relative; width: min(100%, 216px); aspect-ratio: 9 / 16; overflow: hidden; border-radius: 9px; background: #151514; }
.saved-look .preset-preview { padding: 0 10px 10px; }
.saved-look .preset-frame { width: min(100%, 160px); }
.saved-look .preset-sample { font-size: calc(14px * var(--caption-preview-scale, 1)); }
.preset-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.preset-preview[data-source="source"] .preset-frame { width: min(100%, 216px, 28svh); }
.preset-preview[data-layers="off"] .preset-frame > :is(img, .preset-hook, .preset-sample) { visibility: hidden; }
.preset-safe-frame {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  inset: 10% 18% 23% 8%;
  border: 2px dashed #fff;
  box-shadow: 0 0 0 1000px #0006, inset 0 0 0 1px #161616;
}
.preset-preview[data-guides="feed"] .preset-safe-frame {
  /* A centered 4:5 crop keeps 70.3125% of a 9:16 frame's height. */
  inset: 14.84375% 0;
}
#play-preset { position: absolute; z-index: 3; bottom: 8px; right: 8px; min-width: 44px; background: #171612; color: white; }
.preset-actions { justify-content: center; }
.preset-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: .88; }
.preset-preview[data-source="source"] video { opacity: 1; }
.preset-preview[data-source="source"][data-cut="smart"] video { object-fit: cover; }
#preset-time { accent-color: var(--accent); }
.preset-time-control { display: grid; gap: 5px; }
.preset-sample { position: absolute; top: var(--caption-preview-anchor, 70.3125%); left: 50%; transform: translate(-50%, -50%); width: max-content; max-width: calc(100% - 16px); padding: 2px 8px; color: var(--caption-primary, #fff); font-size: calc(clamp(15px, 4vw, 19px) * var(--caption-preview-scale, 1)); font-weight: 750; line-height: 1.14; text-shadow: 0 1px 3px #151514; text-align: center; }
.preset-sample [data-caption-word] { display: inline-block; letter-spacing: var(--caption-preview-tracking, normal); }
.preset-sample b { color: var(--caption-accent, #ff5ca8); font-weight: inherit; }
.preset-preview[data-caption-size="small"] { --caption-preview-scale: .88; }
.preset-preview[data-caption-size="large"] { --caption-preview-scale: 1.12; }
.preset-preview[data-caption-position="top"] { --caption-preview-anchor: 22.65625%; }
.preset-preview[data-caption-position="bottom"] { --caption-preview-anchor: 73.046875%; }
.preset-preview[data-caption-tracking="tight"] { --caption-preview-tracking: -.018em; }
.preset-preview[data-caption-tracking="wide"] { --caption-preview-tracking: .025em; }
.preset-preview[data-caption-spacing="tight"] { --caption-preview-gap: .06em; }
.preset-preview[data-caption-spacing="open"] { --caption-preview-gap: .42em; }
.preset-preview[data-preset="accent"] .preset-sample,
#screen-captions #preset-preview .preset-sample { display: grid; row-gap: var(--caption-preview-gap, .2em); }
.preset-preview[data-preset="clean"] .preset-sample { background: #181716df; border-radius: 7px; }
.preset-preview[data-preset="clean"] .preset-sample b { color: inherit; }
.preset-preview[data-preset="accent"] .preset-sample b { font-size: 1.55em; font-weight: 900; color: var(--caption-accent, #ffd36b); }
.preset-preview[data-step="0"] .preset-sample,
.preset-preview:not([data-preset="clean"])[data-step="1"] [data-caption-word="second"],
.preset-preview:not([data-preset="clean"]):is([data-step="1"], [data-step="2"]) [data-caption-word="accent"] { visibility: hidden; }
@media (prefers-reduced-motion: no-preference) {
  #preset-preview[data-playing]:not([data-preset="clean"], [data-step="0"]) [data-caption-word="first"],
  #preset-preview[data-playing]:not([data-preset="clean"]):is([data-step="2"], [data-step="3"]) [data-caption-word="second"],
  #preset-preview[data-playing]:not([data-preset="clean"])[data-step="3"] [data-caption-word="accent"] {
    animation: caption-word-in 140ms cubic-bezier(.22, .68, .35, 1) both;
  }
}
@keyframes caption-word-in {
  from { opacity: 0; transform: translateY(.10em); }
  to { opacity: 1; transform: translateY(0); }
}
.job-actions:not(:has(:is(button,a):not([hidden]))) { display: none; }
.job-actions a { display: inline-flex; align-items: center; text-decoration: none; }

@font-face { font-family: 'fedit Montserrat'; src: url('./fonts/Montserrat-variable.ttf') format('truetype'); font-style: normal; font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'fedit Inter'; src: url('./fonts/Inter-variable.ttf') format('truetype'); font-style: normal; font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'fedit Rubik'; src: url('./fonts/Rubik-variable.ttf') format('truetype'); font-style: normal; font-weight: 300 900; font-display: swap; }
@font-face { font-family: 'fedit Manrope'; src: url('./fonts/Manrope-variable.ttf') format('truetype'); font-style: normal; font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'fedit Onest'; src: url('./fonts/Onest-variable.ttf') format('truetype'); font-style: normal; font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'fedit Unbounded'; src: url('./fonts/Unbounded-variable.ttf') format('truetype'); font-style: normal; font-weight: 200 900; font-display: swap; }
.preset-preview { font-family: 'fedit Montserrat', system-ui, sans-serif; }
.preset-preview[data-font="inter"] { font-family: 'fedit Inter', system-ui, sans-serif; }
.preset-preview[data-font="rubik"] { font-family: 'fedit Rubik', system-ui, sans-serif; }
.preset-preview[data-font="manrope"] { font-family: 'fedit Manrope', system-ui, sans-serif; }
.preset-preview[data-font="onest"] { font-family: 'fedit Onest', system-ui, sans-serif; }
.preset-preview[data-font="unbounded"] { font-family: 'fedit Unbounded', system-ui, sans-serif; }
.preset-preview[data-accent-font="montserrat"] { --caption-accent-font: 'fedit Montserrat', system-ui, sans-serif; }
.preset-preview[data-accent-font="inter"] { --caption-accent-font: 'fedit Inter', system-ui, sans-serif; }
.preset-preview[data-accent-font="rubik"] { --caption-accent-font: 'fedit Rubik', system-ui, sans-serif; }
.preset-preview[data-accent-font="manrope"] { --caption-accent-font: 'fedit Manrope', system-ui, sans-serif; }
.preset-preview[data-accent-font="onest"] { --caption-accent-font: 'fedit Onest', system-ui, sans-serif; }
.preset-preview[data-accent-font="unbounded"] { --caption-accent-font: 'fedit Unbounded', system-ui, sans-serif; }
.preset-preview:not([data-preset="clean"]) .preset-sample b,
.preset-preview .preset-hook { font-family: var(--caption-accent-font, inherit); }
.preset-hook { position: absolute; z-index: 1; inset: 10% 8px auto; text-align: center; padding: 5px 8px; border-radius: 7px; background: #171612df; color: var(--hook-accent, #ff9aca); font-size: 14px; font-weight: 850; overflow-wrap: anywhere; }
.auto-inserts { display: grid; gap: 5px; }
#opening-hook-hint:empty { display: none; }

.preset-preview[data-effect="shadow"] .preset-sample { background: transparent; text-shadow: 0 .09em .24em #080808; }
.preset-preview[data-effect="outline"] .preset-sample { background: transparent; -webkit-text-stroke: .05em #100e12; paint-order: stroke fill; text-shadow: none; }
.preset-preview[data-effect="box"] .preset-sample { background: #100e17e8; border-radius: 7px; }
.preset-preview[data-effect="glass"] .preset-sample { background: var(--caption-background, #100e179e); border: 1px solid #ffffff6b; border-radius: 7px; }
.preset-preview[data-effect="contrast"] .preset-sample { background: transparent; -webkit-text-stroke: .05em #100e12; paint-order: stroke fill; text-shadow: 0 .09em .24em #080808; }
.preset-preview[data-effect="paper"] .preset-sample { background: #fffaf0; color: var(--caption-primary, #17141b); border-radius: 7px; text-shadow: none; }
.preset-preview[data-effect="paper"]:not([data-preset="clean"]) .preset-sample b { color: var(--caption-ink, #853656); }
.preset-preview[data-palette="amber"] { --caption-accent: #ffd36b; --caption-ink: #774600; --hook-accent: #ffd36b; }
.preset-preview[data-palette="mint"] { --caption-accent: #8af0c2; --caption-ink: #096248; --hook-accent: #8af0c2; }
.preset-preview[data-palette="blue"] { --caption-accent: #9bd8ff; --caption-ink: #215589; --hook-accent: #9bd8ff; }
.preset-preview[data-custom-backing] .preset-sample { background: var(--caption-background); border-radius: 7px; }
.color-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: end; gap: 8px; }
.color-row .control { min-width: 0; }
.color-picker { width: 44px; height: 44px; padding: 5px; cursor: pointer; border: 1px solid var(--control-line); border-radius: 8px; background: var(--surface); }
.caption-palettes { display: flex; flex-wrap: wrap; gap: 6px; }
.caption-palettes button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.caption-palettes i { display: block; width: 19px; height: 15px; border-radius: 5px; border: 1px solid var(--control-line); background: var(--palette-swatch); }
.app-appearance { margin-block: 12px; }
.preset-logo, .preset-photo { position: absolute; pointer-events: none; object-fit: contain; }
.preset-logo { z-index: 2; top: 4.2%; right: 5%; max-width: 18%; max-height: 6%; }
.preset-photo { top: 22.8%; left: 5%; max-width: 32%; max-height: 18%; border: 2px solid white; border-radius: 4px; opacity: var(--brand-photo-alpha, 1); transform: translateX(var(--brand-photo-shift, 0)); }
.preset-preview[data-logo-opacity="soft"] .preset-logo { opacity: .72; }
.preset-preview[data-logo-opacity="watermark"] .preset-logo { opacity: .45; }
@media (prefers-reduced-motion: reduce) {
  #brand-photo-example-play { display: none; }
  .preset-photo { transform: none; }
}
.preset-preview[data-photo-active="false"] .preset-photo,
.preset-preview[data-hook-active="false"] #preset-hook { visibility: hidden; }
.preset-preview[data-logo-corner="left"] .preset-logo { left: 5%; right: auto; }
.preset-preview[data-logo-corner="left"] .preset-photo { right: 5%; left: auto; }
.preset-preview[data-cut="captions"] :is(.preset-logo, .preset-photo) { visibility: hidden; }
.brand-panel { margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; }
.brand-panel summary { min-height: 44px; padding: 10px; cursor: pointer; font-size: 14px; font-weight: 700; }
#phrase-review > summary { scroll-margin-top: calc(min(28vh, 220px) + 15px); }
#brand-options { border-radius: 12px; }
.summary-note { display: block; margin-top: 2px; color: var(--accent); font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-content { display: grid; gap: 9px; padding: 0 10px 10px; }
.brand-content, .brand-content > *, .brand-actions > * { min-width: 0; }
.brand-actions > :is(button, a, label) { max-width: 100%; overflow-wrap: anywhere; }
.brand-picker-group, .brand-asset-settings { display: grid; gap: 6px; }
.brand-active { display: grid; gap: 4px; padding: 8px 10px; border-radius: 8px; background: var(--bg); overflow-wrap: anywhere; }
.brand-active > span { font-size: 12px; color: var(--muted); }
.brand-active > strong { font-size: 14px; }
.brand-active .brand-actions:not(:has(button:not([hidden]))) { display: none; }
.brand-asset { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
.brand-picker { position: relative; cursor: pointer; }
.brand-picker input[type="file"] { position: absolute; inset: 0; opacity: 0; height: 100%; cursor: pointer; }
.brand-picker:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.brand-pick-label { display: flex; align-items: center; min-height: 44px; padding: 7px 9px; color: var(--text); border: 1px dashed var(--control-line); border-radius: 7px; }
.brand-actions, .brand-selected { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.brand-selected { justify-content: space-between; font-size: 12px; color: var(--muted); }
.brand-selected img { width: 42px; height: 42px; object-fit: contain; border-radius: 6px; background: var(--bg); }
.brand-preset-thumbnails { display: flex; flex-wrap: wrap; gap: 8px; }
.brand-preset-thumbnails:not(:has(img:not([hidden]))) { display: none; }
.brand-preset-thumbnails img { width: 52px; height: 52px; object-fit: contain; border-radius: 6px; background: var(--surface); }
.brand-actions a { display: inline-flex; align-items: center; text-decoration: none; }
.brand-actions .brand-picker { display: inline-flex; align-items: center; overflow: hidden; }
.brand-actions .brand-picker input { width: 100%; }
#brand-status:empty, #brand-save-status:empty, .brand-asset-message:empty { display: none; }
#brand-save[aria-disabled="true"] { opacity: .7; cursor: wait; }
#series-caption-save:disabled { opacity: .62; cursor: default; }

.recent-results { margin-bottom: 12px; }
.recent-help { padding: 0 10px 8px; }
.recent-list { list-style: none; margin: 0; padding: 0 10px 8px; display: grid; gap: 6px; }
.recent-list :is(button, .recent-draft) { display: grid; text-align: left; width: 100%; overflow-wrap: anywhere; }
.recent-list button:has(.recent-cover:not([hidden])) { grid-template-columns: 60px minmax(0, 1fr); gap: 2px 8px; }
.recent-cover { grid-column: 1; grid-row: 1 / span 5; width: 60px; aspect-ratio: 9 / 16; border-radius: 4px; object-fit: cover; }
.recent-list button:has(.recent-cover:not([hidden])) > :not(.recent-cover) { grid-column: 2; }
.recent-expired { display: grid; gap: 2px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; overflow-wrap: anywhere; }
.recent-list button[aria-current="true"] { border-color: var(--accent); }
.recent-action { color: var(--accent); font-size: 13px; }
.recent-list button[aria-disabled="true"] { cursor: progress; }
.caption-archive-row { display: grid; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.caption-archive-row .job-actions button { width: auto; display: inline-flex; align-items: center; }
#recent-status:not(:empty) { padding: 0 10px 8px; }

/* Studio 203: a compact app shell, with one task per screen. */
.app-layout { scroll-padding-bottom: 100px; }
@media (pointer: fine) {
  .app-layout { scrollbar-gutter: stable; }
}
.app-layout .shell { max-width: 720px; padding-inline: max(20px, env(safe-area-inset-left)); }
.app-layout .layout { display: block; padding: 28px 0 calc(110px + env(safe-area-inset-bottom)); }
.app-layout .top { min-height: 68px; }
.app-layout .top nav { display: none; }
.app-layout h1 { font-size: clamp(28px, 5vw, 38px); line-height: 1.15; letter-spacing: -.035em; margin-bottom: 20px; }
.app-layout #signed-in { padding: 0; border: 0; background: none; border-radius: 0; }
.app-layout .app-panel { min-width: 0; }
.app-layout .screen-intro { color: var(--muted); margin: 0 0 20px; max-width: 48ch; }
.app-layout .app-steps { display: flex; gap: 6px; padding: 4px; margin: 0 0 24px; background: var(--surface); border-radius: 14px; }
.app-layout .app-steps button { flex: 1; border: 0; min-height: 44px; border-radius: 10px; color: var(--muted); background: transparent; font-size: 14px; font-weight: 680; }
.app-layout .app-steps button[aria-current] { background: var(--surface-raised); color: var(--text); box-shadow: 0 1px 4px #0003; }
.app-layout .dropzone { min-height: 186px; flex-direction: column; justify-content: center; text-align: center; background: var(--surface); padding: 24px 16px; border-radius: 22px; }
.app-layout .dropzone .icon-box { width: 54px; height: 54px; border-radius: 17px; }
.app-layout .upload-copy { flex: none; gap: 4px; }
.app-layout .upload-copy strong { font-size: 20px; }
.app-layout .upload-copy span { font-size: 13px; }
.app-layout .upload-arrow { display: none; }
.app-layout .step-next { margin-top: 20px; }
.app-layout .source-tools { padding-top: 8px; }
.app-layout .source-launch { margin-top: 16px; }
.app-layout .app-current { width: 100%; margin-bottom: 18px; }
.app-layout .app-back { margin: 0 0 18px; padding: 0; background: transparent; border: 0; min-height: 44px; }
.app-layout .auto-settings { margin-top: 22px; }
.app-layout .auto-options { background: var(--surface); border-radius: 18px; }
.app-layout .auto-content { padding: 16px; }
.app-layout .auto-options > summary { padding: 18px 16px; }
.app-layout .control { gap: 8px; }
.app-layout .control select, .app-layout .control input:not([type="checkbox"]):not([type="range"]) { min-height: 46px; font-size: 16px; }
.app-layout .preset-preview { max-width: 100%; }
.app-layout #preset-preview .preset-frame { max-height: 330px; margin-inline: auto; }
.app-layout .app-empty { display: grid; gap: 14px; padding: 28px 20px; border: 1px dashed var(--control-line); border-radius: 20px; background: var(--surface); }
.app-layout .app-empty h2 { font-size: 21px; }
.app-layout .app-empty .primary { margin-top: 10px; }
.app-layout #screen-profile .account { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 16px; font-size: 15px; margin-bottom: 16px; }
.app-layout .app-nav { position: fixed; z-index: 12; bottom: 0; left: 50%; transform: translateX(-50%); width: min(720px, 100%); display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 4px; padding: 6px max(12px, env(safe-area-inset-right), env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.app-layout .app-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 55px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; }
.app-layout .app-nav button[aria-current] { color: var(--accent); background: var(--accent-wash); }
.app-layout .app-nav button:disabled { cursor: default; opacity: .45; }
.app-layout .app-nav svg { width: 23px; height: 23px; }
.app-layout #app-tab-source { color: var(--text); font-weight: 760; }
.app-layout #app-tab-source svg { width: 42px; height: 30px; padding: 5px 11px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); }
.app-layout .setting-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.app-layout .help-button { flex: none; min-width: 44px; min-height: 44px; padding: 4px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 50%; font-weight: 700; }
/* The native dialog keeps everything behind the highlighted control inert. */
.setting-help {
  position: fixed; inset: 0; width: 100%; height: 100%;
  max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; overflow: hidden;
  background: #000a; color: var(--text);
}
.setting-help[data-spotlight] { background: transparent; }
.setting-help::backdrop { background: transparent; }
.setting-spotlight {
  position: fixed; pointer-events: none;
  border: 2px solid var(--focus); border-radius: 12px;
  box-shadow: 0 0 0 200vmax #000b;
}
.setting-help-card {
  position: absolute; z-index: 1; inset-inline: 0; bottom: 0;
  width: min(520px, 100%); max-height: 65%; overflow-y: auto; overscroll-behavior: contain;
  margin-inline: auto; padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  border: 1px solid var(--line); border-radius: 18px 18px 0 0; background: var(--surface);
}
.setting-help[data-card-top] .setting-help-card {
  top: 0; bottom: auto; padding: calc(18px + env(safe-area-inset-top)) 20px 20px; border-radius: 0 0 18px 18px;
}
.setting-help h2 { font-size: 22px; margin-bottom: 8px; }
.setting-help p { color: var(--muted); font-size: 16px; line-height: 1.5; margin-bottom: 16px; }
.setting-help .setting-help-step { font-size: 13px; margin-bottom: 4px; }
.setting-help-actions { display: flex; gap: 8px; align-items: center; }
.setting-help-actions .secondary { min-height: 44px; }
:is(#dropzone, #app-launch, .cut-choices button, .look-choices button, .editor-settings-row) {
  -webkit-touch-callout: none;
  user-select: none;
}
@media (max-width: 380px) {
  .app-layout .shell { padding-inline: max(12px, env(safe-area-inset-left)); }
  .app-layout .auto-content { padding: 12px; }
}
@media (max-height: 480px) {
  .app-layout .app-nav { padding-top: 3px; padding-bottom: max(3px, env(safe-area-inset-bottom)); }
  .app-layout .app-nav button { min-height: 44px; flex-direction: row; gap: 5px; padding-inline: 3px; }
  .app-layout .app-nav svg { width: 17px; height: 17px; }
  .app-layout #app-tab-source svg { width: 32px; height: 28px; padding: 5px 7px; }
}
.app-layout .app-activity { display: grid; gap: 8px; padding: 12px 16px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 14px; }
.app-layout .app-activity progress { width: 100%; accent-color: var(--accent); }
.app-layout .app-activity #editor-status:empty { display: none; }
.app-layout .app-back + .mode-step { margin-top: 8px; }

/* Studio 204: one route, compact choices, detailed controls on demand. */
.unified-flow .mode-step, .unified-flow #mode-choices, .unified-flow #mode-fallback,
.unified-flow #editorial-help, .unified-flow .app-back,
.unified-flow #screen-source > .form-step, .unified-flow #screen-source > .source-tools,
.unified-flow #source-launch, .unified-flow #settings-launch-nav,
.unified-flow #auto-options > summary,
.unified-flow #caption-look-help, .unified-flow #preset-help,
.unified-flow #cut-example-description { display: none !important; }
.unified-flow .screen-intro { font-size: 14px; margin-bottom: 16px; }
.unified-flow .app-steps { margin-bottom: 18px; }
.unified-flow .dropzone { min-height: 140px; padding: 18px 14px; }
.unified-flow .dropzone .icon-box { width: 42px; height: 42px; }
.unified-flow .auto-settings { margin-top: 0; gap: 12px; }
.unified-flow .auto-content { gap: 12px; }
.unified-flow .help-button { min-width: 36px; min-height: 36px; width: 36px; height: 36px; font-size: 14px; }
.unified-flow .cut-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; padding: 3px; border-radius: 12px; background: var(--bg); }
.unified-flow .cut-choices button { min-height: 44px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; padding: 6px 4px; font-size: 12px; font-weight: 650; }
.unified-flow .cut-choices button[aria-checked="true"] { color: var(--accent-ink); background: var(--accent); }
.unified-flow .look-choices { display: flex; gap: 8px; overflow-x: auto; padding: 4px 3px 8px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.unified-flow .look-choices button { flex: 0 0 auto; min-height: 44px; min-width: 72px; padding: 6px 10px; border: 1px solid transparent; border-radius: 6px; color: var(--muted); background: transparent; scroll-snap-align: start; font-size: 13px; }
.unified-flow .look-choices button[aria-checked="true"] { border-color: var(--line); color: var(--text); background: var(--surface); font-weight: 700; }
.unified-flow #preset-preview { margin-top: 0; }
.unified-flow .series-tools { margin-top: 4px; }
.unified-flow .setting-frame-example { grid-template-columns: 72px minmax(0, 1fr); }
.unified-flow .setting-frame { width: 72px; }
.unified-flow .setting-frame-example .secondary { font-size: 12px; padding: 6px 8px; }
.unified-flow #caption-example-link { display: none; }
.unified-flow .preview-notice { text-align: center; font-size: 12px; }

.unified-flow #screen-settings .series-tools:not(:has(> :not([hidden]):not(:empty))) { display: none; }
.unified-flow #screen-settings .series-tools:has(#series-picker:not([hidden])) { display: grid; }
.unified-flow #result-repeat, .unified-flow #restore-result-settings,
.unified-flow #repeat-from-settings { display: none !important; }
.unified-flow #screen-profile > #series-open-settings { display: block; margin-top: 12px; }
.unified-flow .look-choices button:focus-visible { outline-offset: -3px; }
.unified-flow .help-button { min-width: 44px; min-height: 44px; }
.unified-flow .consent-title { margin: 0 0 8px; font-size: 16px; }
.unified-flow #editorial-inserts-note button { background: none; border: 0; padding: 2px 0; min-height: 32px; }
.unified-flow #app-launch { margin-top: 12px; }

@media (min-height: 500px) {
  .unified-flow:has(#app-next:not([hidden]))[data-app-screen="source"],
  .unified-flow[data-app-screen="settings"]:has(#signed-in:not([hidden])) {
    scroll-padding-bottom: calc(var(--app-nav-height, 71px) + 70px);
  }
  .unified-flow[data-app-screen="source"]:has(#app-next:not([hidden])) .layout,
  .unified-flow[data-app-screen="settings"]:has(#signed-in:not([hidden])) .layout {
    padding-bottom: calc(var(--app-nav-height, 71px) + 86px);
  }
  .unified-flow #app-next, .unified-flow #app-launch {
    position: fixed; bottom: calc(var(--app-nav-height, 71px) + 8px); left: 50%;
    transform: translateX(-50%); z-index: 11;
    width: min(680px, calc(100% - 32px)); margin: 0;
    box-shadow: 0 0 0 6px var(--bg);
  }
}
@media (max-width: 480px) {
  .unified-flow .layout { padding-top: 18px; }
}
.unified-flow #settings-back-to-result[hidden] + #result-change-cut { display: none; }
.unified-flow:not([data-app-source-ready]) #launch-controls:not(:has(#consent-back-to-upload:not([hidden]), #consent-error:not(:empty))) { display: none; }
.unified-flow:not([data-preview]) #launch-controls .submit-row { display: none; }
@media (max-width: 480px) and (min-height: 500px) {
  .unified-flow[data-app-screen="settings"]:has(#signed-in:not([hidden])) .top { display: none; }
}
@media (max-width: 360px) and (min-height: 500px) and (max-height: 660px) {
  .unified-flow .look-choices { gap: 6px; padding-block: 3px 5px; }
  .unified-flow .app-steps { margin-bottom: 12px; }
}

.unified-flow .look-featured button { flex: 1 1 0; min-width: 0; }
.unified-flow .look-choices button { white-space: nowrap; }
.unified-flow .look-header-actions .look-more { min-width: 77px; white-space: nowrap; }
.unified-flow .look-more { justify-self: start; min-height: 40px; font-size: 13px; }
.unified-flow .result-legacy-files { display: none; }
.unified-flow .result-primary-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.unified-flow .result-primary-actions > * { flex: 1 1 120px; min-width: 0; min-height: 44px; text-align: center; justify-content: center; }
.unified-flow #result-files:not([open]) { display: none; }
.unified-flow #result-files > .result-downloads { padding: 12px; }
.unified-flow .review-phrase-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.unified-flow .review-phrase-tools button { min-height: 38px; padding: 6px 10px; }
.unified-flow .look-header-actions { display: flex; align-items: center; gap: 6px; }
.unified-flow .look-header-actions .look-more { padding-inline: 8px; }

/* The editor is a focused workspace with its own back and launch controls. */
.unified-flow {
  --bg: #131514; --surface: #1c201e; --surface-raised: #272d29;
  --line: #39433d; --muted: #b6c1b9; --text: #f6f7f3;
}
.unified-flow body { background: var(--bg); }
.unified-flow .top { min-height: 62px; border-bottom: 0; }
.unified-flow .top .brand { font-size: 26px; }
.unified-flow .layout { padding-top: 22px; }
.unified-flow .source-example {
  display: flex; align-items: center; gap: 14px; width: 100%;
  margin-top: 24px; padding: 10px 14px 10px 10px;
  border: 1px solid var(--line); border-radius: 16px;
  color: var(--text); background: var(--surface); text-align: left;
}
.unified-flow .source-example img { width: 48px; height: 60px; object-fit: cover; border-radius: 8px; }
.unified-flow .source-example small { display: block; margin-top: 2px; color: var(--muted); }
.unified-flow .source-example-arrow { margin-left: auto; color: var(--muted); }
.unified-flow .dropzone { min-height: 170px; background: var(--surface-raised); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border: 1px solid var(--control-line); }
.unified-flow .dropzone:hover { background: var(--surface-raised); }
.unified-flow .dropzone .icon-box { background: var(--accent); color: var(--accent-ink); }
.unified-flow[data-app-screen="source"] #app-next { position: static; width: 100%; transform: none; margin-top: 10px; box-shadow: none; }

.unified-flow:is([data-app-screen="settings"], [data-option-screen]):has(#signed-in:not([hidden])) :is(.top, .app-nav, #title) { display: none; }
.unified-flow:is([data-app-screen="settings"], [data-option-screen]):has(#signed-in:not([hidden])) .layout { padding-top: max(12px, env(safe-area-inset-top)); }
.unified-flow .editor-source {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding-bottom: 8px;
}
.unified-flow .editor-title { margin: 0 0 4px; font-size: 25px; font-weight: 760; line-height: 1.2; letter-spacing: -.035em; }
.unified-flow .editor-source .secondary { border-color: transparent; background: transparent; }
.unified-flow .editor-source .secondary:hover { background: var(--surface); }
.unified-flow .editor-source-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 680; font-size: 14px; }
.unified-flow .editor-source button { min-height: 44px; margin: 0; }
.unified-flow #editor-back { min-width: 44px; padding-inline: 9px; font-size: 20px; }
.unified-flow #editor-replace { padding-inline: 10px; font-size: 12px; }
.unified-flow #auto-settings { gap: 6px; }
.unified-flow #auto-options { margin-top: 0; border: 0; background: none; }
.unified-flow #auto-options > .auto-content { padding: 0; gap: 6px; }
.unified-flow #caption-look-choices { padding-inline: 2px; }
.unified-flow .look-swatch { height: 48px; }
.unified-flow .look-more { background: transparent; }
.unified-flow .editor-footer {
  background: var(--bg); display: grid; gap: 4px;
  padding-block: 8px max(8px, env(safe-area-inset-bottom));
}
.unified-flow .editor-footer-note { color: var(--muted); font-size: 12px; text-align: center; }
.unified-flow .editor-footer #app-launch { position: static; width: 100%; margin: 0; transform: none; box-shadow: none; }
.unified-flow:not([data-confirm-visible]) #launch-controls { display: none; }
.unified-flow .editor-consent-back { min-height: 44px; margin-top: 8px; }
.unified-flow #launch-controls { margin-top: 8px; }
.unified-flow #result-panel { border-radius: 16px; }
.unified-flow #result-stage { padding: 8px 0; }
@media (min-height: 500px) {
  .unified-flow .editor-footer {
    position: fixed; inset: auto 0 0; margin-inline: auto; z-index: 11;
    width: min(100%, 720px); padding-inline: max(16px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
  }
}
.unified-flow #preset-preview[data-source="source"] .preset-frame {
  background-image: var(--preview-still, none); background-position: center; background-repeat: no-repeat; background-size: contain;
}
.unified-flow #preset-preview[data-source="source"][data-cut="smart"] .preset-frame { background-size: cover; }
.unified-flow #preset-preview[data-source="source"][data-still="ready"]:not([data-playing]) video { opacity: 0; }

.unified-flow #preset-preview[data-source="source"]:not([data-still="ready"], [data-playing]) .preset-frame {
  background: #232b25 url('./examples/caption-before.jpg') center / cover;
}
.unified-flow #preset-preview[data-source="source"]:not([data-still="ready"], [data-playing]) video { opacity: 0; }

/* Keep scroll targets clear of the measured height of the active bottom bar. */
.unified-flow { scroll-padding-bottom: calc(var(--app-nav-height, 71px) + 12px); }
.unified-flow .editor-consent-back { display: none; margin: 0; }
.unified-flow[data-confirm-visible] .editor-consent-back { display: block; }
.unified-flow[data-confirm-visible] .editor-footer-note { display: none; }
@media (min-height: 500px) {
  .unified-flow[data-app-screen="settings"] { scroll-padding-bottom: calc(var(--editor-footer-height, 90px) + 12px); }
  .unified-flow[data-app-screen="settings"]:has(#signed-in:not([hidden])) .layout {
    padding-bottom: calc(var(--editor-footer-height, 90px) + 16px);
  }
  .unified-flow[data-confirm-visible] .editor-footer { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
}
.unified-flow #cut-settings .control,
.unified-flow .caption-style-control { gap: 2px; }
.unified-flow #cut-settings .control { position: relative; }
.unified-flow #cut-settings .setting-heading,
.unified-flow .caption-style-control .setting-heading { margin: 0; color: var(--text); font-size: 15px; }
.unified-flow #cut-video-example { border: 0; margin: 0; }
.unified-flow #cut-video-example > summary {
  position: absolute; inset: 0 50px auto auto; min-height: 44px;
  padding: 10px 6px; font-size: 13px; color: var(--muted);
}
.unified-flow #cut-video-example > .brand-content { padding: 0 0 8px; }
.unified-flow .editor-settings-list {
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.unified-flow .editor-settings-list > .editor-settings-row {
  display: flex; min-height: 48px; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 13px; list-style: none; font-size: 14px; font-weight: 540;
}
.unified-flow .editor-settings-row {
  width: 100%; border: 0;
  background: transparent; color: var(--text); text-align: start;
}
.unified-flow .editor-settings-row + .editor-settings-row { border-top: 1px solid var(--line); }
.unified-flow .editor-settings-row:first-child { border-radius: 12px 12px 0 0; }
.unified-flow .editor-settings-row:last-child { border-radius: 0 0 12px 12px; }
.unified-flow .editor-settings-row::after {
  content: ''; flex: none; width: 6px; height: 6px; margin-right: 3px;
  border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg);
}
.unified-flow .editor-settings-row:focus-visible { outline-offset: -3px; }
.unified-flow :is(#cut-settings, .caption-style-control) .help-button {
  border-color: transparent; background: transparent; color: var(--muted);
}
.unified-flow .look-header-actions .look-more { border-color: transparent; color: var(--muted); }
.unified-flow .cut-choices { border: 1px solid var(--line); }
.unified-flow .cut-choices button[aria-checked="true"] {
  color: var(--text); background: var(--surface-raised); box-shadow: inset 0 -2px var(--accent);
}
.unified-flow #caption-tuning > .brand-content { padding: 0; gap: 10px; }
.unified-flow .depth-example {
  position: relative; display: grid; place-items: center;
  min-height: 64px; isolation: isolate; border-radius: 8px; overflow: hidden;
  background: var(--surface-raised);
}
.unified-flow .depth-example-text { z-index: 2; color: var(--accent); font-weight: 800; }
.unified-flow .depth-example-person {
  position: absolute; z-index: 1; width: 28px; height: 54px; left: 62%; bottom: -7px;
  background: #657d70; border-radius: 40% 45% 24% 24%;
}
.unified-flow .depth-example[data-depth="behind"] .depth-example-person { z-index: 3; left: 56%; }
.unified-flow #cut-example-video { scroll-margin-block: 8px; }
.unified-flow #preset-preview {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(88px, 31%);
  align-items: stretch; gap: 8px; padding: 6px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
}
.unified-flow #preset-preview .preset-frame {
  width: 100%; height: 94px; aspect-ratio: auto; border-radius: 8px;
  background-size: cover; background-position: center 59%;
}
.unified-flow #preset-preview:not([data-source="source"]) .preset-frame {
  background-image: url('./examples/caption-before.jpg'); background-repeat: no-repeat;
}
.unified-flow #preset-preview:not([data-source="source"]) video {
  object-fit: cover; object-position: center 59%;
}
.unified-flow #preset-preview:not([data-source="source"], [data-video-ready]) video { opacity: 0; }
.unified-flow #preset-preview .preset-sample {
  top: clamp(25px, var(--caption-source-anchor, var(--caption-preview-anchor, var(--caption-default-anchor, 58%))), calc(100% - 25px));
  font-size: calc(13px * var(--caption-preview-scale, 1)); overflow-wrap: anywhere;
}
.unified-flow #preset-preview[data-source="source"][data-cut="captions"] .preset-sample {
  --caption-source-anchor: var(--source-caption-y, var(--caption-preview-anchor, var(--caption-default-anchor, 58%)));
}
.unified-flow #preset-preview[data-preset="accent"] .preset-sample b { font-size: 1.38em; }
.unified-flow #caption-tuning .caption-layout-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.unified-flow #preset-preview .preview-side {
  display: grid; align-content: center; justify-items: end; gap: 4px;
}
.unified-flow #preset-preview .preview-notice {
  margin: 0; text-align: end; font-size: 11px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.unified-flow #preset-preview .preview-play {
  position: static; min-height: 44px; margin: 0;
  border-color: transparent; background: var(--surface-raised);
}
.unified-flow #preset-preview .preset-actions { grid-column: 1 / -1; }
.unified-flow #preset-preview .preset-actions:not(:has(> button:not([hidden]))) {
  display: none;
}
.unified-flow #preset-preview:has(.preset-actions > button:not([hidden])) .preset-frame,
.unified-flow #screen-captions #preset-preview[data-full-frame] .preset-frame {
  width: min(100%, 144px); height: auto; aspect-ratio: 9 / 16; background-position: center;
  --caption-default-anchor: 70.3125%;
}
.unified-flow #screen-captions #preset-preview[data-full-frame][data-preset="accent"] .preset-sample b { font-size: 1.7em; }
.unified-flow #caption-tuning #tuning-preview-note { margin: 0; }
@media (max-height: 539px) {
  .unified-flow #preset-preview .preset-frame { height: 82px; }
}
.unified-flow .editor-option-screen {
  display: grid; gap: 12px;
}
.unified-flow .editor-option-screen :is(#intro-options, #insert-options, #brand-options) {
  border: 0; background: transparent;
}
.unified-flow .editor-option-screen :is(#intro-options, #insert-options, #brand-options) > :is(.auto-content, .brand-content) { padding: 0; }
.unified-flow .caption-screen-header {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.unified-flow .caption-screen-header h2 { font-size: 24px; line-height: 1.15; letter-spacing: -.03em; }
.unified-flow .caption-screen-header button { border-color: transparent; color: var(--accent); font-weight: 700; }
.unified-flow:not([data-caption-revision]) .caption-revision-cancel,
.unified-flow[data-caption-revision] #screen-captions :is(.control:has(#caption-depth),
  #caption-depth-help, #caption-depth-example-note, .setting-example:has(#caption-depth-example-note),
  #preset-preview .preset-actions, #brand-demo-logo, #brand-demo-photo) { display: none; }
.unified-flow[data-caption-revision] .caption-preview-slot .caption-style-control { margin-bottom: 8px; }
.unified-flow[data-caption-revision] .caption-screen-header { gap: 4px; }
.unified-flow[data-caption-revision] .caption-screen-header h2 { flex: 1; min-width: 0; }
.unified-flow[data-caption-revision] .caption-screen-header button {
  flex-shrink: 0; min-height: 44px; padding-inline: 8px; font-size: 14px;
}
.unified-flow #screen-captions #preset-preview .preview-notice { max-width: 100px; }
.unified-flow #screen-captions #caption-tuning .control select { font-size: 16px; }
.unified-flow #screen-captions #caption-tuning > .brand-content > label.control {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: center; gap: 8px; color: var(--text);
}
.unified-flow #screen-captions .caption-preview-slot { background: var(--bg); }
@media (min-height: 500px) {
  .unified-flow #screen-captions:not(:has([data-full-frame])) .caption-preview-slot {
    position: sticky; top: env(safe-area-inset-top); z-index: 6;
    background: var(--bg); padding-bottom: 4px;
  }
  .unified-flow #screen-captions:not(:has([data-full-frame])) #caption-tuning :is(summary, input, select, button) {
    scroll-margin-top: calc(172px + env(safe-area-inset-top));
  }
}

.unified-flow :is(#app-launch, #play-preset, .editor-settings-row, .editor-settings-list > details > summary,
  .caption-screen-header button, .cut-choices button, .look-choices button, .app-nav button):not(:disabled):active {
  filter: brightness(.85);
}
.unified-flow :is(.editor-settings-row, .editor-settings-list > details > summary):active {
  background-color: var(--surface-raised);
}

@media (prefers-reduced-motion: no-preference) {
  .unified-flow :is(#app-launch, #play-preset, .editor-settings-row, .editor-settings-list > details > summary,
    .caption-screen-header button, .cut-choices button, .look-choices button, .app-nav button) {
    transition: background-color 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out,
      box-shadow 140ms ease-out, filter 100ms ease-out;
  }
  .unified-flow :is(.editor-option-screen details, #cut-video-example)[open] > :is(.auto-content, .brand-content) {
    animation: disclosure-appear 140ms ease-out;
  }
}

@keyframes disclosure-appear {
  from { opacity: .65; }
  to { opacity: 1; }
}

#profile-wallet { display: grid; gap: 8px; margin-bottom: 16px; }
.wallet-overview {
  display: grid; gap: 8px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.wallet-overview h2 { font-size: 16px; }
.wallet-total {
  font-size: clamp(26px, 7vw, 36px); line-height: 1.1; font-weight: 750;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.wallet-breakdown {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0;
}
.wallet-breakdown dt, .wallet-history time { color: var(--muted); font-size: 12px; }
.wallet-breakdown dd { margin: 0; font-variant-numeric: tabular-nums; }
.wallet-breakdown div { overflow-wrap: anywhere; }
.wallet-history-head, .wallet-history li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.wallet-history-head h3 { font-size: 15px; }
.wallet-history { margin: 0; padding: 0; list-style: none; border-block: 1px solid var(--line); }
.wallet-history li { padding: 10px 2px; font-size: 14px; }
.wallet-history li + li { border-top: 1px solid var(--line); }
.wallet-history time, .wallet-history small { display: block; color: var(--muted); }
.wallet-history .wallet-open-result { display: inline-flex; align-items: center; min-height: 44px; text-align: start; }
.wallet-operation { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.wallet-operation label { position: relative; }
.wallet-operation input { position: absolute; opacity: 0; }
.wallet-operation span { display: flex; align-items: center; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; }
.wallet-operation input:checked + span { background: var(--text); color: var(--bg); }
.wallet-operation input:focus-visible + span { outline: 2px solid currentColor; outline-offset: 2px; }
.wallet-entry-units { text-align: end; font-weight: 650; font-variant-numeric: tabular-nums; }
#wallet-status:empty, #wallet-result-status:empty { display: none; }
#wallet-more { justify-self: start; }
#wallet-top-up { display: grid; gap: 4px; }
.wallet-terms { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; }
#wallet-top-up-status:empty { display: none; }
