/* Shared PC/H5 presentation: the original form controls stay in one live form. */
.mv-workflow {
  --flow-gap: var(--space-4);
  --flow-chrome-title: 40px;
  --flow-chrome-steps: 52px;
  --flow-chrome-footer: 88px;
  --flow-lyrics-height: min(340px, 42dvh);
}

body.desktop-workspace.mv-flow-active {
  --sidebar-width: 188px;
  --desktop-header-height: 52px;
}

body.mv-flow-active { overflow: hidden; }
body.mv-flow-active .workspace-topbar .page-context p { display: none; }
body.mv-flow-active .workspace-topbar .page-context h1 { font-size: var(--text-3); }
body.mv-flow-active .workspace-topbar { height: var(--desktop-header-height); padding-block: var(--space-1); }

.creator-workspace #app-content.mv-workflow {
  display: grid;
  grid-template-rows: var(--flow-chrome-title) var(--flow-chrome-steps) minmax(0, 1fr) var(--flow-chrome-footer);
  gap: var(--space-2);
  height: calc(100dvh - var(--desktop-header-height, 68px));
  width: 100%;
  max-width: none;
  padding: var(--space-3) var(--space-6);
  min-height: 0;
}

.mv-workflow [hidden], .mv-library-page [hidden] { display: none !important; }
.mv-workflow .mv-step-head, .mv-workflow .page-heading-icon, .mv-workflow .page-heading-copy p { display: none; }
.mv-workflow .page-heading { margin: 0; min-height: 0; align-items: center; }
.mv-workflow .page-heading h2 { font-size: var(--text-5); margin: 0; }
.mv-workflow .page-actions { margin: 0; }

.mv-flow-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); }
.mv-flow-steps button {
  display: flex; justify-content: center; align-items: center; gap: var(--space-2);
  min-width: 0; min-height: var(--touch-target); border: 0; border-bottom: 2px solid var(--line);
  padding: var(--space-1); color: var(--ink-secondary); background: transparent; font-size: var(--text-1);
}
.mv-flow-steps b { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; font-weight: var(--weight-medium); }
.mv-flow-steps [aria-current="step"] { color: var(--ink); border-color: var(--signal); }
.mv-flow-steps [aria-current="step"] b { color: var(--ink-inverse); background: var(--signal); border-color: var(--signal); }
.mv-flow-steps button:disabled { opacity: .5; cursor: default; }
.mv-flow-steps button:focus-visible, .mv-flow-tabs button:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.mv-workflow .mv-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--flow-gap); align-items: stretch; min-height: 0; margin: 0; overflow-y: auto; }
.mv-workflow .mv-layout[data-flow-step="4"] { grid-template-columns: minmax(0, 1fr) minmax(210px, 32%); }
.mv-workflow .mv-builder { display: block; min-width: 0; min-height: 0; overflow: visible; }
.mv-workflow .mv-step { min-height: 0; padding: 0; border: 0; background: transparent; }
.mv-workflow .field { margin: var(--space-3) 0 0; gap: var(--space-1); }
.mv-workflow .field > span, .mv-workflow .field-label { font-size: var(--text-1); }
.mv-workflow .field-hint { font-size: var(--text-1); line-height: var(--leading-2); }
.mv-workflow .field-hint, .mv-workflow .mv-character-consent { color: var(--ink-secondary); }
.mv-workflow .input, .mv-workflow .select { min-height: 38px; padding-block: var(--space-2); }
.mv-flow-pane { min-width: 0; min-height: 0; }
.mv-flow-upload { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); }
.mv-flow-upload .mv-audio-repair { margin: 0; padding: var(--space-3); }
.mv-flow-choose-song { margin-top: var(--space-2); }
.mv-flow-upload .mv-character-consent { margin-top: var(--space-3); }
.mv-flow-upload #mv-custom-lyrics { margin: 0; padding: 0; border: 0; }
.mv-flow-upload textarea { height: clamp(110px, 23dvh, 230px); min-height: 0; resize: none; }
.mv-flow-upload .section-row { align-items: start; }
.mv-flow-upload #mv-song-title-hint { display: none; }
.mv-flow-lyrics-empty { padding: var(--space-6) 0; }
.mv-song-picker #mv-library-sources { display: block !important; padding: var(--space-4); }
.mv-song-picker .mv-work-picker { grid-template-columns: 1fr; }

