/* Fynix 2.0 — P04/P05/P06/P11/P12/P13. Layout only; project state stays in the existing modules. */
body[data-fynix-page] {
  --workflow-border: #dce4f5;
  --workflow-soft: #eff3ff;
  --workflow-muted: #778093;
  --workflow-purple: #426b88;
  --workflow-ink: #14243a;
}
body[data-fynix-page] .app-shell .stage-workspace {
  padding: 22px 24px 16px;
  gap: 0;
  background: #f7f8fe;
}
body[data-fynix-page] .app-shell .stage-workspace > * { max-width: none; }
body[data-fynix-page] .app-shell .stage-heading { min-height: 48px; margin-bottom: 16px; }
body[data-fynix-page] .app-shell .stage-title-line { margin-top: 4px; gap: 12px; }
body[data-fynix-page] .app-shell .stage-title-line h1 { font-size: 20px; font-weight: 650; letter-spacing: -.025em; }
.fynix2-page-label { display: block; margin: 0 0 6px; color: var(--workflow-purple); font-size: 12px; font-weight: 650; letter-spacing: .035em; }
body[data-fynix-page] .app-shell .stage-heading .back-link { font-size: 12px; margin-bottom: 8px; color: #798298; }
body[data-fynix-page] .app-shell .stage-steps { display: flex; height: auto; min-height: 56px; margin: 0 0 20px; padding: 6px; gap: 7px; border: 1px solid var(--workflow-border); border-radius: 10px; background: #fff; }
body[data-fynix-page] .app-shell .stage-steps > a { flex: 1 1 0; display: flex; min-width: 0; min-height: 42px; padding: 9px 12px; border: 0; border-radius: 7px; gap: 9px; color: #697186; background: transparent; font-weight: 500; }
body[data-fynix-page] .app-shell .stage-steps > a.active { background: #efecff; color: var(--workflow-purple); box-shadow: none; }
body[data-fynix-page] .app-shell .stage-steps > a > b { display: grid; flex: 0 0 25px; width: 25px; height: 25px; place-items: center; border: 0; border-radius: 50%; color: #5c6476; background: #eef3ff; font-size: 11px; }
body[data-fynix-page] .app-shell .stage-steps > a.active > b { color: #fff; background: var(--workflow-purple); }
body[data-fynix-page] .app-shell .stage-steps > a > span { font-size: 13px; line-height: 1.5; }
body[data-fynix-page] .app-shell .panel { border: 1px solid var(--workflow-border); border-radius: 12px; background: #fff; box-shadow: 0 2px 4px #203d7110; }
body[data-fynix-page] :is(.setup-panel-header,.analysis-panel-header,.creative-panel-header,.generation-panel-header,.results-panel-header) { height: auto; min-height: 58px; padding: 13px 16px; border-bottom: 1px solid var(--workflow-border); background: #fff; }
body[data-fynix-page] :is(.setup-panel-header,.analysis-panel-header,.creative-panel-header,.generation-panel-header,.results-panel-header) h2 { color: var(--workflow-ink); font-size: 15px; font-weight: 650; line-height: 1.4; }
body[data-fynix-page] :is(.setup-panel-header,.analysis-panel-header,.creative-panel-header,.generation-panel-header,.results-panel-header) > div > span { color: var(--workflow-muted); font-size: 11px; }
body[data-fynix-page] :is(.stage-field input,.stage-field textarea,.stage-field select,.story-field textarea,.advanced-story-fields input,.advanced-story-fields textarea,.output-spec-grid select,.prompt-textarea-wrap textarea) { color: var(--workflow-ink); background: #fff; border: 1px solid #d9deec; border-radius: 7px; box-shadow: none; }
body[data-fynix-page] :is(input,select,textarea,button):focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
body[data-fynix-page] :is(button,input,select,textarea) { accent-color: var(--workflow-purple); }
body[data-fynix-page] :is(.secondary-action,.compact-button,.quiet-action) { border-color: #d9deec; border-radius: 7px; background: #fff; color: #454b61; }
body[data-fynix-page] :is(.primary-action,.mr-button.primary) { background: var(--accent-strong); border: 1px solid var(--accent-strong); border-radius: 7px; color: #fff; }
body[data-fynix-page] :is(.primary-action,.mr-button.primary):hover:not(:disabled) { background: var(--accent); color: #fff; }
body[data-fynix-page] .app-shell .stage-actionbar { position: sticky; bottom: 0; z-index: 12; display: flex; flex-wrap: wrap; min-height: 70px; width: 100%; margin: 18px 0 0; padding: 12px 14px; gap: 8px; border: 1px solid var(--workflow-border); border-radius: 10px; background: #fff; box-shadow: 0 -4px 15px #1d275806; }
body[data-fynix-page] .app-shell .stage-actionbar > :is(button,a) { min-height: 38px; height: auto; padding: 8px 12px; font-size: 12px; white-space: normal; }
body[data-fynix-page] .app-shell .stage-actionbar .action-readiness { flex: 1 1 180px; min-width: 150px; }
body[data-fynix-page] .app-shell .stage-actionbar .back-action { display: inline-flex; }
body[data-fynix-page] .app-shell .stage-actionbar :is(strong,p) { white-space: normal; overflow-wrap: anywhere; }
body[data-fynix-page] [hidden] { display: none !important; }

/* P04: portrait reference on the left, product and customization on the right. */
body[data-fynix-page="P04"] .app-shell .material-board { display: grid; grid-template-columns: minmax(310px,.78fr) minmax(420px,1.22fr); grid-template-rows: auto auto auto; grid-template-areas: "reference product" "reference support" "reference brief"; align-items: start; gap: 20px; height: auto; min-height: 0; }
body[data-fynix-page="P04"] .app-shell .material-board > .panel { height: auto; min-height: 0; overflow: hidden; }
body[data-fynix-page="P04"] .app-shell .board-reference { grid-area: reference; position: sticky; top: 0; }
body[data-fynix-page="P04"] .app-shell .board-product { grid-area: product; }
body[data-fynix-page="P04"] .app-shell .board-support { grid-area: support; }
body[data-fynix-page="P04"] .app-shell .board-brief { grid-area: brief; }
body[data-fynix-page="P04"] .app-shell .compact-reference { display: flex; height: auto; flex-direction: column; gap: 18px; padding: 16px; }
body[data-fynix-page="P04"] .app-shell .reference-video .video-frame { position: relative; width: min(100%,300px); height: auto; min-height: 0; aspect-ratio: 9/16; align-self: center; border: 1px solid #d6dff3; border-radius: 12px; background: #eef2fb; overflow: hidden; }
body[data-fynix-page="P04"] .app-shell .reference-video .video-frame video { width: 100%; height: 100%; object-fit: contain; background: #111827; }
body[data-fynix-page="P04"] .app-shell .reference-video .video-frame:not(:has(video[src]))::before { position: absolute; inset: 42% 24px auto; z-index: 1; content: "上传主参考视频后，在这里查看完整画面"; text-align: center; color: #a4aec4; font-size: 13px; line-height: 1.8; pointer-events: none; }
body[data-fynix-page="P04"] .app-shell .file-facts { display: grid; gap: 10px; width: 100%; min-height: 0; padding: 14px; border: 1px solid var(--workflow-border); border-radius: 9px; background: var(--workflow-soft); }
body[data-fynix-page="P04"] .app-shell .file-facts > div:first-child { min-width: 0; }
body[data-fynix-page="P04"] .app-shell .file-facts strong { white-space: normal; overflow-wrap: anywhere; }
body[data-fynix-page="P04"] .app-shell .file-facts dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0; }
body[data-fynix-page="P04"] .app-shell .file-facts dl > div { border: 0; padding: 0; }
body[data-fynix-page="P04"] .app-shell .recreation-config { display: grid; grid-template-columns: 1fr; margin: 0 16px 16px; padding: 16px; gap: 14px; box-shadow: none; border-radius: 9px; }
body[data-fynix-page="P04"] .app-shell .recreation-config .stage-field { min-width: 0; gap: 8px; }
body[data-fynix-page="P04"] .app-shell .recreation-config select { width: 100%; min-height: 40px; }
body[data-fynix-page="P04"] .app-shell .product-source-tabs { margin: 16px 16px 0; padding: 4px; border: 1px solid var(--workflow-border); border-radius: 8px; background: var(--workflow-soft); }
body[data-fynix-page="P04"] .app-shell .product-source-tabs button { min-height: 34px; border-radius: 5px; }
body[data-fynix-page="P04"] .app-shell .product-source-tabs button.active { color: var(--workflow-purple); background: #fff; box-shadow: 0 1px 4px #2c3e6010; }
body[data-fynix-page="P04"] .app-shell .product-source-pane { height: auto; min-height: 0; max-height: none; padding: 16px; overflow: visible; }
body[data-fynix-page="P04"] .app-shell .product-select-row { align-items: end; gap: 12px; }
body[data-fynix-page="P04"] .app-shell .product-select-row select { height: 40px; border-radius: 7px; background: #fff; }
body[data-fynix-page="P04"] .app-shell .product-record { display: grid; grid-template-columns: 112px minmax(0,1fr); padding: 16px; margin-top: 14px; gap: 16px; border: 1px solid var(--workflow-border); border-radius: 9px; background: var(--workflow-soft); }
body[data-fynix-page="P04"] .app-shell .product-record > img { width: 112px; height: 150px; object-fit: contain; background: #fff; border: 1px solid #dce4f5; border-radius: 8px; }
body[data-fynix-page="P04"] .app-shell .record-summary { justify-content: center; }
body[data-fynix-page="P04"] .app-shell .product-record:not(:has(img:not([hidden]))) .record-summary { grid-column: 1/-1; min-height: 72px; }
body[data-fynix-page="P04"] .app-shell .dynamic-facts { grid-column: 1/-1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0; }
body[data-fynix-page="P04"] .app-shell .dynamic-facts > div { border: 0; min-width: 0; padding: 8px; background: #fff; border-radius: 6px; }
body[data-fynix-page="P04"] .app-shell .dynamic-facts > .fact-product-info dd { max-height: 180px; white-space: pre-wrap; line-height: 1.7; }
body[data-fynix-page="P04"] .app-shell .simple-manual-product { display: grid; gap: 14px; }
body[data-fynix-page="P04"] .app-shell .simple-manual-product textarea { min-height: 100px; }
body[data-fynix-page="P04"] .app-shell .aligned-support { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 16px; gap: 10px; }
body[data-fynix-page="P04"] .app-shell .support-item { min-height: 76px; border: 1px solid var(--workflow-border); border-radius: 8px; background: var(--workflow-soft); }
body[data-fynix-page="P04"] .app-shell .brief-form { height: auto; display: grid; grid-template-columns: 1fr; gap: 14px; padding: 16px; }
body[data-fynix-page="P04"] .app-shell .derived-specs { grid-column: 1/-1; padding: 12px; border-radius: 8px; background: var(--workflow-soft); }
body[data-fynix-page="P04"] .app-shell .brief-form > .stage-field { grid-column: 1; grid-row: auto; }
body[data-fynix-page="P04"] .app-shell .brief-form input { min-height: 40px; }
body[data-fynix-page="P04"] .app-shell .brief-goal textarea { min-height: 116px; }

/* P05: boundary editing is kept separate from the semantic and prompt editor. */
body[data-fynix-page="P05"] .app-shell .analysis-board { display: grid; grid-template-columns: minmax(300px,.72fr) minmax(420px,1fr); grid-template-rows: minmax(0,1fr); height: auto; min-height: 630px; gap: 18px; }
body[data-fynix-page="P05"] .app-shell .analysis-viewer { display: grid; grid-template-rows: 58px minmax(0,1fr); height: 100%; min-height: 0; }
body[data-fynix-page="P05"] .app-shell .analysis-video-frame { width: calc(100% - 32px); height: auto; aspect-ratio: 9/16; max-height: calc(100dvh - 300px); min-height: 360px; margin: 16px auto; border: 1px solid #dce4f5; border-radius: 11px; background: #eef2fb; }
body[data-fynix-page="P05"] .app-shell .analysis-video-frame > video { object-fit: contain; }
body[data-fynix-page="P05"] .app-shell .viewer-controls { padding: 12px; flex-wrap: wrap; }
body[data-fynix-page="P05"] .app-shell .viewer-controls span { flex: 1 0 100%; max-width: 100%; white-space: normal; font-size: 10px; line-height: 1.5; }
body[data-fynix-page="P05"] .app-shell .viewer-shot-label { top: 12px; left: 12px; color: #fff; background: #18233dd9; }
.fynix2-analysis-right { display: grid; grid-template-rows: auto minmax(0,1fr); gap: 16px; min-width: 0; min-height: 0; }
body[data-fynix-page="P05"] .app-shell .fynix2-timeline-panel { min-height: 150px; height: auto; padding: 6px; overflow: visible; }
body[data-fynix-page="P05"] .app-shell .timeline-editor { padding: 12px; }
body[data-fynix-page="P05"] .app-shell .timeline-editor > header { gap: 10px; flex-wrap: wrap; }
body[data-fynix-page="P05"] .app-shell .timeline-editor > header > div { gap: 7px; flex-wrap: wrap; }
body[data-fynix-page="P05"] .app-shell .timeline-editor > header button { min-height: 27px; border-radius: 5px; background: #f5f7ff; color: #555f79; }
body[data-fynix-page="P05"] .app-shell .shot-track { height: 54px; margin-top: 7px; border-radius: 6px; background: #eceefa; }
body[data-fynix-page="P05"] .app-shell .shot-track button { color: #655d90; border-color: #d0cff1; background: #e4e2fc; }
body[data-fynix-page="P05"] .app-shell .shot-track button.active { background: #cec7fa; border-color: #6656e8; color: #3825cb; }
body[data-fynix-page="P05"] .app-shell .shot-list-panel { display: grid; grid-template-rows: auto minmax(0,1fr); min-height: 0; height: 100%; }
body[data-fynix-page="P05"] .app-shell .shot-list { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 260px; overflow: auto; }
body[data-fynix-page="P05"] .app-shell .shot-list-item { display: grid; grid-template-columns: 62px minmax(0,1fr) auto; gap: 12px; min-height: 102px; padding: 10px; border: 1px solid var(--workflow-border); border-radius: 9px; background: #fff; }
body[data-fynix-page="P05"] .app-shell .shot-list-item[aria-pressed="true"] { border: 2px solid #5a46dd; padding: 9px; background: #f7f6ff; box-shadow: none; }
body[data-fynix-page="P05"] .app-shell .shot-list-item :is(img,.shot-text-thumb) { width: 56px; height: 78px; object-fit: contain; border: 1px solid #dde2ee; border-radius: 7px; background: #eef2fb; color: #6c62aa; }
body[data-fynix-page="P05"] .app-shell .shot-list-item > span:nth-child(2) { display: flex; flex-direction: column; gap: 12px; white-space: normal; }
body[data-fynix-page="P05"] .app-shell .shot-list-item small { white-space: normal; color: #7b8192; }
body[data-fynix-page="P05"] .app-shell .shot-list-item em { color: #168366; background: #e8fbf3; border-radius: 4px; padding: 4px 6px; font-size: 11px; }

/* P06: shot navigation, portrait source monitor, editable facts and final prompt. */
body[data-fynix-page="P06"] .app-shell .creative-tools { margin: 0 0 14px; gap: 14px; }
body[data-fynix-page="P06"] .app-shell .creative-board { display: grid; grid-template-columns: minmax(155px,.42fr) minmax(260px,.84fr) minmax(350px,1.2fr); grid-template-areas: "shots source editor"; grid-template-rows: minmax(0,1fr); height: auto; min-height: 620px; gap: 16px; }
body[data-fynix-page="P06"] .app-shell .creative-shot-nav { grid-area: shots; display: grid; grid-template-rows: auto minmax(0,1fr); }
body[data-fynix-page="P06"] .app-shell .creative-shot-nav .creative-panel-header { align-items: start; flex-direction: column; gap: 9px; }
body[data-fynix-page="P06"] .app-shell .creative-shot-list { display: flex; flex-direction: column; gap: 9px; padding: 10px; overflow: auto; }
body[data-fynix-page="P06"] .app-shell .creative-shot-item { display: grid; grid-template-columns: 1fr; gap: 9px; min-height: 132px; padding: 12px; border: 1px solid var(--workflow-border); border-radius: 8px; background: #fff; }
body[data-fynix-page="P06"] .app-shell .creative-shot-item > span:first-child { color: var(--workflow-purple); background: #edeaff; border-radius: 5px; padding: 4px 7px; width: fit-content; }
body[data-fynix-page="P06"] .app-shell .creative-shot-item[aria-selected="true"] { border: 2px solid #5a46dd; padding: 11px; background: #f6f4ff; }
body[data-fynix-page="P06"] .app-shell .creative-shot-item :is(b,small) { overflow-wrap: anywhere; white-space: normal; }
body[data-fynix-page="P06"] .app-shell .creative-shot-item em { justify-self: start; padding: 4px 7px; border-radius: 5px; background: #e8fbf3; color: #168366; }
body[data-fynix-page="P06"] .app-shell .creative-shot-item em.unsynced { color: #a66d13; background: #fff7e5; }
body[data-fynix-page="P06"] .app-shell .creative-source-preview { grid-area: source; min-height: 0; display: grid; grid-template-rows: auto minmax(0,1fr); }
body[data-fynix-page="P06"] .app-shell .creative-source-preview > div { position: relative; display: flex; justify-content: center; align-items: center; padding: 22px 16px; min-height: 440px; background: #f4f6fc; }
body[data-fynix-page="P06"] .app-shell .creative-source-preview video { position: static; inset: auto; width: 100%; height: 100%; max-height: 680px; max-width: 350px; aspect-ratio: 9/16 !important; border: 3px solid #35415a; border-radius: 13px; background: #111827; object-fit: contain; }
.fynix2-creative-editor { grid-area: editor; display: flex; flex-direction: column; gap: 16px; min-width: 0; min-height: 0; overflow: auto; padding: 0 3px 3px 0; }
body[data-fynix-page="P06"] .app-shell .fynix2-creative-editor > .panel { flex-shrink: 0; height: auto; min-height: 0; overflow: visible; }
body[data-fynix-page="P06"] .app-shell .storyboard-editor { display: block; }
body[data-fynix-page="P06"] .app-shell .storyboard-fields { padding: 16px; overflow: visible; }
body[data-fynix-page="P06"] .app-shell .story-field { padding-bottom: 15px; margin-bottom: 14px; }
body[data-fynix-page="P06"] .app-shell .story-field > header { gap: 9px; margin-bottom: 10px; }
body[data-fynix-page="P06"] .app-shell .story-field > header > b { background: #eeebff; color: #6552d9; }
body[data-fynix-page="P06"] .app-shell .story-field p { line-height: 1.8; color: #566079; }
body[data-fynix-page="P06"] .app-shell .original-fact { padding: 12px; border: 1px solid var(--workflow-border); border-radius: 8px; background: #f4f6fd; }
body[data-fynix-page="P06"] .app-shell .story-field textarea { min-height: 100px; height: auto; padding: 12px; line-height: 1.8; }
body[data-fynix-page="P06"] .app-shell .advanced-story-fields { padding: 10px 12px; border: 1px solid var(--workflow-border); border-radius: 8px; background: #fafbff; }
body[data-fynix-page="P06"] .app-shell .advanced-story-fields > div { gap: 12px; }
body[data-fynix-page="P06"] .app-shell .prompt-compiler { display: flex; flex-direction: column; }
body[data-fynix-page="P06"] .app-shell .prompt-tabs { padding: 7px 14px; gap: 8px; min-height: 44px; background: #f5f6fd; }
body[data-fynix-page="P06"] .app-shell .prompt-tabs button { border-radius: 6px; background: transparent; }
body[data-fynix-page="P06"] .app-shell .prompt-tabs button.active { color: #3927d9; background: #e8e4ff; }
body[data-fynix-page="P06"] .app-shell .prompt-textarea-wrap { display: flex; flex-direction: column; padding: 16px; gap: 9px; min-height: 240px; }
body[data-fynix-page="P06"] .app-shell .prompt-textarea-wrap textarea { min-height: 210px; resize: vertical; padding: 12px; font: 12px/1.8 ui-monospace,SFMono-Regular,Consolas,monospace; }
body[data-fynix-page="P06"] .app-shell .prompt-actions { height: auto; min-height: 44px; flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
body[data-fynix-page="P06"] .app-shell .prompt-actions button { min-height: 30px; padding: 6px; }
body[data-fynix-page="P06"] .app-shell .risk-checks { height: auto; padding: 15px 16px; overflow: visible; background: #f4f7ff; }
body[data-fynix-page="P06"] #completeScriptPanel { flex: 1; min-height: 420px; overflow: auto; }

/* P12: real task selection, bound assets, and role-filtered generation/price details. */
body[data-fynix-page="P12"] .app-shell .generation-board { display: grid; grid-template-columns: minmax(270px,.82fr) minmax(300px,1fr) minmax(300px,.95fr); grid-template-rows: minmax(0,1fr); height: auto; min-height: 620px; gap: 16px; }
body[data-fynix-page="P12"] .app-shell .generation-tasks { display: grid; grid-template-rows: auto minmax(0,1fr); min-height: 0; }
body[data-fynix-page="P12"] .app-shell .generation-tasks > header { flex-wrap: wrap; gap: 10px; }
body[data-fynix-page="P12"] .app-shell .generation-table-tools { flex-wrap: wrap; gap: 8px; }
body[data-fynix-page="P12"] .app-shell .generation-table-wrap { padding: 12px; min-height: 150px; overflow: auto; }
body[data-fynix-page="P12"] .app-shell .generation-table { min-width: 0; width: 100%; }
body[data-fynix-page="P12"] .app-shell .generation-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
body[data-fynix-page="P12"] .app-shell .generation-table tbody { display: grid; gap: 12px; }
body[data-fynix-page="P12"] .app-shell .generation-table tr { display: grid; grid-template-columns: 30px 1fr 1fr; grid-template-rows: auto auto auto; align-items: center; padding: 13px; gap: 9px 8px; border: 1px solid #dedfeb; border-radius: 11px; background: #fff; }
body[data-fynix-page="P12"] .app-shell .generation-table tr.selected { border: 2px solid #402bdd; padding: 12px; background: #f5f3ff; box-shadow: none; }
body[data-fynix-page="P12"] .app-shell .generation-table td { display: flex; flex-wrap: wrap; align-items: center; min-width: 0; height: auto; min-height: 20px; gap: 5px; padding: 0; border: 0; font-size: 11px; white-space: normal; }
body[data-fynix-page="P12"] .app-shell .generation-table td:first-child { grid-row: 1/4; align-self: start; padding-top: 2px; }
body[data-fynix-page="P12"] .app-shell .generation-table td:nth-child(2) { grid-column: 2/4; flex-direction: column; align-items: start; }
body[data-fynix-page="P12"] .app-shell .generation-table td:nth-child(2) strong { color: var(--workflow-ink); font-size: 17px; }
body[data-fynix-page="P12"] .app-shell .generation-table td:nth-child(2) small { margin-top: 7px; font: 11px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace; color: #737a90; }
body[data-fynix-page="P12"] .app-shell .generation-table td:nth-child(3)::before { content: "镜头"; color: #7a8094; }
body[data-fynix-page="P12"] .app-shell .generation-table td:nth-child(4)::before { content: "提示词"; color: #7a8094; }
body[data-fynix-page="P12"] .app-shell .generation-table td:nth-child(5)::before { content: "产品图"; color: #7a8094; }
body[data-fynix-page="P12"] .app-shell .generation-table td:nth-child(6)::before { content: "人物图"; color: #7a8094; }
body[data-fynix-page="P12"] .app-shell .generation-table td:nth-child(7)::before { content: "场景"; color: #7a8094; }
body[data-fynix-page="P12"] .app-shell .generation-table td:nth-child(8)::before { content: "风格"; color: #7a8094; }
body[data-fynix-page="P12"] .app-shell .generation-table td:nth-child(9) { grid-column: 2/4; padding-top: 9px; border-top: 1px solid #e5e5f1; }
body[data-fynix-page="P12"] .app-shell .task-confirm { width: 23px; height: 23px; border-radius: 6px; }
body[data-fynix-page="P12"] .app-shell .task-confirm.checked { border-color: #3927d9; background: var(--accent); color: #fff; }
body[data-fynix-page="P12"] .app-shell .fynix2-generation-assets { min-width: 0; min-height: 0; margin: 0; padding: 0; overflow: auto; border-radius: 12px; }
body[data-fynix-page="P12"] .app-shell .task-assets > header { padding: 16px; min-height: 72px; border-bottom: 1px solid var(--workflow-border); background: #fafbff; }
body[data-fynix-page="P12"] .app-shell .asset-binding-grid { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 16px; }
body[data-fynix-page="P12"] .app-shell .asset-binding-slot { height: auto; min-height: 110px; padding: 13px; border: 1px solid var(--workflow-border); border-radius: 9px; background: var(--workflow-soft); }
body[data-fynix-page="P12"] .app-shell .asset-binding-slot img { object-fit: contain; max-height: 200px; border-radius: 7px; }
body[data-fynix-page="P12"] .app-shell .reference-thumbnail-grid { display: flex; flex-wrap: wrap; gap: 10px; }
body[data-fynix-page="P12"] .app-shell .reference-thumbnail { width: min(100%,180px); padding: 8px; border: 1px solid #dce4f5; border-radius: 8px; background: #fff; color: #536079; }
body[data-fynix-page="P12"] .app-shell .reference-thumbnail-image { width: 100%; height: auto; aspect-ratio: 9/16; border-radius: 6px; background: #eef2fb; }
body[data-fynix-page="P12"] .app-shell .reference-thumbnail-image :is(video,img) { width: 100%; height: 100%; max-height: none; object-fit: contain; }
body[data-fynix-page="P12"] .app-shell .reference-thumbnail-name { padding-top: 8px; line-height: 1.6; }
body[data-fynix-page="P12"] .app-shell .bound-asset { padding: 9px; border-radius: 7px; background: #fff; }
body[data-fynix-page="P12"] .app-shell .bound-asset-list { max-height: none; }
body[data-fynix-page="P12"] .app-shell .generation-config { display: grid; grid-template-rows: auto minmax(0,1fr); min-height: 0; }
body[data-fynix-page="P12"] .app-shell .generation-config-scroll { padding: 0; }
body[data-fynix-page="P12"] .app-shell .config-section { padding: 17px; border-bottom: 1px solid var(--workflow-border); }
body[data-fynix-page="P12"] .app-shell .output-spec-grid { grid-template-columns: 1fr; gap: 13px; }
body[data-fynix-page="P12"] .app-shell .output-spec-grid label { gap: 8px; }
body[data-fynix-page="P12"] .app-shell .output-spec-grid select { width: 100%; min-height: 40px; padding: 8px; }
body[data-fynix-page="P12"] .app-shell .continuity-config dl { padding: 12px; border-radius: 8px; background: #eff3ff; }
body[data-fynix-page="P12"] .app-shell .quota-section { padding: 18px; margin: 16px; border: 1px solid var(--workflow-border); border-radius: 10px; background: #eff1ff; }
body[data-fynix-page="P12"] .app-shell .quota-section strong { color: #3927d9; font-size: 22px; }
body[data-fynix-page="P12"] #estimatedCreditsNote { white-space: normal; line-height: 1.65; }

/* P13: full portrait A/B comparison with the original review and recovery controls. */
body[data-fynix-page="P13"] .app-shell .stage-heading > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
body[data-fynix-page="P13"] .app-shell .stage-heading :is(.back-link,.fynix2-page-label,.stage-title-line) { margin: 0; }
body[data-fynix-page="P13"] .app-shell .results-heading-state > span { display: flex; }
body[data-fynix-page="P13"] .app-shell .results-heading-state > i { display: block; }
body[data-fynix-page="P13"] .app-shell .results-board { display: grid; grid-template-columns: minmax(440px,1fr) minmax(270px,.43fr); grid-template-rows: auto minmax(0,1fr); grid-template-areas: "tasks tasks" "preview review"; height: auto; min-height: 660px; gap: 16px; }
body[data-fynix-page="P13"] .app-shell .result-task-panel { grid-area: tasks; display: grid; grid-template-columns: 155px minmax(0,1fr) 190px; grid-template-rows: auto; min-width: 0; min-height: 124px; height: auto; }
body[data-fynix-page="P13"] .app-shell .result-task-panel > header { display: flex; align-items: start; flex-direction: column; justify-content: center; gap: 9px; padding: 12px; border-bottom: 0; border-right: 1px solid var(--workflow-border); }
body[data-fynix-page="P13"] .app-shell .result-task-list { display: flex; align-items: stretch; gap: 9px; min-height: 0; min-width: 0; overflow: auto; padding: 10px; }
body[data-fynix-page="P13"] .app-shell .result-task-item { display: flex; flex: 0 0 190px; gap: 9px; min-width: 0; min-height: 72px; padding: 9px; border: 1px solid #dfe4f2; border-radius: 8px; background: #fff; }
body[data-fynix-page="P13"] .app-shell .result-task-item.selected { border-color: #6550e5; background: #efecff; box-shadow: inset 0 0 0 1px #6550e5; }
body[data-fynix-page="P13"] .app-shell .result-thumb { flex: 0 0 30px; width: 30px; height: 48px; border-radius: 6px; background: #e3e8f6; }
body[data-fynix-page="P13"] .app-shell .result-task-copy { gap: 7px; }
body[data-fynix-page="P13"] .app-shell .result-task-copy :is(em,small) { font-size: 10px; white-space: normal; }
body[data-fynix-page="P13"] .app-shell .batch-meta { display: grid; grid-template-columns: 1fr; gap: 6px; min-width: 0; padding: 10px 12px; border: 0; border-left: 1px solid var(--workflow-border); background: #f7f8ff; }
body[data-fynix-page="P13"] .app-shell .batch-meta > div { display: flex; flex-direction: row; align-items: center; gap: 6px; min-width: 0; padding: 0; border: 0; }
body[data-fynix-page="P13"] .app-shell .batch-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-fynix-page="P13"] .app-shell .result-preview-panel { grid-area: preview; display: grid; grid-template-rows: auto minmax(0,1fr) auto auto auto; min-height: 480px; }
body[data-fynix-page="P13"] .app-shell .comparison-stage { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: center; gap: 16px; padding: 20px; min-height: 350px; background: #f6f7fd; }
body[data-fynix-page="P13"] .app-shell .comparison-stage.current-only { grid-template-columns: 1fr; }
body[data-fynix-page="P13"] .app-shell .compare-frame { display: flex; flex-direction: column; align-items: stretch; flex-shrink: 0; min-height: 0; width: min(100%,212px); height: auto; max-height: none; margin: auto; border: 1px solid #dde1ee; border-radius: 11px; background: #fff; overflow: hidden; box-shadow: 0 2px 4px #293d6c0b; }
body[data-fynix-page="P13"] .app-shell .compare-frame.output-frame { border-color: #a294ec; box-shadow: 0 0 0 1px #a294ec; }
body[data-fynix-page="P13"] .app-shell .compare-frame figcaption { padding: 12px; min-height: 42px; background: #fff; color: #38415a; }
body[data-fynix-page="P13"] .app-shell .portrait-frame { flex: none; width: 100%; height: auto; min-height: 0; max-height: none; aspect-ratio: 9/16; border: 0; border-radius: 0; background: #111827; }
body[data-fynix-page="P13"] .app-shell .portrait-frame video { width: 100%; height: 100%; object-fit: contain; }
body[data-fynix-page="P13"] .app-shell .preview-transport { padding: 12px 16px; gap: 9px; min-height: 60px; background: #fff; }
body[data-fynix-page="P13"] .app-shell .preview-transport #playPreview { height: 35px; width: 35px; border: 0; border-radius: 50%; background: var(--accent-strong); color: #fff; }
body[data-fynix-page="P13"] #previewAudioSource { max-width: 125px; border-color: #dce4f5; background: #f5f6ff; color: #5b6279; }
body[data-fynix-page="P13"] .app-shell .frame-findings { padding: 10px 16px; background: #f4f6ff; border-top: 1px solid #e3e7f3; }
body[data-fynix-page="P13"] .app-shell .review-panel { grid-area: review; display: grid; grid-template-rows: auto minmax(0,1fr); min-height: 0; }
body[data-fynix-page="P13"] .app-shell .review-scroll { min-height: 0; overflow: auto; }
body[data-fynix-page="P13"] :is(.review-decision,.review-issues,.review-note,.version-history) { padding: 16px; }
body[data-fynix-page="P13"] .app-shell .verdict-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
body[data-fynix-page="P13"] .app-shell .verdict-options button { min-height: 70px; height: auto; padding: 10px 5px; border: 1px solid #dde1f0; border-radius: 8px; background: #f1f3ff; color: #4b5369; }
body[data-fynix-page="P13"] .app-shell .verdict-options button[aria-pressed="true"] { border-color: #188d70; background: #e9faf3; color: #087254; }
body[data-fynix-page="P13"] .app-shell .review-note textarea { min-height: 120px; height: auto; border-radius: 8px; background: #fff; line-height: 1.7; }
body[data-fynix-page="P13"] .app-shell .failure-review { padding: 20px 16px; background: #fff; }
body[data-fynix-page="P13"] .app-shell .failure-review dl { grid-template-columns: 1fr; }
body[data-fynix-page="P13"] .app-shell .failure-review :is(button,a) { white-space: normal; max-width: 100%; }
body[data-fynix-page="P13"] .app-shell .shot-export-panel { left: auto; right: 0; max-width: min(640px,100%); max-height: calc(100dvh - 180px); overflow: auto; border: 1px solid #d9ddf0; border-radius: 12px; background: #fff; box-shadow: 0 15px 50px #20264824; }

/* P11: one project table; all existing approval, model and batch controls remain available. */
body[data-fynix-page="P11"] { --mr-radius: 10px; }
body[data-fynix-page="P11"] .app-shell .mr-topbar { grid-column: 2; grid-row: 1; display: flex; min-height: 64px; padding: 12px 24px; gap: 16px; }
body[data-fynix-page="P11"] .app-shell .mr-brand { color: #3426c3; }
body[data-fynix-page="P11"] .app-shell .mr-brand span { color: #778093; }
body[data-fynix-page="P11"] .app-shell .mr-create-panel { position: fixed; z-index: 30; top: 66px; left: 260px; right: 20px; padding: 16px; border: 1px solid #dce4f5; border-radius: 10px; background: #fff; box-shadow: 0 8px 25px #20264819; }
body[data-fynix-page="P11"] .app-shell .mr-main { grid-column: 2; grid-row: 2; min-width: 0; width: 100%; max-width: none; margin: 0; padding: 22px 24px; overflow: auto; background: #f7f8fe; }
body[data-fynix-page="P11"] .app-shell .mr-heading { margin-bottom: 18px; }
body[data-fynix-page="P11"] .app-shell .mr-heading h1 { font-size: 22px; color: var(--workflow-ink); }
body[data-fynix-page="P11"] .app-shell .mr-source-panel { grid-template-columns: 95px minmax(240px,.85fr) minmax(260px,1.1fr); border: 1px solid #dce4f5; border-radius: 11px; background: #fff; padding: 16px; gap: 16px; }
body[data-fynix-page="P11"] .app-shell .mr-source-preview { width: 95px; aspect-ratio: 9/16; border-radius: 8px; background: #edf1fb; }
body[data-fynix-page="P11"] .app-shell .mr-source-preview video { max-height: none; object-fit: contain; }
body[data-fynix-page="P11"] .app-shell .mr-plan-form { border-color: #e0e5f2; padding-left: 16px; }
body[data-fynix-page="P11"] .app-shell .mr-workbench { border-color: #dce4f5; border-radius: 11px; }
body[data-fynix-page="P11"] .app-shell .mr-table-heading { padding: 16px; background: #fff; }
body[data-fynix-page="P11"] .app-shell .mr-generation-bar { padding: 14px 16px; border-color: #dce4f5; background: #f0f3ff; }
body[data-fynix-page="P11"] :is(input:not([type=checkbox]),select,textarea) { border-color: #d9dfef; border-radius: 6px; background: #fff; color: var(--workflow-ink); }
body[data-fynix-page="P11"] .app-shell .mr-button { border-color: #d8deef; border-radius: 6px; background: #fff; color: #515a73; }
body[data-fynix-page="P11"] .app-shell .mr-button.primary { color: #fff; background: var(--accent-strong); border-color: var(--accent-strong); }
body[data-fynix-page="P11"] .app-shell .mr-toolbar-meta { background: #fff; }
body[data-fynix-page="P11"] .app-shell .mr-table { min-width: 1510px; }
body[data-fynix-page="P11"] .app-shell .mr-col-id { width: 115px; }
body[data-fynix-page="P11"] .app-shell .mr-col-change { width: 190px; }
body[data-fynix-page="P11"] .app-shell .mr-col-prompt { width: 230px; }
body[data-fynix-page="P11"] .app-shell .mr-col-images { width: 420px; }
body[data-fynix-page="P11"] .app-shell .mr-col-results { width: 250px; }
body[data-fynix-page="P11"] .app-shell .mr-table th { padding: 16px 14px; border-color: #dce4f5; background: #eff2ff; color: #5b6279; }
body[data-fynix-page="P11"] .app-shell .mr-table td { padding: 18px 14px; border-color: #e4e8f5; background: #fff; }
body[data-fynix-page="P11"] .app-shell .mr-table tr.is-selected td { background: #f7f5ff; }
body[data-fynix-page="P11"] .app-shell .mr-table .mr-sticky-cell { background: #fff; box-shadow: 1px 0 0 #dce4f5; }
body[data-fynix-page="P11"] .app-shell .mr-table tr.is-selected .mr-sticky-cell { background: #f7f5ff; }
body[data-fynix-page="P11"] .app-shell .mr-candidates { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
body[data-fynix-page="P11"] .app-shell .mr-candidate { flex: 0 0 156px; min-width: 0; padding: 7px; border: 1px solid #dfe3ee; border-radius: 9px; background: #fff; }
body[data-fynix-page="P11"] .app-shell .mr-thumb { aspect-ratio: 9/16; border-radius: 7px; border-color: #dce4f5; background: #eef1f9; }
body[data-fynix-page="P11"] .app-shell .mr-thumb img { object-fit: contain; }
body[data-fynix-page="P11"] .app-shell .mr-candidate:has(.mr-thumb.is-approved) { border: 2px solid #432bdc; padding: 6px; background: #f1eeff; }
body[data-fynix-page="P11"] .app-shell .mr-thumb .mr-approved-mark { background: var(--accent); color: #fff; }
body[data-fynix-page="P11"] .app-shell .mr-cell-empty { min-height: 220px; border-color: #cdd5ea; background: #fafbff; }
body[data-fynix-page="P11"] .app-shell .mr-inline-field textarea { min-height: 150px; line-height: 1.85; }
body[data-fynix-page="P11"] .app-shell .mr-empty { min-height: 260px; color: #737e94; background: #fff; }

@media (min-width:1181px) {
  body[data-fynix-page] .app-shell .stage-workspace:is(.creative-workspace,.generation-workspace,.results-workspace,.analysis-workspace) { padding: 18px 22px 14px; }
  body[data-fynix-page="P05"] .app-shell .analysis-board, body[data-fynix-page="P06"] .app-shell .creative-board, body[data-fynix-page="P12"] .app-shell .generation-board { flex: 1; min-height: 0; height: auto; }
  body[data-fynix-page="P05"] .app-shell .analysis-video-frame { height: calc(100% - 32px); min-height: 0; max-height: none; }
  body[data-fynix-page="P06"] .app-shell .creative-source-preview > div { min-height: 0; }
  body[data-fynix-page="P13"] .app-shell .results-workspace { overflow: auto; }
  body[data-fynix-page="P13"] .app-shell .results-board { flex: none; min-height: 730px; height: auto; grid-template-rows: auto minmax(590px,1fr); }
  body[data-fynix-page="P13"] .app-shell .result-preview-panel { min-height: 0; }
  body[data-fynix-page="P13"] .app-shell .comparison-stage { min-height: 455px; }
  body[data-fynix-page="P13"] .app-shell .stage-actionbar { min-height: 64px; }
}
@media (min-width:1800px) {
  body[data-fynix-page] .app-shell .stage-workspace { padding: 28px 30px 20px; }
  body[data-fynix-page="P04"] .app-shell .reference-video .video-frame { max-width: 360px; width: 100%; }
  body[data-fynix-page="P06"] .app-shell .creative-board { grid-template-columns: 200px minmax(330px,.85fr) minmax(500px,1.2fr); }
  body[data-fynix-page="P12"] .app-shell .generation-board { grid-template-columns: minmax(330px,.8fr) minmax(420px,1.15fr) minmax(350px,.9fr); gap: 20px; }
  body[data-fynix-page="P13"] .app-shell .results-board { grid-template-columns: minmax(500px,1fr) 370px; }
}
@media (max-width:1180px) {
  body[data-fynix-page] .app-shell .stage-workspace { overflow: auto; height: auto; min-height: 0; padding: 18px; }
  body[data-fynix-page] .app-shell .stage-heading { flex-wrap: wrap; gap: 12px; }
  body[data-fynix-page] .app-shell .stage-steps { overflow-x: auto; }
  body[data-fynix-page] .app-shell .stage-steps > a { flex: 0 0 140px; }
  body[data-fynix-page="P04"] .app-shell .material-board { grid-template-columns: minmax(270px,.8fr) minmax(360px,1fr); gap: 14px; }
  body[data-fynix-page="P05"] .app-shell .analysis-board { grid-template-columns: minmax(260px,.8fr) minmax(340px,1fr); min-height: 660px; }
  body[data-fynix-page="P06"] .app-shell .creative-board { grid-template-columns: 155px minmax(250px,1fr); grid-template-areas: "shots source" "editor editor"; grid-template-rows: 540px auto; }
  body[data-fynix-page="P06"] .app-shell .fynix2-creative-editor { overflow: visible; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  body[data-fynix-page="P12"] .app-shell .generation-board { grid-template-columns: minmax(260px,.8fr) minmax(330px,1fr); grid-template-rows: 560px auto; }
  body[data-fynix-page="P12"] .app-shell .generation-config { grid-column: 1/-1; }
  body[data-fynix-page="P12"] .app-shell .generation-config-scroll { display: grid; grid-template-columns: 1fr 1fr; }
  body[data-fynix-page="P13"] .app-shell .results-board { grid-template-columns: minmax(400px,1fr) minmax(260px,.6fr); grid-template-rows: auto 670px; }
  body[data-fynix-page="P13"] .app-shell .result-task-panel { grid-template-columns: 145px minmax(0,1fr); grid-template-rows: minmax(120px,auto) auto; height: auto; min-height: 0; }
  body[data-fynix-page="P13"] .app-shell .batch-meta { grid-column: 1/-1; display: flex; flex-wrap: wrap; gap: 12px; border-left: 0; border-top: 1px solid #e1e5f1; }
  body[data-fynix-page="P13"] .app-shell .results-heading-state { display: flex; flex-wrap: wrap; }
  body[data-fynix-page="P13"] .app-shell .comparison-stage { padding: 12px; gap: 10px; }
  body[data-fynix-page="P11"] .app-shell .mr-source-panel { grid-template-columns: 85px 1fr; }
  body[data-fynix-page="P11"] .app-shell .mr-plan-form { grid-column: 1/-1; border-left: 0; border-top: 1px solid #e1e5f1; padding: 16px 0 0; }
}
@media (max-width:850px) {
  body[data-fynix-page] .app-shell .stage-workspace { padding: 14px; }
  body[data-fynix-page] .app-shell .stage-actionbar { position: relative; bottom: auto; }
  body[data-fynix-page] .app-shell .stage-actionbar .action-readiness { flex-basis: 100%; }
  body[data-fynix-page="P04"] .app-shell .material-board { grid-template-columns: 1fr; grid-template-areas: "reference" "product" "support" "brief"; }
  body[data-fynix-page="P04"] .app-shell .board-reference { position: static; }
  body[data-fynix-page="P04"] .app-shell .reference-video .video-frame { width: 240px; }
  body[data-fynix-page="P05"] .app-shell .analysis-board { grid-template-columns: 1fr; grid-template-rows: 550px 650px; height: auto; }
  body[data-fynix-page="P05"] .app-shell .analysis-video-frame { width: 260px; max-height: none; min-height: 0; }
  body[data-fynix-page="P06"] .app-shell .creative-board { grid-template-columns: 140px minmax(0,1fr); }
  body[data-fynix-page="P06"] .app-shell .fynix2-creative-editor { grid-template-columns: 1fr; }
  body[data-fynix-page="P12"] .app-shell .generation-board { grid-template-columns: 1fr; grid-template-rows: 480px auto auto; }
  body[data-fynix-page="P12"] .app-shell .generation-config-scroll { display: block; }
  body[data-fynix-page="P13"] .app-shell .results-board { grid-template-columns: 1fr; grid-template-rows: auto 660px auto; grid-template-areas: "tasks" "preview" "review"; }
  body[data-fynix-page="P13"] .app-shell .review-panel { min-height: 520px; }
  body[data-fynix-page="P13"] .app-shell .results-actionbar #exportPassed { display: inline-flex; }
  body[data-fynix-page="P11"] .app-shell .mr-main { padding: 16px; }
  body[data-fynix-page="P11"] .app-shell .mr-topbar { flex-wrap: wrap; padding: 12px; gap: 8px; }
  body[data-fynix-page="P11"] .app-shell .mr-project-picker { width: 100%; margin-left: 0; }
  body[data-fynix-page="P11"] .app-shell .mr-create-panel { left: 12px; right: 12px; top: 110px; }
  body[data-fynix-page="P11"] .app-shell .mr-create-panel form { flex-wrap: wrap; }
  body[data-fynix-page="P11"] .app-shell .mr-generation-group.video-group { border-left: 0; padding-left: 0; }
}
@media (prefers-reduced-motion:reduce) {
  body[data-fynix-page] *,body[data-fynix-page] *::before,body[data-fynix-page] *::after { scroll-behavior: auto; }
}

@media(max-width:980px){body[data-fynix-page="P11"] .app-shell .mr-topbar,body[data-fynix-page="P11"] .app-shell .mr-main{grid-column:1;}body[data-fynix-page="P11"] .app-shell .mr-main{padding-bottom:82px;}}
