.h3-shell { min-height: 100vh; display: grid; grid-template-columns: 176px minmax(0, 1fr); }
.h3-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 176px; display: flex; flex-direction: column; padding: 22px 12px 14px; border-right: 1px solid var(--line); background: var(--surface); }
.h3-sidebar .brand { margin-bottom: 31px; }
.h3-nav { display: grid; gap: 4px; }
.h3-runtime-card { display: flex; align-items: flex-start; gap: 10px; padding: 15px 10px 5px; border-top: 1px solid var(--line); }
.h3-runtime-card > div { display: grid; min-width: 0; }
.h3-runtime-card strong { font-size: 12px; }
.h3-runtime-card small { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h3-workspace { grid-column: 2; min-width: 0; }
.h3-topbar { position: sticky; top: 0; z-index: 15; display: flex; min-height: 68px; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 3vw, 42px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); }
.h3-context { display: flex; align-items: center; gap: 12px; }
.h3-context > span { color: var(--muted); font: 700 10px/1 var(--mono); letter-spacing: .1em; }
.h3-context label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.h3-context select { width: 210px; min-height: 36px; }
.h3-mobile-menu { display: none; }
.h3-workspace main { width: min(1600px, calc(100% - 40px)); padding-top: 22px; }
.h3-view { animation: view-in 180ms cubic-bezier(.2, 0, 0, 1); }
.h3-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.h3-hero h1 { max-width: 720px; margin: 4px 0 6px; font-size: 24px; font-weight: 600; line-height: 1.25; }
.h3-hero > div:first-child > p:last-child { max-width: 740px; margin: 0; color: var(--muted); }
.h3-health { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 11px; }
.h3-health span { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); }
.h3-health.ready span { background: var(--success); }
.h3-health.error span { background: var(--danger); }
.h3-health strong { font-weight: 600; }
.h3-compose { display: grid; grid-template-columns: minmax(0, 1fr) clamp(350px, 29vw, 420px); gap: 20px; align-items: start; }
.compose-main, .compose-side { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.compose-main { padding: 20px; }
.compose-side { position: sticky; top: 84px; padding: 18px; max-height: calc(100dvh - 100px); overflow-y: auto; scrollbar-width: thin; }
.compose-main .section-heading { align-items: flex-start; margin-bottom: 18px; }
.compose-main .section-heading h2, .side-heading h2 { margin: 2px 0 0; font-size: 18px; font-weight: 600; }
.step-label { margin: 0; color: var(--accent); font: 700 10px/1.4 var(--mono); letter-spacing: .12em; }
.button.compact { min-height: 34px; padding-inline: 11px; font-size: 11px; }
.prompt-field { color: var(--ink); }
.prompt-field textarea { min-height: 188px; padding: 15px 16px; border-radius: 11px; font-size: 15px; line-height: 1.75; }
.prompt-field textarea.is-dragging { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.prompt-reference-tools { display: grid; gap: 8px; margin-top: 10px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas); }
.prompt-reference-tools[hidden] { display: none; }
.prompt-reference-tools > div:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.prompt-reference-tools strong { font-size: 10px; }
.prompt-reference-tools span { color: var(--muted); font-size: 9px; }
.prompt-references { display: flex; flex-wrap: wrap; gap: 6px; }
.prompt-reference-chip { display: inline-flex; max-width: 100%; align-items: center; gap: 5px; min-height: 28px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 650 9px/1 var(--mono); cursor: pointer; }
.prompt-reference-chip:hover, .prompt-reference-chip:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.prompt-reference-chip small { max-width: 110px; overflow: hidden; color: var(--muted); font: 400 9px/1.2 var(--sans); text-overflow: ellipsis; white-space: nowrap; }
.prompt-hints { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.prompt-hints span { padding: 3px 8px; border-radius: 5px; background: var(--surface-subtle); color: var(--muted); font-size: 10px; }
.material-heading { margin-top: 22px; }
.field-note { color: var(--faint); font-size: 10px; }
.media-inputs { display: grid; gap: 14px; }
.h3-media-field { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.h3-media-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.h3-media-title > div { display: grid; gap: 3px; }
.h3-media-title strong { font-size: 13px; }
.h3-media-title small { max-width: 560px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.media-count { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; background: var(--surface); color: var(--muted); font: 650 10px/1 var(--mono); }
.reference-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 9px; }
.reference-empty { grid-column: 1 / -1; display: grid; gap: 3px; padding: 15px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); }
.reference-empty strong { color: var(--ink); font-size: 11px; }
.reference-empty span { font-size: 10px; }
.reference-card { position:relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.reference-card[draggable="true"], .asset-library-item[draggable="true"] { cursor: grab; }
.reference-card[draggable="true"]:active, .asset-library-item[draggable="true"]:active { cursor: grabbing; }
.reference-visual { position: relative; display: grid; height: 104px; place-items: center; overflow: hidden; background: var(--surface-subtle); }
.reference-visual img { width: 100%; height: 100%; object-fit: cover; }
.media-kind-icon { color: var(--accent); font-size: 25px; }
.reference-index { position: absolute; left: 7px; bottom: 7px; padding: 3px 6px; border-radius: 5px; background: rgba(8, 12, 10, .78); color: #fff; font: 700 9px/1 var(--mono); letter-spacing: .03em; }
.reference-copy { display: grid; gap: 2px; padding: 9px 9px 5px; }
.reference-copy strong, .asset-library-copy strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.reference-copy small, .asset-library-copy small { overflow: hidden; color: var(--faint); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.reference-actions { display: grid; grid-template-columns: 30px 30px 1fr; gap: 4px; padding: 4px 7px 8px; }
.mini-action { min-height: 28px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; }
.mini-action:hover:not(:disabled), .mini-action:focus-visible { border-color: var(--line-strong); background: var(--surface-subtle); color: var(--ink); }
.mini-action.remove:hover { color: var(--danger); }
.mini-action:disabled { opacity: .35; cursor: default; }
.media-drop-zone { position: relative; display: grid; min-height: 78px; margin-top: 10px; place-items: center; align-content: center; gap: 3px; overflow: hidden; border: 1px dashed var(--line-strong); border-radius: 9px; background: color-mix(in srgb, var(--surface) 60%, transparent); color: var(--muted); text-align: center; cursor: pointer; transition: border-color 140ms ease, background 140ms ease; }
.media-drop-zone:hover, .media-drop-zone.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.media-drop-zone.is-uploading { pointer-events: none; opacity: .68; }
.media-drop-zone .drop-icon { color: var(--accent); font-size: 18px; line-height: 1; }
.media-drop-zone strong { color: var(--ink); font-size: 11px; }
.media-drop-zone small { font-size: 9px; }
.media-drop-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.asset-library { margin-top: 10px; }
.asset-library summary { width: fit-content; color: var(--accent); font-size: 10px; cursor: pointer; }
.asset-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 7px; margin-top: 9px; }
.asset-library-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) 22px; gap: 9px; align-items: center; min-width: 0; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
.asset-library-item:hover, .asset-library-item.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.asset-library-item.is-disabled { opacity: .5; cursor: not-allowed; }
.asset-library-thumb { display: grid; width: 44px; height: 38px; place-items: center; overflow: hidden; border-radius: 5px; background: var(--surface-subtle); }
.asset-library-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-library-copy { display: grid; min-width: 0; gap: 2px; }
.asset-library-check { color: var(--accent); font-weight: 700; text-align: center; }
.asset-library-empty { grid-column: 1 / -1; padding: 10px; color: var(--muted); font-size: 10px; }
.settings-heading { margin-top: 36px; }
.workflow-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.preset-card { display: grid; gap: 5px; min-height: 78px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); color: var(--ink); text-align: left; cursor: pointer; }
.preset-card:hover, .preset-card.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.preset-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.preset-title strong { font-size: 12px; }
.preset-title em { padding: 3px 6px; border-radius: 999px; background: var(--accent); color: var(--surface); font-size: 8px; font-style: normal; }
.preset-card small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.h3-advanced { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.h3-advanced summary { color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.h3-advanced summary span { margin-left: 7px; color: var(--faint); font-size: 10px; font-weight: 400; }
.scalar-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 16px; }
.scalar-inputs .wide { grid-column: 1 / -1; }
.scalar-field { display: grid; align-content: start; gap: 7px; min-width: 0; }
.scalar-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.scalar-heading label { color: var(--ink); font-size: 11px; font-weight: 600; }
.scalar-heading span { color: var(--faint); font-size: 9px; }
.scalar-help { color: var(--faint); font-size: 9px; }
.scalar-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.resolution-preview { display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(125px, .75fr) auto minmax(125px, .75fr); gap: 12px; align-items: center; margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(135deg, var(--canvas), var(--surface)); }
.resolution-preview[hidden] { display: none; }
.resolution-preview.has-error { border-color: #d9a5a5; background: #fff4f4; }
.resolution-preview.has-error #second-pass-resolution-value,
.resolution-preview.has-error #second-pass-resolution-detail { color: #7d2222; }
.resolution-preview-copy { display: grid; gap: 3px; }
.resolution-preview-copy strong { font-size: 12px; }
.resolution-preview-copy span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.resolution-stage { display: grid; gap: 2px; min-height: 66px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.resolution-stage > span { color: var(--muted); font-size: 9px; }
.resolution-stage > strong { font: 650 15px/1.25 var(--mono); letter-spacing: -.03em; }
.resolution-stage > small { color: var(--faint); font-size: 8px; }
.resolution-stage.is-final { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.resolution-stage.is-final > strong { color: var(--accent); }
.resolution-arrow { color: var(--accent); font-size: 17px; }
.h3-lora { margin-top: 20px; }
.h3-lora .scalar-field:nth-child(odd) { grid-column: 1 / -1; }
.lora-footnote { margin: 12px 0 0; color: var(--faint); font-size: 9px; }
.slider-input-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 10px; align-items: center; }
.slider-input-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.slider-number { min-width: 0; font-family: var(--mono); text-align: center; }
.segmented-control { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); }
.segment { min-height: 39px; padding: 7px 8px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.segment:last-child { border-right: 0; }
.segment:hover { color: var(--ink); }
.segment.is-selected { background: var(--surface); color: var(--accent); box-shadow: inset 0 -2px var(--accent); font-weight: 650; }
.submit-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.submit-bar > div { display: grid; }
.submit-bar strong { font-size: 12px; }
.submit-bar small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.h3-submit { min-width: 145px; }
.side-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.current-run { min-height: 190px; padding: 16px; border-radius: 10px; background: var(--canvas); }
.current-run.empty { display: grid; place-items: center; color: var(--muted); font-size: 11px; text-align: center; }
.current-run h3 { margin: 0; font-size: 13px; }
.current-run .status-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 10px; }
.current-run .progress-track { width: 100%; height: 7px; margin-top: 14px; }
.current-run .current-node { min-height: 34px; margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.progress-stages { display: grid; gap: 7px; margin: 14px 0 0; padding: 0; list-style: none; }
.progress-stage { display: grid; grid-template-columns: 15px minmax(0, 1fr); gap: 7px; align-items: center; color: var(--faint); font-size: 9px; }
.stage-dot { display: grid; width: 13px; height: 13px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 7px; }
.progress-stage.is-active { color: var(--ink); font-weight: 650; }
.progress-stage.is-active .stage-dot { border: 4px solid var(--accent-soft); background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.progress-stage.is-done { color: var(--muted); }
.progress-stage.is-done .stage-dot { border-color: var(--success); background: var(--success); color: #fff; }
.elapsed-time { margin: -26px 0 0 !important; color: var(--faint) !important; font: 500 9px/1 var(--mono) !important; text-align: right; }
.queue-eta { margin: 8px 0 0; color: var(--accent); font-size: 13px; font-weight: 650; }
.current-run .button { width: 100%; margin-top: 14px; }
.recent-results { margin-top: 19px; padding-top: 17px; border-top: 1px solid var(--line); }
.recent-results-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.recent-results-heading h3 { margin: 2px 0 0; font-size: 13px; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 9px; cursor: pointer; }
.recent-result-list { display: grid; max-height: 470px; gap: 9px; padding-right: 3px; overflow-y: auto; scrollbar-width: thin; }
.recent-results-empty { padding: 13px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.h3-work-card.is-compact { display: grid; grid-template-columns: 92px minmax(0, 1fr); border-radius: 9px; }
.h3-work-card.is-compact .h3-work-cover { aspect-ratio: auto; min-height: 108px; border-right: 1px solid var(--line); border-bottom: 0; }
.h3-work-card.is-compact .h3-work-copy { min-width: 0; padding: 10px; }
.h3-work-card.is-compact .h3-work-copy h3 { font-size: 10px; }
.h3-work-card.is-compact .h3-work-copy p { margin-bottom: 8px; font-size: 8px; }
.h3-work-card.is-compact .h3-work-actions { gap: 5px; }
.h3-work-card.is-compact .h3-work-actions .button { min-height: 29px; padding-inline: 7px; font-size: 8px; }
.side-ledger { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--line); }
.side-ledger div { display: grid; padding: 10px 8px; background: var(--surface); text-align: center; }
.side-ledger span { color: var(--muted); font-size: 9px; }
.side-ledger strong { margin-top: 2px; font-size: 15px; }
.h3-run-list { border-top: 1px solid var(--line); }
.h3-run-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; padding: 19px 4px; border-bottom: 1px solid var(--line); }
.h3-run-row h3 { margin: 0; font-size: 14px; }
.h3-run-row p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.h3-run-actions { display: flex; align-items: center; gap: 8px; }
.h3-run-row .progress-track { max-width: 600px; }
.h3-work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.h3-work-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.h3-work-cover { display: grid; width: 100%; aspect-ratio: 16 / 10; place-items: center; padding: 0; overflow: hidden; border: 0; border-bottom: 1px solid var(--line); background: var(--surface-subtle); color: var(--muted); cursor: pointer; }
.h3-work-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 180ms ease; }
.h3-work-card:hover .h3-work-cover img { transform: scale(1.015); }
.h3-work-copy { padding: 15px; }
.h3-work-copy h3 { margin: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.h3-work-copy p { margin: 4px 0 12px; color: var(--muted); font-size: 10px; }
.h3-work-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.h3-work-actions .button { min-height: 34px; padding-inline: 10px; font-size: 10px; }
.h3-preview-dialog { width: min(940px, calc(100% - 30px)); max-width: none; border: 0; padding: 0; border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--overlay-shadow); }
.h3-preview-shell { padding: 20px; }
.h3-preview-shell > header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.h3-preview-shell h2 { margin: 2px 0 0; font-size: 17px; }
.h3-preview-stage { display: grid; min-height: min(60vh, 600px); place-items: center; overflow: hidden; border-radius: 10px; background: #080a09; color: #cbd3cd; }
.h3-preview-stage video, .h3-preview-stage img { display: block; max-width: 100%; max-height: 60vh; }
.h3-preview-shell footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.h3-preview-shell .form-message { text-align: right; }

.creation-modes { display: flex; flex-wrap: wrap; gap: 7px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.mobile-workbench-nav { display: none; }
.compose-main, .compose-side { scroll-margin-top: 120px; }
.creation-mode { display: grid; gap: 3px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); cursor: pointer; text-align: left; }
.creation-mode strong { font-size: 13px; }
.creation-mode small { font-size: 11px; color: var(--muted); }
.creation-mode[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.creation-mode[aria-pressed="true"] strong { color: var(--accent); }
.mode-description { margin: 10px 0 20px; color: var(--muted); font-size: 13px; }
.mode-workflow-field { display: grid; gap: 6px; margin-top: 12px; }
.mode-pending { min-height: 300px; padding: 30px 4px; }
.mode-pending p { max-width: 48ch; color: var(--muted); line-height: 1.7; }
.mode-pending h2 { font-size: 22px; }
.compose-side .submit-bar { display: flex; flex-direction: column-reverse; align-items: stretch; margin: 0 0 12px; padding: 0 0 12px; border-top: 0; border-bottom: 1px solid var(--line); gap: 10px; }
.compose-side .submit-bar strong { font-size: 12px; line-height: 1.6; }
.compose-side .submit-bar small { font-size: 11px; }
.compose-side .h3-submit { width: 100%; min-height: 48px; font-size: 16px; }
.task-selector { display: grid; gap: 6px; margin: 12px 0; font-size: 12px; color: var(--muted); }
.task-selector select { width: 100%; min-width: 0; font-size: 12px; }
.current-run { min-height: 0; }
.current-run .elapsed-time { margin: 10px 0 0 !important; text-align: left; font-size: 12px !important; }
.current-outputs { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.current-outputs #current-output-list { display: grid; gap: 12px; }
.current-outputs .h3-work-copy { padding: 12px; }
.current-outputs .h3-work-copy h3 { font-size: 12px; overflow-wrap: anywhere; }
.current-outputs .h3-work-actions .button { min-height: 36px; font-size: 12px; padding: 6px 9px; }
.current-outputs .h3-work-cover { aspect-ratio: 16 / 9; }
.current-output-count, .preview-pending { font-size: 12px; color: var(--muted); }
.recent-result-list { max-height: 260px; }
.enhancement-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.enhancement-item { padding: 22px 0; border-bottom: 1px solid var(--line); }
.enhancement-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.enhancement-heading h2 { font-size: 18px; margin: 0; }
.enhancement-item p { color: var(--muted); line-height: 1.7; }
.h3-nav small { font-size: 10px; }
.h3-media-field { padding: 12px; background: var(--surface); }
.media-drop-zone { min-height: 80px; }
.h3-media-field summary { cursor: pointer; }
.reference-board:has(> .reference-empty) { display: none; }
.h3-lora .scalar-inputs { grid-template-columns: minmax(0, 1.7fr) minmax(140px, 1fr); align-items: end; }
.h3-lora .scalar-field:nth-child(odd) { grid-column: auto; }
.prompt-field textarea { min-height: 150px; }
.h3-preview-stage img { max-width: 100%; max-height: 70dvh; object-fit: contain; }
[hidden] { display: none !important; }

@media (min-width: 1051px) and (max-width: 1250px) {
  .h3-shell { grid-template-columns: 150px minmax(0, 1fr); }
  .h3-sidebar { width: 150px; padding-inline: 8px; }
  .h3-compose { grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; }
  .h3-health { max-width: 300px; }
  .resolution-preview { grid-template-columns: 1fr 1fr; }
  .resolution-preview-copy { grid-column: 1 / -1; }
  .resolution-arrow { display: none; }
}
@media (max-width: 1050px) {
  .mobile-workbench-nav { position: sticky; top: 68px; z-index: 14; display: flex; gap: 8px; padding: 10px 0; background: var(--canvas); margin-bottom: 12px; }
  .mobile-workbench-nav button { flex: 1; min-height: 40px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); cursor: pointer; }
  .h3-compose { grid-template-columns: minmax(0, 1fr); }
  .compose-side { position: static; max-height: none; overflow: visible; }
  .compose-side .submit-bar { position: sticky; bottom: 8px; z-index: 10; background: var(--surface); }
  .h3-hero { flex-wrap: wrap; }
  .enhancement-list { grid-template-columns: 1fr; }
  .current-run { min-height: 130px; }
  .h3-work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .h3-shell { display: block; }
  .h3-sidebar { visibility: hidden; transform: translateX(-100%); transition: transform 180ms ease, visibility 0s linear 180ms; }
  .h3-sidebar.is-open { visibility: visible; transform: translateX(0); box-shadow: var(--overlay-shadow); transition-delay: 0s; }
  .h3-workspace { grid-column: auto; }
  .h3-mobile-menu { display: grid; }
  .h3-context > span { display: none; }
  .h3-context label { display: block; font-size: 0; }
  .h3-context select { width: min(31vw, 132px); min-height: 34px; font-size: 10px; }
  .h3-topbar { padding-inline: 14px; }
  .h3-workspace main { width: calc(100% - 28px); padding-top: 28px; }
  .h3-hero { display: grid; }
  .h3-health { justify-self: start; }
  .h3-compose { gap: 14px; }
  .compose-main { padding: 18px; }
  .compose-main .section-heading { display: grid; }
  .workflow-presets { grid-template-columns: 1fr; }
  .reference-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-library-grid { grid-template-columns: 1fr; }
  .segmented-control { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-columns: auto; grid-auto-flow: row; }
  .segment { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .segment:nth-child(2n) { border-right: 0; }
  .scalar-inputs { grid-template-columns: 1fr; }
  .h3-lora .scalar-inputs { grid-template-columns: 1fr; }
  .resolution-preview { grid-template-columns: 1fr 1fr; }
  .resolution-preview-copy { grid-column: 1 / -1; }
  .resolution-arrow { display: none; }
  .h3-lora .scalar-field:nth-child(odd) { grid-column: auto; }
  .submit-bar { display: grid; }
  .h3-submit { width: 100%; }
  .h3-run-row { grid-template-columns: 1fr; }
  .h3-run-actions { justify-content: flex-start; }
  .h3-work-grid { grid-template-columns: 1fr; }
  .h3-preview-shell footer { flex-wrap: wrap; }
}

@media (max-width: 430px) {
  .reference-board { grid-template-columns: 1fr; }
  .h3-media-title { display: grid; }
  .media-count { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .h3-view, .h3-sidebar, .h3-work-cover img, .media-drop-zone { animation: none; transition: none; }
}

/* 身份入口始终留在顶栏，后台链接仅由真实会话角色展示。 */
.h3-topbar .top-actions { flex: 0 0 auto; }
.h3-admin-shortcut { color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.h3-topbar .user-menu { color: var(--ink); }
.h3-topbar .user-menu:focus-visible, .h3-admin-shortcut:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 760px) {
  .h3-topbar { gap: 7px; padding-inline: 10px; }
  .h3-topbar .user-menu > span:last-child { display: grid; }
  .h3-topbar .user-menu strong { max-width: 70px; }
  .h3-topbar .user-menu small, .h3-admin-shortcut { display: none; }
  .h3-topbar .avatar { display: none; }
  .h3-topbar .top-actions { gap: 2px; }
  .h3-context { gap: 6px; min-width: 0; }
  .h3-topbar .user-popover { min-width: 180px; max-width: calc(100vw - 20px); }
}

/* 独立高清修复沿用原素材和队列，收起无关的提示词与导演列。 */
[data-h3-panel="create"] .h3-compose.is-restoration { grid-template-columns:minmax(0,1fr) minmax(280px,.8fr); }
[data-h3-panel="create"] .h3-compose.is-restoration .director-column,[data-h3-panel="create"] .h3-compose.is-restoration .final-column { display:none; }
@media(max-width:760px){[data-h3-panel="create"] .h3-compose.is-restoration{grid-template-columns:minmax(0,1fr);}}

[data-h3-panel="create"] .h3-compose.is-local-image { grid-template-columns:minmax(220px,.9fr) minmax(260px,1.15fr) minmax(280px,1fr); }
[data-h3-panel="create"] .h3-compose.is-local-image .director-column,[data-h3-panel="create"] .h3-compose.is-local-image #prompt-reference-tools,[data-h3-panel="create"] .h3-compose.is-local-image .source-role,[data-h3-panel="create"] .h3-compose.is-restoration .source-role { display:none; }
@media(max-width:1100px){[data-h3-panel="create"] .h3-compose.is-local-image{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:760px){[data-h3-panel="create"] .h3-compose.is-local-image{grid-template-columns:minmax(0,1fr);}}
.reference-drag-handle { display:inline-flex; width:fit-content; padding:4px 7px; margin-top:5px; border:1px dashed var(--line); border-radius:5px; color:var(--muted); font-size:11px; cursor:grab; user-select:none; }
.reference-drag-handle:active { cursor:grabbing; }
.reference-drag-handle:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.h3-compose.is-local-image .reference-drag-handle,.h3-compose.is-restoration .reference-drag-handle { display:none; }

/* 全局导航、创作上下文、当前参数三层分工；旧页面路由与输入节点保持。 */
.h3-shell { grid-template-columns:204px minmax(0,1fr); }
.h3-shell .h3-sidebar { width:204px; padding:22px 13px 14px; overflow-y:auto; }
.h3-shell .h3-sidebar .brand { margin-bottom:22px; }
.h3-shell .h3-nav { gap:20px; }
.nav-group { display:grid; gap:3px; min-width:0; }
.nav-group h2 { margin:0 10px 6px; color:var(--faint); font-size:10px; font-weight:650; letter-spacing:.09em; }
.h3-shell .nav-item { min-height:39px; font-size:12px; gap:9px; border-radius:7px; }
.h3-shell .h3-workspace main { width:min(1840px,calc(100% - 44px)); padding-top:22px; }
.workspace-context-bar { margin:0 0 25px; border-bottom:1px solid var(--line); }
.workspace-breadcrumb { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-bottom:16px; }
.workspace-breadcrumb strong { font-size:19px; font-weight:650; }
.workspace-breadcrumb span { color:var(--muted); font-size:12px; line-height:1.6; }
.workspace-context-tabs { display:flex; align-items:center; gap:6px; }
.workspace-context-tabs button { display:flex; align-items:center; gap:8px; padding:12px 22px; border:0; border-bottom:3px solid transparent; border-radius:7px 7px 0 0; background:transparent; color:var(--muted); font-size:13px; cursor:pointer; }
.workspace-context-tabs button[aria-pressed="true"] { border-bottom-color:var(--accent); background:var(--accent-soft); color:var(--accent); font-weight:650; }
.workspace-context-tabs button:hover { background:var(--surface); }
.workspace-source-tabs { display:flex; align-items:center; flex-wrap:wrap; gap:7px; padding:13px 0; border-top:1px solid var(--line); }
.workspace-source-tabs button { min-height:33px; padding:6px 13px; border:1px solid var(--line); border-radius:6px; background:var(--surface); color:var(--muted); font-size:12px; cursor:pointer; }
.workspace-source-tabs button[aria-pressed="true"] { border-color:var(--accent); background:var(--accent-soft); color:var(--accent); }
.workspace-source-tabs span { margin-left:6px; color:var(--faint); font-size:11px; }
.h3-shell [data-h3-panel="create"] .h3-compose { grid-template-columns:minmax(0,1fr) 350px; gap:22px; align-items:start; }
.h3-shell [data-h3-panel="create"] .compose-main { display:block; border:0; padding:0; background:transparent; min-width:0; }
.h3-shell #h3-editor { display:grid; grid-template-columns:minmax(230px,.78fr) minmax(280px,1.22fr); gap:16px; align-items:start; }
.h3-shell #h3-editor .materials-column { grid-column:1; grid-row:1 / span 2; }
.h3-shell #h3-editor .director-column,.h3-shell #h3-editor .final-column { grid-column:2; }
.h3-shell [data-h3-panel="create"] .creation-modes { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.h3-shell .creation-mode { flex:1; min-width:110px; padding:11px 13px; text-align:left; }
.h3-shell .creation-mode strong { font-size:12px; }
.h3-shell .creation-mode small { margin-top:4px; font-size:10px; }
.h3-shell [data-h3-panel="create"] .mode-description { margin:10px 0 17px; font-size:12px; }
.h3-shell .h3-hero { margin-bottom:16px; align-items:start; }
.h3-shell .h3-hero h1 { font-size:20px; }
.h3-shell .h3-health { max-width:55%; flex-shrink:1; font-size:10px; line-height:1.6; }
.h3-shell .studio-column { padding:18px; border-radius:10px; }
.h3-shell .director-chat { max-height:320px; min-height:200px; }
.h3-shell .final-column .prompt-field textarea { min-height:225px; font-size:13px; }
.h3-shell .workspace-inspector { position:sticky; top:85px; min-width:0; max-height:calc(100dvh - 105px); overflow:auto; border:1px solid var(--line); border-radius:11px; background:var(--surface); scrollbar-width:thin; }
.inspector-sections { position:sticky; top:0; z-index:3; display:flex; gap:5px; padding:10px; border-bottom:1px solid var(--line); background:var(--surface); }
.inspector-sections button { flex:1; min-height:35px; border:0; border-radius:6px; color:var(--muted); background:var(--canvas); font-size:12px; cursor:pointer; }
.inspector-sections button.is-active { background:var(--accent-soft); color:var(--accent); font-weight:650; }
.h3-shell .workspace-inspector .studio-settings { display:block; border:0; border-radius:0; padding:18px; }
.h3-shell .studio-settings > summary { font-size:14px; }
.h3-shell .studio-settings > summary span { display:block; margin:6px 0 0; font-size:11px; }
.h3-shell .workspace-inspector .scalar-inputs,.h3-shell .workspace-inspector .h3-lora .scalar-inputs { grid-template-columns:1fr; gap:14px; }
.h3-shell .workspace-inspector .scalar-field { min-width:0; grid-column:auto; }
.h3-shell .workspace-inspector .scalar-heading label { font-size:12px; }
.h3-shell .workspace-inspector .workflow-presets { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:15px 0; }
.h3-shell .workspace-inspector .preset-card { padding:9px 6px; min-width:0; }
.h3-shell .workspace-inspector .preset-title { flex-wrap:wrap; }
.h3-shell .workspace-inspector .preset-title strong { font-size:10px; }
.h3-shell .workspace-inspector .preset-card small { display:none; }
.h3-shell .workspace-inspector .segmented-control { display:flex; flex-wrap:wrap; gap:5px; }
.h3-shell .workspace-inspector .segment { flex:1 1 28%; padding:8px 5px; min-height:36px; font-size:10px; }
.h3-shell .workspace-inspector .short-recipe-controls { display:grid; grid-template-columns:1fr; gap:11px; padding:15px 0; margin:0; border:0; border-bottom:1px solid var(--line); background:transparent; }
.h3-shell .short-recipe-controls label { font-size:12px; }
.h3-shell #short-recipe-status { font-size:10px; line-height:1.7; margin:0; }
.parameter-help { color:var(--muted); font-size:11px; }
.parameter-help summary { cursor:pointer; }
.parameter-help small { display:block; margin-top:8px; line-height:1.7; }
.h3-shell .resolution-preview { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:17px 0; padding:12px; }
.h3-shell .resolution-preview-copy { grid-column:1/-1; }
.h3-shell .resolution-preview-copy span { display:none; }
.h3-shell .resolution-preview .resolution-arrow { display:none; }
.h3-shell .resolution-stage { padding:8px; border:1px solid var(--line); border-radius:6px; min-width:0; }
.h3-shell .resolution-stage strong { font-size:15px; }
.h3-shell [data-h3-panel="create"] .compose-side { position:static; max-height:none; border:0; border-top:1px solid var(--line); border-radius:0; padding:18px; }
.inspector-submit { position:sticky; bottom:0; z-index:2; padding:13px 15px; background:var(--surface); border-top:1px solid var(--line); box-shadow:0 -8px 18px color-mix(in srgb,var(--canvas) 75%,transparent); }
.h3-shell .inspector-submit .submit-bar { margin:0; display:grid; gap:10px; padding:0; border:0; }
.h3-shell .inspector-submit .submit-bar small { font-size:9px; }
.inspector-submit .form-message { margin:7px 0 0; font-size:11px; }
.h3-shell .inspector-submit .h3-submit { width:100%; }
.h3-shell .h3-compose.is-local-image #h3-editor { grid-template-columns:minmax(0,1fr); }
.h3-shell .h3-compose.is-local-image #h3-editor .materials-column,.h3-shell .h3-compose.is-local-image #h3-editor .final-column { grid-column:1; grid-row:auto; }
.h3-shell .h3-compose.is-restoration #h3-editor { display:block; }
.h3-shell [data-h3-panel="images"] .tool-columns { grid-template-columns:minmax(0,1fr) 350px; gap:20px; }
.h3-shell .image-workspace-form { display:contents; }
.image-compose-main { grid-column:1; grid-row:1 / span 2; }
.image-parameter-inspector { grid-column:2; grid-row:1; }
.h3-shell [data-h3-panel="images"] .tool-columns > section { grid-column:2; grid-row:2; }
.h3-shell .image-parameter-inspector .tool-grid { grid-template-columns:1fr 1fr; }
.h3-shell .longfilm-layout { grid-template-columns:minmax(0,1fr) 350px; }
.h3-shell .longfilm-setup { grid-column:1; grid-row:1; }
.h3-shell .longfilm-editor { grid-column:1; grid-row:2; }
.h3-shell .longfilm-inspector { grid-column:2; grid-row:1 / span 2; position:sticky; top:86px; max-height:calc(100dvh - 110px); overflow:auto; }
.h3-shell .longfilm-inspector .longfilm-output { margin-top:22px; }
.h3-shell .longfilm-inspector .longfilm-output h2 { font-size:15px; }
.h3-shell .longfilm-inspector .longfilm-parameters { margin-bottom:18px; }
.h3-shell .longfilm-inspector > label { display:block; margin:14px 0; font-size:12px; }
.h3-shell .longfilm-inspector input[type="checkbox"] { width:auto; min-height:0; }
@media(max-width:1400px) {
  .h3-shell [data-h3-panel="create"] .h3-compose { grid-template-columns:minmax(0,1fr) 320px; gap:17px; }
  .h3-shell #h3-editor { grid-template-columns:minmax(0,1fr); }
  .h3-shell #h3-editor .materials-column,.h3-shell #h3-editor .director-column,.h3-shell #h3-editor .final-column { grid-column:1; grid-row:auto; }
  .h3-shell .materials-column .reference-board { grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); }
  .h3-shell [data-h3-panel="images"] .tool-columns,.h3-shell .longfilm-layout { grid-template-columns:minmax(0,1fr) 320px; }
}
@media(max-width:1100px) {
  .h3-shell [data-h3-panel="create"] .h3-compose,.h3-shell [data-h3-panel="images"] .tool-columns,.h3-shell .longfilm-layout { grid-template-columns:minmax(0,1fr); }
  .h3-shell .workspace-inspector,.h3-shell .longfilm-inspector { position:static; max-height:none; }
  .h3-shell .image-compose-main,.h3-shell .image-parameter-inspector,.h3-shell [data-h3-panel="images"] .tool-columns > section,.h3-shell .longfilm-inspector,.h3-shell .longfilm-editor,.h3-shell .longfilm-setup { grid-column:1; grid-row:auto; }
  .h3-shell .workspace-inspector .scalar-inputs { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .h3-shell .workspace-inspector .h3-lora .scalar-inputs { grid-template-columns:1fr; }
  .inspector-submit { position:static; }
}
@media(max-width:760px) {
  .h3-shell { grid-template-columns:minmax(0,1fr); }
  .h3-shell .h3-sidebar { width:240px; }
  .h3-shell .h3-workspace main { width:calc(100% - 24px); padding-top:18px; }
  .workspace-breadcrumb { display:grid; gap:5px; }
  .workspace-context-tabs { gap:0; justify-content:space-between; }
  .workspace-context-tabs button { padding:10px 8px; gap:4px; font-size:12px; }
  .workspace-context-tabs button span { display:none; }
  .workspace-source-tabs { gap:6px; }
  .workspace-source-tabs span { width:100%; margin:3px 0 0; }
  .h3-shell .h3-hero { display:grid; gap:10px; }
  .h3-shell .h3-health { max-width:100%; }
  .h3-shell .workspace-inspector .scalar-inputs { grid-template-columns:1fr; }
  .h3-shell .studio-column,.h3-shell .workspace-inspector .studio-settings { padding:15px; }
  .h3-shell .h3-context select { max-width:150px; }
}

/* 工作流真实运行参数：目录、尺寸与 LoRA 共用原输入状态。 */
.h3-shell .runtime-inventory {display:flex; align-items:center; justify-content:space-between; gap:8px; margin:12px 0; color:var(--text-muted,#68756e); font-size:11px;}
.h3-shell .runtime-inventory button {flex-shrink:0;}
.h3-shell .runtime-lora-card {padding:13px; border:1px solid var(--border,#d7dfda); border-radius:10px; background:var(--surface,#fff); display:grid; gap:10px; min-width:0;}
.h3-shell .runtime-lora-card.is-bypassed {background:var(--surface-soft,#f4f7f4);}
.h3-shell .runtime-lora-card .scalar-field {margin:0; min-width:0;}
.h3-shell .runtime-lora-heading {display:flex; justify-content:space-between; align-items:center; gap:8px;}
.h3-shell .runtime-lora-heading h3 {font-size:13px; margin:0;}
.h3-shell .lora-enabled-field {display:flex; align-items:center; flex-direction:row-reverse; gap:6px;}
.h3-shell .lora-enabled-field .scalar-heading {margin:0;}
.h3-shell .lora-enabled-field label {font-size:11px;}
.h3-shell .lora-enabled-field input[type=checkbox] {width:16px; height:16px; accent-color:var(--accent,#227248);}
.h3-shell .lora-state {margin:0; color:var(--accent,#227248); font-size:11px;}
.h3-shell .lora-state.is-missing {color:#a45230;}
.h3-shell .is-bypassed .lora-state {color:var(--text-muted,#68756e);}
.h3-shell .lora-clip-option {display:flex; align-items:center; gap:7px; font-size:11px;}
.h3-shell .lora-clip-option input {width:14px; height:14px; accent-color:var(--accent,#227248);}
.h3-shell .runtime-resolution {grid-column:1/-1; display:grid; gap:11px; padding-top:12px; margin-top:4px; border-top:1px solid var(--border,#d7dfda);}
.h3-shell .runtime-resolution h3,.h3-shell .runtime-resolution h4 {font-size:13px; margin:0;}
.h3-shell .runtime-resolution h4 {padding-top:12px; border-top:1px solid var(--border,#d7dfda);}
.h3-shell .runtime-resolution .field-note {margin:0; line-height:1.6;}
.h3-shell .resolution-quick-label {font-size:11px; display:grid; gap:6px;}
.h3-shell .runtime-model {grid-column:1/-1;}
.h3-shell .runtime-lora-card select {width:100%; min-width:0; text-overflow:ellipsis;}
.h3-shell .runtime-lora-card input[type=range] {min-width:0;}
.h3-shell .longfilm-runtime-controls {display:grid;gap:12px;padding-top:12px;}
.h3-shell .longfilm-runtime-controls .scalar-field {display:grid;gap:7px;font-size:11px;}
.h3-shell .longfilm-runtime-controls .runtime-lora-heading .scalar-field {display:flex;flex-direction:row-reverse;align-items:center;gap:6px;}
.h3-shell .longfilm-runtime-controls input[type=checkbox] {width:16px;height:16px;accent-color:var(--accent,#227248);}
.h3-shell .longfilm-runtime-controls input[type=range] {width:100%;accent-color:var(--accent,#227248);}
.h3-shell .longfilm-runtime-controls h3 {font-size:13px;margin:0;}
.h3-shell .workspace-context-bar .creation-modes {display:flex;flex-wrap:wrap;gap:6px;margin-top:12px;padding-top:10px;border-top:1px solid var(--border,#d7dfda);}
.h3-shell .workspace-context-bar .creation-mode {display:flex;align-items:center;gap:8px;min-height:34px;min-width:0;padding:7px 11px;flex:0 1 auto;}
.h3-shell .workspace-context-bar .creation-mode strong {font-size:12px;}
.h3-shell .workspace-context-bar .creation-mode small {font-size:10px;margin:0;}
/* 宽屏保留素材到最终提示的直接拖放距离；窄屏继续按阅读顺序排列。 */
@media (min-width:1350px) {
  .h3-shell .h3-compose:not(.is-local-image):not(.is-restoration) #h3-editor {grid-template-columns:minmax(210px,.82fr) minmax(260px,1.2fr) minmax(220px,.94fr);align-items:start;}
  .h3-shell .h3-compose:not(.is-local-image):not(.is-restoration) #h3-editor .materials-column {grid-column:1;grid-row:1;}
  .h3-shell .h3-compose:not(.is-local-image):not(.is-restoration) #h3-editor .director-column {grid-column:2;grid-row:1;}
  .h3-shell .h3-compose:not(.is-local-image):not(.is-restoration) #h3-editor .final-column {grid-column:3;grid-row:1;}
  .h3-shell .h3-compose:not(.is-local-image):not(.is-restoration) .final-column .prompt-field textarea {min-height:410px;}
  .h3-shell .studio-column {padding:14px;}
}
.h3-shell .longfilm-runtime-controls select,.h3-shell .longfilm-runtime-controls input {min-width:0;max-width:100%;}

/* 紧凑创作区：缩略图始终保留，角色与声音按需展开。 */
.h3-shell .compact-image-field .reference-board {display:grid;grid-template-columns:repeat(auto-fill,88px);gap:7px;justify-content:start;}
.h3-shell .compact-image-field .reference-empty {display:none;}
.h3-shell .compact-image-field .reference-card {width:88px;border-radius:7px;}
.h3-shell .compact-image-field .reference-visual {width:86px;height:86px;min-height:0;padding:0;border:0;border-radius:0;}
.h3-shell .compact-image-field .reference-index {font-size:9px;padding:3px 5px;max-width:100%;box-sizing:border-box;}
.h3-shell .reference-details > summary {padding:5px 7px;font-size:10px;color:var(--muted);cursor:pointer;}
.h3-shell .reference-details[open] > summary {color:var(--accent);}
.h3-shell .compact-image-field .reference-card:has(.reference-details[open]) {grid-column:1/-1;display:grid;grid-template-columns:88px minmax(0,1fr);width:100%;overflow:visible;}
.h3-shell .reference-details .reference-copy {padding:6px 8px;}
.h3-shell .reference-details .source-role {padding:6px 8px;}
.h3-shell .reference-details .reference-actions,.h3-shell .reference-details .source-extra-actions {padding:5px 8px;}
.h3-shell .reference-add-slot {width:88px;min-height:109px;display:grid;align-content:center;justify-items:center;gap:6px;border:1px dashed var(--line-strong);border-radius:7px;background:var(--canvas);color:var(--muted);cursor:pointer;}
.h3-shell .reference-add-slot:hover {border-color:var(--accent);color:var(--accent);background:var(--accent-soft);}
.h3-shell .reference-add-slot strong {font-size:22px;font-weight:400;}
.h3-shell .reference-add-slot small {font-size:10px;}
.h3-shell .compact-image-field .h3-media-title small {display:none;}
.h3-shell .compact-image-field .media-drop-zone {min-height:42px;display:flex;gap:7px;margin-top:8px;padding:0 8px;}
.h3-shell .compact-image-field .media-drop-zone small {display:none;}
.h3-shell .compact-image-field .asset-library {margin-top:7px;font-size:11px;}
.h3-shell .compact-image-field {padding:9px;}
.h3-shell .compact-disclosure {border-top:1px solid var(--line);padding-top:9px;margin-top:10px;min-width:0;}
.h3-shell .compact-disclosure > summary {font-size:11px;color:var(--muted);cursor:pointer;padding-bottom:6px;}
.h3-shell .compact-disclosure[open] > summary {color:var(--ink);}
.h3-shell .materials-column .section-heading {margin-bottom:11px;}
.h3-shell .director-chat {min-height:120px;max-height:245px;}
.h3-shell .director-field textarea {font-size:12px;}
.h3-shell .director-column .field-note {font-size:10px;line-height:1.65;}
.h3-shell .final-column .prompt-field textarea {min-height:260px!important;}
.h3-shell .seed-mode-control,.h3-shell .compact-presets {display:flex;gap:5px;flex-wrap:wrap;}
.h3-shell .seed-mode-control button,.h3-shell .compact-presets button {flex:1;min-height:32px;padding:7px 5px;border:1px solid var(--line);border-radius:6px;background:var(--canvas);color:var(--muted);font-size:11px;cursor:pointer;}
.h3-shell .seed-mode-control button[aria-checked=true],.h3-shell .compact-presets button[aria-pressed=true] {background:var(--accent-soft);border-color:var(--accent);color:var(--accent);}
.h3-shell .seed-field {display:grid;gap:7px;}
.h3-shell .seed-field input[readonly] {background:var(--canvas);color:var(--muted);}
.h3-shell .seed-policy-note {font-size:10px;line-height:1.6;color:var(--muted);overflow-wrap:anywhere;}
.h3-shell .resolution-helpers {display:flex;gap:16px;flex-wrap:wrap;}
.h3-shell .resolution-helpers button {font-size:11px;}
.h3-shell .runtime-resolution .compact-disclosure {margin-top:0;}
.h3-shell .runtime-resolution .scalar-heading {margin-bottom:4px;}
.h3-shell .runtime-resolution {gap:9px;}
.h3-shell .megapixel-presets button {flex:1 1 25%;}
@media(min-width:1350px) {
 .h3-shell .h3-compose:not(.is-local-image):not(.is-restoration) #h3-editor {grid-template-columns:minmax(295px,.95fr) minmax(240px,1fr) minmax(210px,.85fr);gap:11px;}
 .h3-shell .h3-workspace main {width:calc(100% - 30px);}
 .h3-shell .studio-column {padding:12px;}
}
@media(max-width:760px) {
 .h3-shell .compact-image-field .reference-board {grid-template-columns:repeat(auto-fill,76px);}
 .h3-shell .compact-image-field .reference-card,.h3-shell .reference-add-slot {width:76px;}
 .h3-shell .compact-image-field .reference-visual {width:74px;height:74px;}
 .h3-shell .reference-add-slot {min-height:97px;}
 .h3-shell .compact-image-field .reference-card:has(.reference-details[open]) {grid-template-columns:76px minmax(0,1fr);}
}
.h3-shell .seed-mode-switch {display:flex;gap:5px;margin:7px 0;}
.h3-shell .seed-mode-switch button {flex:1;padding:7px;border:1px solid var(--line);border-radius:6px;background:var(--canvas);font-size:11px;color:var(--muted);cursor:pointer;}
.h3-shell .seed-mode-switch button.is-selected {border-color:var(--accent);background:var(--accent-soft);color:var(--accent);}
.h3-shell .prompt-editor-dialog {width:min(1050px,calc(100vw - 44px));max-height:calc(100dvh - 50px);padding:24px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink);box-sizing:border-box;}
.prompt-editor-dialog::backdrop {background:rgb(17 34 25 / .45);}
.h3-shell .prompt-editor-dialog textarea {width:100%;height:60dvh;min-height:220px;resize:vertical;font-size:15px;line-height:1.9;margin:12px 0;box-sizing:border-box;}
.h3-shell .final-column .section-heading {flex-wrap:wrap;gap:8px;}
.h3-shell .materials-column #media-inputs {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;}
.h3-shell .materials-column .h3-media-field {grid-column:1/-1;margin:0;}
.h3-shell .materials-column [data-input-name=first_frame],.h3-shell .materials-column [data-input-name=last_frame] {grid-column:auto;}
.h3-shell .materials-column .h3-media-field:has(.reference-details[open]) {grid-column:1/-1;}
.h3-shell .compact-image-field .h3-media-title {flex-wrap:wrap;gap:4px;}
.h3-shell .compact-image-field .h3-media-title .media-count {font-size:9px;}
.h3-shell .compact-image-field .media-drop-zone {font-size:10px;}
.h3-shell .compact-image-field .media-drop-zone strong {font-size:10px;}
.h3-shell .workspace-context-bar {margin-bottom:14px;}
.h3-shell .workspace-breadcrumb {margin-bottom:10px;}
.h3-shell .h3-hero {margin-bottom:9px;}
.h3-shell .h3-hero .eyebrow,.h3-shell .h3-hero h1+p {display:none;}
.h3-shell [data-h3-panel=create] .mode-description {margin:6px 0 12px;}
.h3-shell .mode-workflow-field {margin-bottom:6px;}
.h3-shell .workflow-choice {grid-column:1/-1;min-width:0;border-bottom:1px solid var(--line);padding:0 0 8px;}
.h3-shell .workflow-choice select {width:100%;min-width:0;max-width:100%;}
.h3-shell .workflow-choice .field-note {margin:4px 0 0;overflow-wrap:anywhere;}
.h3-shell .resolution-preview {margin:12px 0;padding:9px;gap:7px;}
.h3-shell .resolution-preview-copy .step-label {display:none;}
.h3-shell .resolution-stage small {font-size:9px;line-height:1.5;}
@media(min-width:1500px) {
 .h3-shell .h3-compose:not(.is-local-image):not(.is-restoration) #h3-editor {grid-template-columns:320px minmax(250px,1fr) minmax(240px,.86fr);}
}
.h3-shell .materials-column [data-input-name=reference_images] .reference-board {grid-template-columns:repeat(auto-fill,minmax(0,88px));}
@media(min-width:1350px) and (max-width:1499px) {
 .h3-shell .materials-column [data-input-name=reference_images] .reference-board {grid-template-columns:repeat(auto-fill,minmax(0,76px));}
 .h3-shell .materials-column [data-input-name=reference_images] .reference-card,.h3-shell .materials-column [data-input-name=reference_images] .reference-add-slot {width:76px;}
 .h3-shell .materials-column [data-input-name=reference_images] .reference-visual {width:74px;height:74px;}
}
@media(max-width:760px) {.h3-shell .materials-column [data-input-name=reference_images] .reference-board {grid-template-columns:repeat(auto-fill,minmax(0,76px));}}
/* 定位和生成按钮固定在参数栏两端，只有中间参数/任务滚动。 */
.h3-shell .workspace-inspector {display:flex;flex-direction:column;overflow:hidden;}
.h3-shell .workspace-inspector .inspector-sections,.h3-shell .workspace-inspector .inspector-submit {position:static;flex-shrink:0;}
.h3-shell .inspector-scroll {overflow:auto;min-height:0;scrollbar-width:thin;}
@media(max-width:1100px) {.h3-shell .inspector-scroll {overflow:visible;}}
.h3-shell .h3-hero[hidden] {display:none!important;}
.h3-shell .workspace-context-tabs button {padding-top:9px;padding-bottom:9px;}
.h3-shell .workspace-context-bar #mode-description {font-size:11px;color:var(--muted);margin:3px 0 9px;}
.h3-shell .workspace-context-bar {margin-bottom:12px;}
.h3-shell #generation-settings > .h3-health {max-width:none;margin-top:10px;padding:8px;}
.h3-shell .workspace-inspector #generation-results {padding-top:12px;}
.h3-shell .workspace-inspector .side-heading {margin-top:6px;}
.h3-shell .workspace-inspector .section-heading h2 {font-size:16px;}
.h3-shell .workspace-inspector .current-run {font-size:11px;}
.h3-shell .h3-workspace main {padding-top:12px;}

/* 黑白灰创作画布；仅改变界面色彩，不过滤素材与生成结果。 */
:root {
 --canvas:#f5f5f5;--surface:#fff;--surface-subtle:#ededed;--surface-raised:#fff;
 --ink:#191919;--muted:#595959;--faint:#737373;--line:#d6d6d6;--line-strong:#a3a3a3;
 --accent:#242424;--accent-hover:#090909;--accent-soft:#e8e8e8;
 --success:#414141;--warning:#525252;--danger:#292929;--danger-soft:#ededed;
 --focus:0 0 0 3px rgb(0 0 0 / .18);--overlay-shadow:0 12px 32px rgb(0 0 0 / .14);
}
html[data-theme="dark"] {
 --canvas:#111;--surface:#1b1b1b;--surface-subtle:#252525;--surface-raised:#242424;
 --ink:#f0f0f0;--muted:#b4b4b4;--faint:#999;--line:#3c3c3c;--line-strong:#686868;
 --accent:#ededed;--accent-hover:#fff;--accent-soft:#333;
 --success:#c9c9c9;--warning:#bbb;--danger:#eee;--danger-soft:#353535;
 --focus:0 0 0 3px rgb(255 255 255 / .25);--overlay-shadow:0 12px 32px rgb(0 0 0 / .4);
}
html[data-theme="dark"] .h3-shell .button.primary,html[data-theme="dark"] .h3-shell .brand-mark {color:#111;}
.h3-shell {font-variant-numeric:tabular-nums;-webkit-font-smoothing:antialiased;}
.h3-shell input {accent-color:var(--accent);}
.h3-shell .parameter-toolbar {grid-column:1/-1;display:flex;align-items:stretch;flex-wrap:wrap;gap:6px;padding:8px;background:var(--surface);border:1px solid var(--line);border-radius:9px;min-width:0;}
.h3-shell .parameter-chip {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 8px;align-content:center;text-align:left;flex:1 1 115px;min-width:0;min-height:52px;padding:7px 11px;background:var(--surface);border:1px solid transparent;border-radius:5px;cursor:pointer;}
.h3-shell .parameter-chip:hover,.h3-shell .parameter-chip[aria-expanded=true] {background:var(--surface-subtle);border-color:var(--line);}
.h3-shell .parameter-chip>span:first-child {font-size:11px;color:var(--muted);}
.h3-shell .parameter-chip strong {grid-column:1;font-size:12px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.h3-shell .parameter-chevron {grid-column:2;grid-row:1/3;align-self:center;}
.h3-shell .parameter-dialog {width:min(980px,calc(100vw - 32px));max-height:calc(100dvh - 40px);padding:0 24px 24px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);box-shadow:var(--overlay-shadow);overflow:auto;}
.h3-shell .parameter-dialog::backdrop,.prompt-editor-dialog::backdrop,.source-preview-dialog::backdrop,dialog::backdrop {background:rgb(0 0 0 / .45);}
.h3-shell .parameter-dialog-header {position:sticky;top:0;z-index:5;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:17px 0;background:var(--surface);border-bottom:1px solid var(--line);}
.h3-shell .parameter-dialog-header h2 {margin:0;font-size:20px;}
.h3-shell .parameter-dialog .studio-settings {border:0;padding:10px 0;background:transparent;}
.h3-shell .parameter-dialog .studio-settings>summary {display:none;}
.h3-shell .parameter-dialog .scalar-inputs {grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;}
.h3-shell .parameter-dialog .scalar-field {min-width:0;}
.h3-shell .parameter-dialog .runtime-resolution {grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}
.h3-shell .parameter-dialog .runtime-resolution>h4,.h3-shell .parameter-dialog .resolution-helpers,.h3-shell .parameter-dialog .runtime-resolution>.compact-disclosure {grid-column:1/-1;}
.h3-shell .parameter-dialog .h3-lora .scalar-inputs {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
.h3-shell .parameter-dialog .runtime-model {grid-column:1/-1;}
.h3-shell .parameter-dialog .runtime-lora-card {min-width:0;}
.h3-shell .parameter-dialog :is(.scalar-field,.runtime-lora-card) .scalar-field {grid-column:auto;}
.h3-shell .parameter-dialog .short-recipe-controls {background:var(--surface-subtle);}
.h3-shell .parameter-dialog .segment {font-size:12px;min-height:40px;white-space:normal;}
.h3-shell .parameter-dialog button {min-height:40px;}
.h3-shell .parameter-dialog .workflow-presets {grid-template-columns:repeat(3,minmax(0,1fr));}
.h3-shell .parameter-dialog .preset-card {min-width:0;}
.h3-shell .parameter-dialog select {max-width:100%;}
.h3-shell .workspace-inspector #generation-results {border-top:0;padding-top:16px;}
.h3-shell .director-brief-block,.h3-shell .director-conversation-block,.h3-shell .director-reply-block {border:1px solid var(--line);border-radius:8px;overflow:hidden;margin-top:14px;padding:12px;}
.h3-shell .director-block-title {display:flex;justify-content:space-between;gap:8px;margin:0;font-size:13px;color:var(--ink);}
.h3-shell .director-block-title span {font-size:11px;color:var(--muted);font-weight:400;}
.h3-shell .director-conversation-block {padding:0;background:var(--canvas);}
.h3-shell .director-conversation-block>.director-block-title {padding:12px 14px;background:var(--surface-subtle);border-bottom:1px solid var(--line);}
.h3-shell .director-chat {min-height:330px;height:clamp(330px,36dvh,500px);max-height:560px;margin:0;padding:14px;gap:14px;border:0;resize:vertical;}
.h3-shell .director-chat article {background:var(--surface);border:1px solid var(--line);padding:13px;box-shadow:0 1px 2px rgb(0 0 0 / .04);font-size:13px;}
.h3-shell .director-chat article[data-role=user] {background:var(--surface-subtle);margin-left:20px;}
.h3-shell .director-chat article[data-role=assistant] {margin-right:12px;}
.h3-shell .director-chat article strong {font-size:11px;color:var(--ink);}
.h3-shell .director-empty {align-self:center;text-align:center;max-width:250px;margin:40px auto;padding:16px;font-size:13px;}
.h3-shell .director-reply-block {background:var(--surface-subtle);}
.h3-shell .director-reply-block>.director-field {margin-top:0;}
.h3-shell .director-field textarea {font-size:13px;}
.h3-shell .director-brief-block .director-field {margin-bottom:8px;}
.h3-shell .director-column #director-message:empty {display:none;}
.h3-shell .director-column .director-history {margin-top:12px;}
.h3-shell .compact-image-field .media-drop-zone.reference-add-slot {display:flex;flex-direction:column;justify-content:center;gap:4px;width:88px;min-height:109px;margin:0;padding:8px 4px;text-align:center;}
.h3-shell .compact-image-field .media-drop-zone.reference-add-slot strong {font-size:11px;}
.h3-shell .compact-image-field .media-drop-zone.reference-add-slot small {display:block;font-size:10px;}
.h3-shell .compact-image-field .reference-board {grid-template-columns:repeat(auto-fill,88px);}
.h3-shell .compact-image-field .media-drop-zone.reference-add-slot .drop-icon {font-size:20px;}
.h3-shell .compact-image-field .reference-visual img {outline:1px solid rgb(0 0 0 / .1);outline-offset:-1px;}
.h3-shell .reference-add-slot:active,.h3-shell .parameter-chip:active {transform:scale(.96);}
@media(min-width:1350px) {
 .h3-shell [data-h3-panel=create] .h3-compose {grid-template-columns:minmax(0,1fr) 280px;gap:14px;}
 .h3-shell .h3-compose:not(.is-local-image):not(.is-restoration) #h3-editor {grid-template-columns:minmax(205px,.72fr) minmax(320px,1.35fr) minmax(225px,.92fr);gap:12px;}
 .h3-shell #h3-editor .materials-column,.h3-shell #h3-editor .director-column,.h3-shell #h3-editor .final-column {grid-row:1;}
 .h3-shell #h3-editor .materials-column {grid-column:1;}
 .h3-shell #h3-editor .director-column {grid-column:2;}
 .h3-shell #h3-editor .final-column {grid-column:3;}
 .h3-shell .studio-column {padding:12px;}
}
@media(min-width:1101px) and (max-width:1349px) {
 .h3-shell [data-h3-panel=create] .h3-compose {grid-template-columns:minmax(0,1fr) 260px;gap:12px;}
 .h3-shell #h3-editor {grid-template-columns:minmax(190px,.75fr) minmax(280px,1.25fr);}
 .h3-shell #h3-editor .materials-column {grid-column:1;grid-row:1/3;}
 .h3-shell #h3-editor .director-column,.h3-shell #h3-editor .final-column {grid-column:2;grid-row:auto;}
}
@media(max-width:760px) {
 .h3-shell .parameter-chip {flex-basis:calc(50% - 6px);padding:6px 8px;}
 .h3-shell .parameter-dialog {padding:0 14px 16px;width:calc(100vw - 20px);max-height:calc(100dvh - 20px);}
 .h3-shell .parameter-dialog .scalar-inputs,.h3-shell .parameter-dialog .runtime-resolution,.h3-shell .parameter-dialog .h3-lora .scalar-inputs {grid-template-columns:minmax(0,1fr);}
 .h3-shell .parameter-dialog .workflow-presets {grid-template-columns:1fr;}
 .h3-shell .director-chat {height:350px;min-height:300px;}
 .h3-shell .compact-image-field .media-drop-zone.reference-add-slot {width:76px;min-height:97px;}
 .h3-shell .compact-image-field .reference-board {grid-template-columns:repeat(auto-fill,76px);}
}
@media(prefers-reduced-motion:reduce) {.h3-shell .reference-add-slot:active,.h3-shell .parameter-chip:active {transform:none;}}

.h3-shell #parameter-dialog {scroll-padding-top:92px;}
.h3-shell #parameter-dialog #lora-inputs {align-items:start;}
.h3-shell #parameter-dialog #lora-inputs .runtime-model {grid-column:1/-1;align-self:start;}

.h3-shell #creation-modes {border-color:var(--line);}

:root {--border:var(--line);}
.h3-shell .director-brief-block>summary {cursor:pointer;min-height:32px;font-size:13px;font-weight:600;}

:root {--text-muted:var(--muted);--surface-soft:var(--surface-subtle);--panel:var(--surface);}
.h3-shell .lora-state.is-missing {color:var(--ink);font-weight:700;text-decoration:underline;}

.h3-shell .analysis-upload.is-dragging {outline-color:var(--accent);}
.h3-shell :is(#analysis-progress,#audio-progress) progress {accent-color:var(--accent);}
html[data-theme=dark] .h3-shell :is(.analysis-compose,.analysis-monitor) {background:var(--surface);}
html[data-theme=dark] .h3-shell .analysis-source {background:var(--canvas);}
.h3-shell .media-workbench-tabs button.is-active {box-shadow:0 1px 4px rgb(0 0 0 / .07);}
html dialog::backdrop,html .source-preview-dialog::backdrop,html .prompt-editor-dialog::backdrop,html .h3-preview-dialog::backdrop {background:rgb(0 0 0 / .45);}

/* 常用参数就地展开；完整参数只由专业设置入口打开。 */
.h3-shell #parameter-dialog.is-quick {position:fixed;inset:auto;margin:0;padding:0 16px 16px;border-radius:10px;z-index:100;scroll-padding-top:64px;}
.h3-shell #parameter-dialog.is-quick .parameter-dialog-header {padding:12px 0;}
.h3-shell #parameter-dialog.is-quick .parameter-dialog-header h2 {font-size:15px;}
.h3-shell #parameter-dialog.is-quick > .field-note {display:none;}
.h3-shell #parameter-dialog.is-quick .quick-path > :not(.quick-path):not(.quick-item) {display:none!important;}
.h3-shell #parameter-dialog.is-quick .quick-path {margin:0;padding:0;border:0;display:block;background:transparent;}
.h3-shell #parameter-dialog.is-quick :is(.scalar-inputs,.runtime-resolution,.h3-lora .scalar-inputs) {display:grid;grid-template-columns:minmax(0,1fr);gap:12px;}
.h3-shell #parameter-dialog.is-quick .quick-item {margin-top:12px;}
.h3-shell #parameter-dialog.is-quick .quick-item[hidden] {display:none!important;}
.h3-shell .parameter-professional {align-self:center;min-height:42px;white-space:nowrap;margin-left:auto;}
.h3-shell .parameter-chip {flex-basis:100px;}

/* 灰阶的四层明暗：背景、工作面、输入区域、主要操作。 */
:root {--canvas:#e9e9e9;--surface:#fff;--surface-subtle:#f3f3f3;--line:#cfcfcf;--ink:#181818;--muted:#555;--panel-shadow:0 2px 5px rgb(0 0 0 / .035);}
html[data-theme=dark] {--canvas:#101010;--surface:#222;--surface-subtle:#2e2e2e;--line:#4b4b4b;--ink:#f5f5f5;--muted:#c5c5c5;--panel-shadow:0 2px 8px rgb(0 0 0 / .2);}
.h3-shell :is(.studio-column,.tool-panel,.image-compose-main,.image-parameter-inspector,.longfilm-column,.longfilm-setup,.longfilm-editor) {box-shadow:var(--panel-shadow);}
.h3-shell .section-heading {padding-bottom:13px;border-bottom:1px solid var(--line);margin-bottom:16px;}
.h3-shell .section-heading h2 {font-size:17px;font-weight:700;line-height:1.4;}
.h3-shell .section-heading .step-label {font-size:11px;color:var(--muted);letter-spacing:.04em;}
.h3-shell :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]),textarea,select) {background:var(--surface-subtle);color:var(--ink);border-color:var(--line);}
.h3-shell :is(input,textarea,select):focus-visible {outline:2px solid var(--ink);outline-offset:2px;}
.h3-shell .button.primary {background:var(--ink);color:var(--surface);border-color:var(--ink);font-weight:650;}
.h3-shell .button.secondary {background:var(--surface);border-color:var(--line-strong);color:var(--ink);}
.h3-shell .button:disabled {opacity:.48;}
.h3-shell .director-conversation-block {border-color:var(--line-strong);background:var(--surface-subtle);}
.h3-shell .director-conversation-block > header {border-bottom:1px solid var(--line);background:var(--surface);}
.h3-shell [data-h3-panel=images] .tool-panel > h2,.h3-shell .image-parameter-inspector > h2 {font-size:17px;border-bottom:1px solid var(--line);padding-bottom:14px;margin-bottom:18px;}
.h3-shell .workspace-context-tabs {background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:5px;}
.h3-shell #parameter-dialog.is-recipe #generation-settings {display:none!important;}
.h3-shell .quick-recipe-options {display:grid;gap:5px;padding-top:8px;}
.h3-shell .quick-recipe-options button {text-align:left;padding:10px 12px;border:1px solid transparent;border-radius:6px;background:var(--surface);color:var(--ink);cursor:pointer;}
.h3-shell .quick-recipe-options button:hover {background:var(--surface-subtle);border-color:var(--line);}
.h3-shell .quick-recipe-options button[aria-pressed=true] {background:var(--ink);color:var(--surface);font-weight:650;}
.h3-shell [data-workspace-context=longfilm] #mode-description,.h3-shell [data-workspace-context=image] #mode-description {display:none;}

/* 素材入口直接可见，首尾帧作为多模态参考的可选控制。 */
.h3-shell .optional-frame-controls {grid-column:1/-1;border:1px solid var(--line);border-radius:8px;padding:10px;background:var(--surface);min-width:0;}
.h3-shell .optional-frame-controls > summary {font-size:12px;font-weight:650;cursor:pointer;line-height:1.7;}
.h3-shell .optional-frame-controls > .field-note {margin:8px 0;}
.h3-shell .optional-frame-grid {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;}
.h3-shell .optional-frame-controls #short-frame-options {margin-top:10px;}
.h3-shell .multimodal-reference-note {margin:0 0 10px;font-size:11px;line-height:1.65;}
.h3-shell .compact-av-field .h3-media-title {margin-bottom:8px;gap:6px;flex-wrap:wrap;}
.h3-shell .compact-av-field .media-drop-zone {min-height:54px;margin-top:6px;padding:8px;grid-template-columns:20px minmax(0,1fr);text-align:left;justify-items:start;}
.h3-shell .compact-av-field .media-drop-zone .drop-icon {grid-row:1/3;align-self:center;}
.h3-shell .compact-av-field .media-drop-zone strong {font-size:12px;}
.h3-shell .compact-av-field .media-drop-zone small {font-size:10px;}
.h3-shell .compact-av-field .media-drop-zone:focus-visible {outline:2px solid var(--ink);outline-offset:3px;}
.h3-shell .compact-av-field [hidden] {display:none!important;}

/* 创作区布局与文案层级。 */
.h3-shell .prompt-tool {display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:7px 9px;border:1px solid var(--line);border-radius:6px;background:var(--surface);font-size:11px;white-space:nowrap;}
.h3-shell .prompt-tool .tool-icon {width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;}
.h3-shell .prompt-tool:hover {background:var(--surface-subtle);border-color:var(--line-strong);}
.h3-shell .media-spec-help {margin-top:8px;font-size:10px;color:var(--muted);}
.h3-shell .media-spec-help > summary {cursor:pointer;padding:3px 0;}
.h3-shell .media-spec-help .field-note {margin:6px 0;line-height:1.7;}
.h3-shell .asset-library > summary {white-space:nowrap;}
.h3-shell .h3-compose.is-local-image #h3-editor {display:grid;grid-template-columns:minmax(250px,.8fr) minmax(280px,1.2fr);gap:14px;align-items:start;}
.h3-shell .h3-compose.is-local-image #h3-editor .materials-column {grid-column:1;grid-row:1;}
.h3-shell .h3-compose.is-local-image #h3-editor .final-column {grid-column:2;grid-row:1;}
.h3-shell .h3-compose.is-local-image .materials-column #media-inputs {grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px;}
.h3-shell .h3-compose.is-local-image .materials-column .h3-media-field {grid-column:auto;}
.h3-shell .h3-compose.is-local-image .materials-column .h3-media-field:has(.reference-details[open]) {grid-column:1/-1;}
.h3-shell .h3-compose.is-local-image .final-column textarea {min-height:330px;}
@media(max-width:1100px) {.h3-shell .h3-compose.is-local-image #h3-editor {grid-template-columns:1fr;}.h3-shell .h3-compose.is-local-image #h3-editor .materials-column,.h3-shell .h3-compose.is-local-image #h3-editor .final-column {grid-column:1;grid-row:auto;}}

/* 独立图像入口、明确配方选择和横向素材缩略图。 */
.h3-shell .workspace-context-tabs[hidden] { display:none; }
.h3-shell .director-modes { gap:10px; padding:0; border:0; background:transparent; }
.h3-shell .director-modes button { min-height:40px; border:1px solid var(--line); border-radius:7px; background:var(--surface); color:var(--ink); }
.h3-shell .director-modes button.is-selected { border-color:var(--ink); background:var(--ink); color:var(--surface); box-shadow:inset 0 0 0 1px var(--ink); }
.h3-shell #director-mode-note { font-size:11px; line-height:1.7; color:var(--muted); }
.h3-shell .asset-library-carousel { min-width:0; position:relative; }
.h3-shell .asset-library-carousel > summary { min-height:40px; display:flex; align-items:center; width:calc(100% - 84px); cursor:pointer; }
.h3-shell .asset-library-carousel > summary::before { content:"▸"; margin-right:5px; }
.h3-shell .asset-library-carousel[open] > summary::before { content:"▾"; }
.h3-shell .asset-library-scroll-controls { position:absolute; top:0; right:0; display:flex; gap:2px; }
.h3-shell .asset-library-scroll { width:40px; height:40px; padding:0; border:0; border-radius:6px; background:transparent; color:var(--ink); font-size:22px; cursor:pointer; }
.h3-shell .asset-library-scroll:hover:not(:disabled) { background:var(--surface-subtle); }
.h3-shell .asset-library-scroll:disabled { opacity:.3; cursor:default; }
.h3-shell .asset-library-carousel .asset-library-grid { display:flex; gap:6px; overflow-x:auto; overscroll-behavior-x:contain; margin-top:0; padding:2px 2px 7px; scrollbar-width:thin; }
.h3-shell .asset-library-carousel .asset-library-item { position:relative; display:flex; flex-direction:column; flex:0 0 64px; width:64px; gap:4px; padding:4px; border-radius:6px; }
.h3-shell .asset-library-carousel .asset-library-thumb { width:54px; height:48px; flex:none; }
.h3-shell .asset-library-carousel .asset-library-copy { width:100%; }
.h3-shell .asset-library-carousel .asset-library-copy strong { font-size:9px; }
.h3-shell .asset-library-carousel .asset-library-copy small { display:none; }
.h3-shell .asset-library-carousel .asset-library-check { position:absolute; right:4px; top:4px; width:16px; height:16px; border-radius:3px; background:var(--surface); color:var(--ink); font-size:11px; }
.h3-shell .asset-library-carousel .asset-library-empty { padding:5px 0; white-space:normal; }

.h3-shell .asset-library-carousel > summary {white-space:normal;line-height:1.35;}

.h3-shell .asset-library-carousel {container-type:inline-size;}
@container (max-width:140px) {
  .h3-shell .asset-library-carousel > summary {width:100%;}
  .h3-shell .asset-library-scroll-controls {display:none;}
}

/* 已选图片按可用栏宽换行；素材库继续横向浏览。 */
.h3-shell .materials-column .h3-media-field {min-width:0;}
.h3-shell .compact-image-field .reference-board {min-width:0;max-width:100%;}
.h3-shell .compact-image-field .reference-card,.h3-shell .compact-image-field .reference-add-slot {max-width:100%;min-width:0;box-sizing:border-box;}
.h3-shell .compact-image-field .reference-visual {max-width:100%;}
.h3-shell .compact-presets button[aria-pressed=true],.h3-shell .seed-mode-control button[aria-checked=true] {background:var(--ink);color:var(--surface);border-color:var(--ink);font-weight:700;box-shadow:inset 0 0 0 1px var(--ink);}
.h3-shell .compact-presets button[aria-pressed=true]::before {content:"✓ ";}
.h3-shell .parameter-confirm {display:grid;place-items:center;width:36px;min-width:36px;height:36px;min-height:36px;padding:0;font-size:20px;line-height:1;}
.h3-shell .result-column #current-run.task-compact-row {display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0;padding:0;background:transparent;border:0;min-height:32px;}
.h3-shell .task-compact-status {font-size:12px;font-weight:600;}
.h3-shell .task-reuse {font-size:11px;min-height:32px;padding:6px 9px;white-space:nowrap;}
.h3-shell .task-details {margin:3px 0 12px;font-size:11px;}
.h3-shell .task-details>summary {cursor:pointer;color:var(--muted);padding:6px 0;}
.h3-shell .task-detail-toolbar {display:flex;align-items:end;gap:6px;margin:8px 0;}
.h3-shell .task-detail-toolbar .task-selector {flex:1;min-width:0;margin:0;}
.h3-shell #current-run-details {font-size:11px;}
.h3-shell #current-run-details h3 {font-size:12px;}
.h3-shell #current-run-details .workflow-identity {margin:5px 0 0;color:var(--muted);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10px;overflow-wrap:anywhere;}
.h3-shell #current-output-list .h3-work-actions {display:flex;flex-wrap:nowrap;gap:3px;}
.h3-shell #current-output-list .h3-work-actions .button {flex:1 1 0;min-width:0;min-height:30px;padding:5px 2px;font-size:10px;white-space:nowrap;letter-spacing:-.2px;}
.h3-shell #current-output-list .h3-work-copy {padding:10px 8px;}
.h3-shell #current-output-list .h3-work-copy h3 {font-size:11px;}
.h3-shell #current-output-list .h3-work-copy>p {font-size:10px;}

.h3-shell .result-column #current-run .task-reuse {width:auto;flex:0 0 auto;}
.h3-shell .task-compact-status {white-space:nowrap;}

/* 展开图片详情时单列承载信息，避免缩略图旁挤出一条过窄的操作栏。 */
.h3-shell .materials-column .compact-image-field .reference-board .reference-card:has(.reference-details[open]) {grid-column:1/-1;display:block;width:100%;max-width:100%;overflow:hidden;}
.h3-shell .materials-column .compact-image-field .reference-card:has(.reference-details[open]) .reference-visual {display:block;width:100%;height:112px;min-height:0;border-bottom:1px solid var(--line);}
.h3-shell .compact-image-field .reference-card:has(.reference-details[open]) .reference-visual img {object-fit:contain;}
.h3-shell .reference-details {min-width:0;}
.h3-shell .reference-details[open]>summary {padding:8px;color:var(--ink);font-weight:600;}
.h3-shell .reference-details[open] .reference-copy {gap:5px;min-width:0;padding:0 8px 6px;}
.h3-shell .reference-details[open] .reference-copy strong,.h3-shell .reference-details[open] .reference-copy small {white-space:normal;overflow-wrap:anywhere;text-overflow:clip;line-height:1.5;}
.h3-shell .reference-details[open] .reference-drag-handle {font-size:10px;white-space:normal;}
.h3-shell .reference-details[open] .reference-actions {grid-template-columns:32px 32px minmax(0,1fr);gap:6px;}
.h3-shell .reference-details[open] .mini-action {min-height:30px;}
.h3-shell .reference-details[open] .source-extra-actions {display:flex;padding-top:0;}
.h3-shell .reference-details[open] .source-extra-actions .mini-action {width:100%;}
.h3-shell .materials-column .compact-image-field .reference-board {grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--reference-thumb-size,88px)),1fr));}
@media(min-width:1350px) and (max-width:1499px), (max-width:760px) {.h3-shell .materials-column .compact-image-field {--reference-thumb-size:76px;}}

/* 任务状态在折叠详情之外保持可见。 */
.task-compact-row{flex-wrap:wrap}
.task-observation{flex:1 0 100%;min-width:0;display:grid;gap:8px;padding-top:10px}
.task-observation-heading{display:flex;justify-content:space-between;gap:12px}
.task-observation .task-timing{margin:0;font-variant-numeric:tabular-nums;line-height:1.6}
.task-observation .field-note{margin:0;line-height:1.5}
.task-observation[data-stale="true"]{opacity:.75}
.h3-shell .run-diagnostic{margin:8px 0 0;padding:8px 9px;border:1px solid var(--line);border-radius:6px;background:var(--soft);line-height:1.55;color:var(--muted);}
.h3-shell .run-error-detail{margin:9px 0;padding:9px;border:1px solid #d9a5a5;border-radius:6px;background:#fff4f4;color:#7d2222;line-height:1.55;overflow-wrap:anywhere;}
.h3-shell .run-error-detail p{margin:4px 0 0;white-space:pre-wrap;}
.h3-shell .run-log-details{margin-top:10px;padding-top:8px;border-top:1px solid var(--line);}
.h3-shell .run-log-details>summary{font-size:10px;color:var(--muted);cursor:pointer;}
.h3-shell .run-event-list{display:grid;gap:5px;margin:7px 0 0;padding-left:18px;max-height:260px;overflow:auto;color:var(--muted);}
.h3-shell .run-event-item{font-size:10px;line-height:1.45;overflow-wrap:anywhere;}
.h3-shell .run-event-item time{font-variant-numeric:tabular-nums;}
.h3-shell .run-event-item p{margin:2px 0 0;color:var(--ink);white-space:pre-wrap;}

/* 连续创作：草稿操作独立于后台任务；触屏无需悬停即可管理素材。 */
.h3-shell .draft-toolbar {display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 14px;}
.h3-shell .draft-toolbar [role=status] {font-size:12px;color:var(--muted);}
.h3-shell .reference-remove {position:absolute;z-index:2;top:3px;right:3px;width:25px;height:25px;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--ink);font-size:21px;line-height:1;cursor:pointer;box-shadow:0 1px 4px #0002;}
.h3-shell .reference-remove:hover {color:#b72c32;border-color:currentColor;}
.h3-shell .reference-order {display:flex;gap:3px;padding:3px 4px 0;}
.h3-shell .reference-order button {flex:1;min-width:0;padding:0 3px;min-height:22px;}
.h3-shell .media-disclosure > summary {cursor:pointer;font-size:12px;line-height:1.5;font-weight:600;}
.h3-shell .media-disclosure[open] > summary {margin-bottom:10px;}
.h3-shell .media-disclosure .h3-media-title {display:none;}
.h3-shell .asset-library-card {min-width:0;}
.h3-shell .asset-library-card > .asset-library-item {width:100%;}
.h3-shell .asset-library-actions {display:flex;gap:4px;margin-top:4px;}
.h3-shell .asset-library-actions > button {flex:1;min-width:0;padding:2px;font-size:10px;min-height:26px;}
.h3-shell .asset-library-carousel .asset-library-card {flex:0 0 76px;width:76px;}
.h3-shell .asset-library-carousel .asset-library-card .asset-library-item {width:76px;}
.h3-shell .asset-library-actions .remove {color:var(--muted);}
.h3-shell .asset-library-actions .remove:hover {color:#b72c32;}
.h3-shell .reference-remove:focus-visible,.h3-shell .media-disclosure > summary:focus-visible {outline:2px solid var(--ink);outline-offset:2px;}

/* 一采尺寸意图：共用工作流控件，画幅示意不承诺预处理裁切策略。 */
.h3-shell .resolution-intent-modes,
.h3-shell .resolution-canvas,
.h3-shell #resolution-fit-note,
.h3-shell #resolution-follow-note { grid-column:1/-1; }
.h3-shell .resolution-intent-modes button[aria-pressed="true"] { border-color:var(--accent); color:var(--accent); background:color-mix(in srgb,var(--accent) 8%,var(--surface)); }
.h3-shell .resolution-canvas { margin:0; padding:14px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.h3-shell .resolution-canvas-stage { min-height:176px; display:flex; align-items:center; justify-content:center; padding:8px; background:repeating-linear-gradient(0deg,transparent 0 15px,color-mix(in srgb,var(--line) 38%,transparent) 15px 16px),repeating-linear-gradient(90deg,transparent 0 15px,color-mix(in srgb,var(--line) 38%,transparent) 15px 16px); border-radius:8px; }
.h3-shell .resolution-canvas-frame { position:relative; flex:none; max-width:100%; border:1.5px solid var(--accent); background:color-mix(in srgb,var(--accent) 9%,var(--surface)); box-shadow:0 2px 9px #0000000a; }
.h3-shell .resolution-canvas-frame.is-invalid { border-style:dashed; border-color:var(--danger); opacity:.65; }
.h3-shell .resolution-canvas-frame img { width:100%; height:100%; display:block; object-fit:contain; }
.h3-shell .resolution-canvas-size { margin-top:12px; font:600 13px/1.5 var(--mono); text-align:center; }
.h3-shell .resolution-canvas .field-note { margin-top:5px; text-align:center; font-size:11px; }
.h3-shell #resolution-fit-note.error { color:var(--danger); }
.h3-shell #resolution-align-suggestion { color:var(--accent); font-weight:600; }
.h3-shell .resolution-free-settings[open] { display:grid; gap:12px; }
.h3-shell .resolution-intent-modes[hidden],
.h3-shell .resolution-free-settings[hidden],
.h3-shell #resolution-refine-legacy[hidden],
.h3-shell .resolution-canvas-frame[hidden],
.h3-shell .resolution-canvas-frame img[hidden] { display:none; }

/* 显示原片探测值，不使用封面或压缩预览尺寸。 */
.h3-work-copy .artifact-resolution { font-weight: 650; color: var(--text, #202020); font-variant-numeric: tabular-nums; }