.mv-flow-tabs { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); }
.mv-flow-tabs button { flex: 1; min-width: 0; min-height: 38px; padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-secondary); font-size: var(--text-1); }
.mv-flow-tabs [aria-pressed="true"] { color: var(--signal); background: var(--signal-soft); border-color: var(--signal); }
.mv-flow-phone-tabs, [data-flow-tab="settings:preview"] { display: none; }
.mv-flow-visual { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4) var(--space-6); align-content: start; }
.mv-flow-visual [data-flow-pane="person"] { grid-column: 2; grid-row: 1 / 3; }
.mv-flow-visual [data-flow-pane="prompt"] { grid-column: 1; }
.mv-workflow .mv-mode-strip { margin: 0 0 var(--space-3); gap: var(--space-2); }
.mv-workflow .mv-mode { padding: var(--space-2); min-width: 0; min-height: 48px; gap: var(--space-1); }
.mv-workflow .mv-mode small, .mv-workflow .mv-mode b { display: none; }
.mv-workflow .mv-mode strong { font-size: var(--text-1); }
.mv-workflow .mv-mode-icon { width: 24px; height: 24px; }
.mv-workflow .style-swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin-top: var(--space-2); }
.mv-workflow .style-swatches button { min-width: 0; padding: var(--space-1); font-size: var(--text-1); }
.mv-workflow .style-swatches .swatch { height: 40px; min-height: 0; aspect-ratio: auto; }
.mv-workflow .mv-mode > span:not(.mv-mode-icon) { min-width: 0; }
.mv-workflow .mv-mode strong { white-space: nowrap; }
.mv-workflow .mv-custom-prompt { margin-top: 0; }
.mv-workflow .mv-custom-prompt textarea { min-height: 0; height: 76px; resize: none; }
.mv-workflow .generation-policy-hint { font-size: var(--text-1); }
.mv-workflow .mv-character-field { padding: var(--space-3); gap: var(--space-2); grid-template-columns: 56px minmax(0, 1fr); }
.mv-workflow .mv-character-thumb { width: 56px; height: 68px; }
.mv-workflow .mv-character-actions { grid-column: 1 / -1; flex-wrap: wrap; }
.mv-workflow .mv-character-library { max-height: 28dvh; overflow: auto; }
.mv-workflow .mv-character-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.mv-workflow .mv-highlight-selector { gap: var(--space-2); margin: 0; padding: var(--space-3); border: 0; }
.mv-flow-highlight-controls { display: flex; align-items: center; gap: var(--space-3); }
.mv-workflow #mv-duration { flex: 1; margin: 0; }
.mv-workflow .mv-auto-preview .section-row { flex-direction: row; }
.mv-workflow .mv-duration-hint { margin: 0; }
.mv-workflow .mv-auto-preview { padding: var(--space-2) 0; }
.mv-workflow .mv-auto-preview .section-row { margin: 0; }
.mv-workflow .mv-auto-preview p { margin: var(--space-1) 0 0; }
.mv-workflow .mv-auto-preview strong { font-size: var(--text-2); }
.mv-workflow .mv-manual-highlight { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2) var(--space-4); margin: 0; padding: 0; border: 0; background: transparent; }
.mv-workflow [data-flow-group="clip"][data-flow-pane="audio"] { grid-column: 1; grid-row: 1; }
.mv-workflow [data-flow-group="clip"][data-flow-pane="trim"] { grid-column: 1; grid-row: 2; }
.mv-workflow [data-flow-group="clip"][data-flow-pane="lyrics"] { grid-column: 2; grid-row: 1 / 3; }
.mv-workflow .mv-clip-preview, .mv-workflow .mv-selected-lyrics { border: 0; background: transparent; padding: 0; margin: 0; gap: var(--space-2); }
.mv-workflow #mv-selected-lyrics { padding: 0; white-space: normal; }
.mv-workflow .mv-selected-lyrics > .section-row { margin: 0; }
.mv-workflow .mv-highlight-preview-row { display: none; }
.mv-workflow #mv-highlight-audio, .mv-workflow #mv-clip-audio { display: none; }
.mv-workflow .mv-clip-preview .section-row { margin: var(--space-1) 0; flex-direction: row; flex-wrap: nowrap; justify-content: space-between; }
.mv-workflow .mv-clip-preview strong { font-size: var(--text-1); }
.mv-flow-clip-seek { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-2) 0; }
.mv-flow-clip-seek input { flex: 1; min-width: 0; accent-color: var(--signal); }
.mv-flow-clip-seek small { white-space: nowrap; color: var(--ink-secondary); font-size: var(--text-1); }
.mv-workflow .mv-waveform { height: 62px; margin-top: var(--space-2); touch-action: none; }
.mv-workflow .mv-waveform-hint { font-size: var(--text-1); margin-top: var(--space-1); }
.mv-workflow .mv-zoom-modes { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-1) 0; }
.mv-workflow .mv-zoom-modes button { min-height: 34px; padding: var(--space-1) var(--space-2); }
.mv-workflow .mv-trim-summary { margin-top: var(--space-1); font-size: var(--text-1); }
.mv-workflow .mv-shot-hint { display: none; }
.mv-workflow .mv-shot-lines { gap: var(--space-2); max-height: var(--flow-lyrics-height); overflow-y: auto; scrollbar-gutter: stable; overscroll-behavior-y: contain; padding: var(--space-1); }
.mv-workflow .mv-shot-lines:focus-visible, .mv-workflow .mv-shot-boundaries button:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.mv-shot-boundaries { display: grid; gap: var(--space-1); margin-bottom: var(--space-2); }
.mv-shot-boundaries > small { font-size: var(--text-1); }
.mv-shot-boundaries button { display: grid; gap: var(--space-1); min-height: var(--touch-target); padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); text-align: left; overflow-wrap: anywhere; }
.mv-shot-boundaries button:hover { border-color: var(--signal); }
.mv-shot-boundaries button span, .mv-workflow .mv-shot-line-text small { display: block; color: var(--ink-secondary); font-size: var(--text-1); font-weight: var(--weight-regular); }
.mv-shot-boundaries button b { font-size: var(--text-2); font-weight: var(--weight-medium); }
.mv-character-risk-image { display: block; width: 100%; max-height: 220px; object-fit: contain; background: var(--canvas); border-radius: var(--radius-sm); }
.mv-character-risk-modal .modal-body > p { font-size: var(--text-2); line-height: var(--leading-2); }
.mv-character-risk-list { display: grid; gap: var(--space-3); padding-left: var(--space-5); }
.mv-character-risk-list small { display: block; color: var(--warning); font-size: var(--text-1); margin-top: var(--space-1); }
.mv-character-risk-list p { margin: var(--space-1) 0 0; overflow-wrap: anywhere; }
.mv-character-risk-modal .modal-foot { display: grid; grid-template-columns: auto auto minmax(0, 1fr); }
.mv-character-risk-modal .modal-foot .btn { min-height: var(--touch-target); white-space: normal; }
@media (max-width: 480px) {
  .mv-character-risk-modal .modal-foot { grid-template-columns: 1fr; gap: var(--space-2); }
}
.mv-workflow .mv-shot-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: var(--space-1); gap: var(--space-1); }
.mv-workflow .mv-shot-line-text { grid-column: 1; grid-row: 1; }
.mv-workflow .mv-shot-add { grid-column: 2; grid-row: 1; margin: 0; }
.mv-workflow .mv-shot-tags { grid-column: 1 / -1; min-width: 0; }
.mv-workflow .mv-shot-scene { flex-basis: 100%; display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-workflow .mv-shot-line-text { font-size: var(--text-2); }
.mv-workflow .mv-shot-add { min-height: 34px; }

.mv-flow-settings > .mv-flow-pane[data-flow-active="false"] { display: none; }
.mv-flow-settings .mv-settings-row { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
.mv-flow-settings .mv-text-style-group { padding: 0; border: 0; }
.mv-flow-settings .mv-text-style-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.mv-flow-settings .field { margin: 0; }
.mv-flow-settings .mv-text-style-group > .section-row { flex-direction: row; justify-content: space-between; }
.mv-flow-settings .mv-text-style-group .section-row { margin-bottom: var(--space-2); }
.mv-flow-settings .mv-title-layout-field { margin-top: var(--space-2); }
.mv-flow-settings .mv-text-color-field { margin-top: var(--space-2); }
.mv-flow-settings .mv-subtitle-setting { margin: 0 0 var(--space-3); }
.mv-workflow .mv-preview { position: static; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.mv-workflow .mv-preview-frame { width: 100%; min-height: 0; aspect-ratio: 16 / 9; }
.mv-workflow .mv-preview-frame.portrait { width: min(170px, 100%); aspect-ratio: 9 / 16; }
.mv-workflow .mv-preview-note { padding: 0; font-size: var(--text-1); }
.mv-workflow .mv-preview-note strong { font-size: var(--text-1); }

.mv-flow-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); border-top: 1px solid var(--line); padding-top: var(--space-3); min-width: 0; }
.mv-flow-action-copy { flex: 1; min-width: 0; }
.mv-flow-action-copy strong, .mv-flow-action-copy small { display: block; }
.mv-flow-action-copy strong { font-size: var(--text-2); }
.mv-flow-action-copy small { font-size: var(--text-1); color: var(--ink-secondary); }
.mv-flow-actions { display: flex; gap: var(--space-2); flex-shrink: 0; }
.mv-flow-footer .mv-submit { position: static; flex-direction: row; align-items: center; margin: 0; padding: 0; border: 0; background: transparent; display: flex; justify-content: space-between; flex: 1; min-width: 0; gap: var(--space-3); }
.mv-flow-footer .mv-submit > div { min-width: 0; }
.mv-flow-footer .mv-submit strong { font-size: var(--text-4); }
.mv-flow-footer #mv-submit { flex-shrink: 0; }
.mv-workflow #mv-history { margin: 0; min-height: 0; }
.mv-workflow #mv-history > .section-row { margin-bottom: var(--space-2); }

.mv-library-filters { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); flex-wrap: wrap; }
.mv-library-filters label { margin-left: auto; }
.mv-library-page .mv-history { margin-top: 0; }
.mv-library-page .mv-task-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); align-items: start; }
.mv-library-detail .mv-task-list { grid-template-columns: minmax(0, 1fr); }
.mv-workflow .mv-task-list { grid-template-columns: minmax(0, 1fr); }
.mv-library-page .mv-task-card, .mv-workflow .mv-task-card { display: flex; flex-direction: column; padding: 0; }
.mv-library-page .mv-task-media, .mv-workflow .mv-task-media { width: 100%; aspect-ratio: 16 / 9; min-height: 0; background: var(--canvas); }
.mv-library-page .mv-task-media video, .mv-workflow .mv-task-media video { display: block; width: 100%; height: 100%; max-height: none; object-fit: contain; }
.mv-library-detail .mv-task-media { aspect-ratio: auto; }
.mv-library-detail .mv-task-media video { height: min(62dvh, 680px); min-height: 240px; }
.mv-library-page .mv-task-copy, .mv-workflow .mv-task-copy { padding: var(--space-4); }
.mv-library-page .mv-task-title, .mv-workflow .mv-task-title { gap: var(--space-3); align-items: flex-start; }
.mv-task-title h3 { min-width: 0; margin: 0; font-size: var(--text-4); line-height: var(--leading-2); overflow-wrap: anywhere; }
.mv-task-title h3 a { color: var(--ink); text-decoration: none; }
.mv-task-title h3 a:hover { color: var(--signal); }
.mv-task-meta { display: flex; gap: var(--space-2) var(--space-3); flex-wrap: wrap; margin-top: var(--space-2); color: var(--ink-secondary); font-size: var(--text-1); }
.mv-task-details { margin-top: var(--space-4); border-top: 1px solid var(--line); padding-top: var(--space-2); }
.mv-task-details summary { display: list-item; min-height: var(--touch-target); align-content: center; cursor: pointer; color: var(--ink-secondary); font-size: var(--text-2); }
.mv-task-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin: var(--space-2) 0; font-size: var(--text-1); }
.mv-task-facts dt { color: var(--ink-tertiary); }
.mv-task-facts dd { margin: var(--space-1) 0 0; overflow-wrap: anywhere; }
.mv-task-details .mv-task-prompt { margin: var(--space-3) 0 0; color: var(--ink-secondary); font-size: var(--text-2); line-height: var(--leading-3); overflow-wrap: anywhere; }
.mv-task-details .mv-task-prompt b { display: block; margin-bottom: var(--space-1); }
.mv-task-secondary-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.mv-library-page .mv-media-state, .mv-workflow .mv-media-state { display: flex; flex-direction: column; gap: var(--space-2); justify-content: center; align-items: center; padding: var(--space-4); text-align: center; }
.mv-media-state strong { color: var(--ink); font-size: var(--text-3); }
.mv-media-state > span { color: var(--ink-secondary); font-size: var(--text-1); }
.mv-library-page .mv-task-title > .badge, .mv-workflow .mv-task-title > .badge { flex-shrink: 0; align-self: flex-start; }
.mv-library-page .mv-task-actions, .mv-workflow .mv-task-actions { gap: var(--space-2); flex-wrap: wrap; padding-top: var(--space-3); margin-top: var(--space-3); border-top: 1px solid var(--line); }

html[data-client="mobile"] body.mv-flow-active .mobile-primary-nav { display: none; }
html[data-client="mobile"] body.mv-flow-active { padding-bottom: 0; }
html[data-client="mobile"] body.mv-flow-active .mobile-app-shell { padding-bottom: 0; }
html[data-client="mobile"] .creator-workspace #app-content.mv-workflow {
  --flow-chrome-title: 36px;
  --flow-chrome-steps: 52px;
  --flow-chrome-footer: 84px;
  grid-template-rows: var(--flow-chrome-title) var(--flow-chrome-steps) minmax(0, 1fr) var(--flow-chrome-footer);
  height: calc(100dvh - var(--m-header-height) - var(--m-status-height) - 1px);
  max-width: var(--m-content-max); padding: var(--space-2) var(--space-3) calc(var(--space-2) + var(--safe-bottom));
  margin: 0 auto; gap: var(--space-1);
}
html[data-client="mobile"] .mv-workflow .page-heading h2 { font-size: var(--text-4); }
html[data-client="mobile"] .mv-workflow .page-heading { display: flex; align-items: center; }
html[data-client="mobile"] .mv-workflow .page-heading h2 { display: block; }
html[data-client="mobile"] .mv-workflow .page-actions { width: auto; }
html[data-client="mobile"] .mv-workflow .mv-highlight-selector { padding: var(--space-2); gap: var(--space-1); }
html[data-client="mobile"] .mv-workflow .mv-auto-preview .section-row { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; }
html[data-client="mobile"] .mv-workflow .mv-highlight-preview-row .btn { width: auto; }
html[data-client="mobile"] .mv-workflow .mv-highlight-preview-row { align-items: center; }
html[data-client="mobile"] .mv-flow-highlight-controls { display: grid; grid-template-columns: 1fr; gap: var(--space-1); }
html[data-client="mobile"] .mv-flow-highlight-controls > .field-label { display: none; }
html[data-client="mobile"] .mv-workflow .mv-highlight-selector:has(.mv-manual-highlight:not([hidden])) > .mv-duration-hint { display: none; }
html[data-client="mobile"] .mv-workflow .mv-auto-preview { padding: 0; }
html[data-client="mobile"] .mv-workflow .mv-auto-preview p { font-size: var(--text-1); line-height: var(--leading-1); }
html[data-client="mobile"] .mv-workflow .mv-selected-lyrics { gap: var(--space-1); }
html[data-client="mobile"] .mv-workflow .mv-selected-lyrics > .section-row { display: none; }
html[data-client="mobile"] .mv-workflow .mv-shot-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: var(--space-1); }
html[data-client="mobile"] .mv-workflow .mv-shot-line-text { grid-column: 1; grid-row: 1; }
html[data-client="mobile"] .mv-workflow .mv-shot-add { grid-column: 2; grid-row: 1; margin: 0; }
html[data-client="mobile"] .mv-workflow .mv-shot-tags { grid-column: 1 / -1; gap: var(--space-1); }
html[data-client="mobile"] .mv-workflow #mv-selected-lyrics .mv-shot-tag { min-height: var(--touch-target); font-size: var(--text-1); }
html[data-client="mobile"] .mv-workflow .mv-shot-scene { flex-basis: 100%; min-height: 0; padding-block: 0; font-size: var(--text-1); }
html[data-client="mobile"] .mv-workflow .mv-flow-clip { margin-top: var(--space-1); }
html[data-client="mobile"] .mv-flow-footer .mv-flow-action-copy small { display: none; }
html[data-client="mobile"] .mv-flow-steps { gap: var(--space-1); }
html[data-client="mobile"] .mv-flow-steps button { flex-direction: column; gap: var(--space-1); padding: 0; min-height: var(--touch-target); }
html[data-client="mobile"] .mv-flow-steps b { width: 20px; height: 20px; }
html[data-client="mobile"] .mv-workflow .mv-layout, html[data-client="mobile"] .mv-workflow .mv-layout[data-flow-step="4"] { display: block; }
html[data-client="mobile"] .mv-flow-upload, html[data-client="mobile"] .mv-flow-visual, html[data-client="mobile"] .mv-workflow .mv-manual-highlight { display: block; }
html[data-client="mobile"] .mv-flow-phone-tabs, html[data-client="mobile"] [data-flow-tab="settings:preview"] { display: flex; }
html[data-client="mobile"] .mv-workflow .mv-flow-tabs button { min-height: var(--touch-target); padding: var(--space-1); }
html[data-client="mobile"] .mv-flow-pane[data-flow-active="false"] { display: none; }
html[data-client="mobile"] .mv-workflow .input, html[data-client="mobile"] .mv-workflow .select, html[data-client="mobile"] .mv-workflow .textarea { font-size: var(--text-3); }
html[data-client="mobile"] .mv-workflow .mv-audio-repair { grid-template-columns: minmax(0, 1fr) auto; padding: var(--space-2); gap: var(--space-2); }
html[data-client="mobile"] .mv-workflow .mv-audio-repair > span { display: none; }
html[data-client="mobile"] .mv-workflow .mv-audio-repair .btn { grid-column: auto; width: auto; }
html[data-client="mobile"] .mv-flow-upload textarea { height: clamp(110px, 24dvh, 220px); }
html[data-client="mobile"] .mv-workflow .mv-character-consent { margin-top: var(--space-2); padding: 0; font-size: var(--text-1); }
html[data-client="mobile"] .mv-workflow .mv-custom-prompt textarea { height: 140px; }
html[data-client="mobile"] .mv-workflow .mv-mode-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html[data-client="mobile"] .mv-workflow .mv-mode { min-height: 48px; padding: var(--space-1); }
html[data-client="mobile"] .mv-workflow .mv-mode-icon { display: none; }
html[data-client="mobile"] .mv-workflow .style-swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html[data-client="mobile"] .mv-workflow .mv-clip-preview .btn { width: auto; min-height: var(--touch-target); }
html[data-client="mobile"] .mv-workflow .mv-waveform-hint { display: none; }
html[data-client="mobile"] .mv-workflow .mv-highlight-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin: 0; }
html[data-client="mobile"] .mv-workflow .mv-highlight-sliders label { gap: 0; }
html[data-client="mobile"] .mv-workflow .mv-highlight-sliders input { width: 100%; margin: 0; touch-action: none; }
html[data-client="mobile"] .mv-workflow .mv-highlight-sliders input, html[data-client="mobile"] .mv-flow-clip-seek input { min-height: var(--touch-target); }
html[data-client="mobile"] .mv-workflow .mv-waveform { height: 52px; }
html[data-client="mobile"] .mv-workflow .mv-zoom-modes > span { display: none; }
html[data-client="mobile"] .mv-workflow .mv-highlight-sliders span { font-size: var(--text-1); }
html[data-client="mobile"] .mv-workflow #mv-zoom-modes { margin: var(--space-1) 0; gap: var(--space-1); }
html[data-client="mobile"] .mv-workflow #mv-zoom-modes button { min-height: var(--touch-target); }
html[data-client="mobile"] .mv-flow-clip > .mv-flow-tabs { margin-bottom: var(--space-1); }
html[data-client="mobile"] .mv-workflow .mv-duration-hint { font-size: var(--text-1); line-height: var(--leading-1); }
html[data-client="mobile"] .mv-workflow .mv-preview { height: min(290px, 40dvh); margin: 0; }
html[data-client="mobile"] .mv-workflow .mv-preview-frame { max-width: 360px; }
html[data-client="mobile"] .mv-workflow .mv-preview-frame.portrait { width: min(140px, 100%); }
html[data-client="mobile"] .mv-flow-footer { flex-wrap: wrap; gap: var(--space-1); padding-top: var(--space-2); }
html[data-client="mobile"] .mv-flow-action-copy { flex-basis: 100%; display: flex; justify-content: space-between; gap: var(--space-2); align-items: center; }
html[data-client="mobile"] .mv-flow-action-copy strong, html[data-client="mobile"] .mv-flow-action-copy small { font-size: var(--text-1); }
html[data-client="mobile"] .mv-flow-actions { width: 100%; }
html[data-client="mobile"] .mv-flow-actions .btn-primary { flex: 1; }
html[data-client="mobile"] .mv-flow-footer .mv-submit { gap: var(--space-2); }
html[data-client="mobile"] .mv-flow-footer .mv-submit small { font-size: var(--text-1); line-height: var(--leading-1); }
html[data-client="mobile"] .mv-flow-footer #mv-cost-detail { display: none; }
html[data-client="mobile"] .mv-flow-footer .mv-submit .btn { width: auto; }
html[data-client="mobile"] .mv-workflow[data-flow-step="4"] .mv-flow-footer { flex-wrap: nowrap; }
html[data-client="mobile"] .mv-workflow[data-flow-step="4"] .mv-flow-actions { width: auto; }
html[data-client="mobile"] .mv-workflow[data-flow-step="4"] .mv-submit strong { font-size: var(--text-3); }
html[data-client="mobile"] .mv-flow-settings .mv-text-style-row:has(#mv-title-angle-field:not([hidden])) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html[data-client="mobile"] .mv-workflow .mv-flow-settings { padding: var(--space-2); }
html[data-client="mobile"] .mv-workflow .mv-mode { display: flex; justify-content: center; }
html[data-client="mobile"] .mv-library-page .mv-task-list { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
html[data-client="mobile"] .mv-library-page .mv-task-title, html[data-client="mobile"] .mv-workflow .mv-task-title { flex-direction: row; }
html[data-client="mobile"] .mv-task-title h3 { font-size: var(--text-3); }
html[data-client="mobile"] .mv-library-page .mv-task-copy, html[data-client="mobile"] .mv-workflow .mv-task-copy { padding: var(--space-3); }
html[data-client="mobile"] .mv-library-detail .mv-task-media video { height: min(52dvh, 480px); min-height: 200px; }
html[data-client="mobile"] .mv-task-actions > .btn { min-height: var(--touch-target); }
html[data-client="mobile"] .mv-task-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-client="mobile"] .mv-task-actions > .btn-primary { grid-column: 1 / -1; }
html[data-client="mobile"] .mv-library-filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
html[data-client="mobile"] .mv-library-filters .segmented { grid-column: 1 / -1; }
html[data-client="mobile"] .mv-library-filters label { margin: 0; min-width: 0; }

/* Very short/zoomed viewports retain every field and action instead of clipping them. */
@media (max-height: 640px) {
  body.mv-flow-active { overflow-y: auto; }
  .creator-workspace #app-content.mv-workflow, html[data-client="mobile"] .creator-workspace #app-content.mv-workflow { display: flex; flex-direction: column; min-height: 0; height: auto; }
  .mv-workflow .page-heading { min-height: 40px; }
  .mv-flow-steps { min-height: 52px; }
  .mv-workflow .mv-layout { overflow: visible; }
  .mv-flow-footer { min-height: 100px; }
}
