/* Requested one-screen editor: only the fixed material regions scroll. */
html body.jimeng-active .app-layout {height:100dvh;min-height:0;overflow:hidden}
html body.jimeng-active .main {min-width:0;min-height:0;overflow:hidden;padding:0}
html body #jimengCreationView {height:100dvh!important;flex:none;min-height:0;max-width:none;padding:20px;overflow:hidden;box-sizing:border-box}
#jimengCreationView .jc-layout {display:grid;grid-template-columns:minmax(0,2fr) minmax(230px,1fr);gap:16px;height:100%;min-height:0}
#jimengCreationView .jc-inputs {display:grid;grid-template-rows:minmax(0,1fr) minmax(0,1fr) minmax(110px,.7fr) auto;gap:16px;min-width:0;min-height:0}
#jimengCreationView .jc-panel {border:1px solid var(--bc-border);border-radius:8px;background:var(--bc-surface);padding:12px;min-width:0;min-height:0;display:flex;flex-direction:column;gap:8px;overflow:hidden}
#jimengCreationView header,#jimengCreationView footer,#jimengCreationView .jc-submit-row,#jimengCreationView header>div {display:flex;align-items:center;justify-content:space-between;gap:8px;flex-shrink:0}
#jimengCreationView h3 {font-size:14px;line-height:22px;margin:0;white-space:nowrap;color:var(--bc-text)}
#jimengCreationView small,#jcStatus,#jcResultCount {font-size:12px;color:var(--bc-muted);font-weight:400}
#jimengCreationView .jc-media-row {display:grid;grid-template-columns:minmax(0,1.7fr) minmax(208px,1fr);gap:16px;min-height:0;min-width:0}
#jimengCreationView .jc-strip {display:flex;align-items:stretch;gap:8px;overflow-x:auto;overflow-y:hidden;min-height:0;flex:1;padding-bottom:4px;scrollbar-gutter:stable}
#jimengCreationView .jc-material {height:100%;flex:0 0 auto;min-width:0;display:flex;flex-direction:column;gap:4px;width:110px}
#jimengCreationView .jc-media {flex:1;min-height:0;display:flex;justify-content:center;align-items:flex-start;overflow:hidden;container-type:size}
#jimengCreationView .jc-media :is(img,video) {height:min(100cqh,177.777cqw);width:min(100cqw,56.25cqh);max-width:none;flex:none;aspect-ratio:9/16;object-fit:contain;background:var(--bc-canvas);border:1px solid var(--bc-border);border-radius:6px;box-sizing:border-box}
html body #jimengCreationView .jc-empty {flex:0 0 auto;aspect-ratio:9/16;width:auto;height:100%;min-height:0;padding:4px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border:1px dashed var(--bc-border);border-radius:6px;background:var(--bc-canvas);color:var(--bc-muted);white-space:nowrap}
#jimengCreationView .jc-empty>span:first-child {font-size:22px;line-height:24px}
#jimengCreationView .jc-material-footer {display:flex;justify-content:space-between;gap:2px;flex-shrink:0}
#jimengCreationView .jc-material-footer button {padding-inline:5px}
#jimengCreationView .jc-material>small {white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#jimengCreationView .jc-audio .jc-strip {flex-direction:column;overflow-y:auto;overflow-x:hidden}
#jimengCreationView .jc-audio .jc-empty {width:100%;height:84px;min-height:84px;aspect-ratio:auto}
#jimengCreationView .jc-audio .jc-material {width:100%;height:auto;flex-shrink:0;padding-bottom:8px;border-bottom:1px solid var(--bc-border)}
#jimengCreationView .jc-audio .jc-media {flex:none;min-height:36px;container-type:normal}
#jimengCreationView audio {width:100%;height:36px;min-width:0}
html body #jimengCreationView #jcPrompt {flex:1!important;width:100%;height:0!important;min-height:0!important;max-height:none!important;resize:none;overflow-y:auto;box-sizing:border-box}
#jimengCreationView .jc-settings {display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center}
#jimengCreationView .jc-settings label {display:flex;align-items:center;gap:6px;white-space:nowrap;margin:0}
#jimengCreationView .jc-settings select {width:auto;min-width:0}
#jimengCreationView .jc-settings #jcModel {max-width:180px}
#jcStatus {flex:1;min-width:0;line-height:18px;overflow-wrap:anywhere}
#jimengCreationView .jc-submit-row>button {flex-shrink:0}
#jimengCreationView footer :is(button,a) {white-space:nowrap;flex-shrink:0;padding-inline:6px;height:28px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center}
#jimengCreationView .jc-result-stage {flex:1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden;container-type:size}
#jcResult {height:min(100cqh,177.777cqw);width:min(100cqw,56.25cqh);aspect-ratio:9/16;overflow:hidden;border:1px solid var(--bc-border);border-radius:6px;background:var(--bc-canvas)}
#jcResult video {width:100%;height:100%;object-fit:contain;display:block}
.jc-result-empty {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;height:100%;color:var(--bc-muted);text-align:center;font-size:12px;padding:12px;box-sizing:border-box}
#jimengCreationView .jc-dialog {position:fixed;inset:0;margin:auto;overflow:auto;box-sizing:border-box;width:720px;max-width:calc(100vw - 48px);max-height:calc(100dvh - 48px);padding:20px;border:1px solid var(--bc-border);border-radius:8px;background:var(--bc-surface);color:var(--bc-text)}
#jimengCreationView dialog::backdrop {background:rgb(0 0 0 / .35)}
#jimengCreationView dialog form {display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
#jimengCreationView .jc-search {display:flex;gap:8px;margin-bottom:12px}
#jcSearch {flex:1}
#jcPickerItems {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:16px}
#jcPickerItems article {display:flex;flex-direction:column;gap:8px;border:1px solid var(--bc-border);border-radius:6px;padding:12px;min-width:0}
#jcPickerItems img {width:100%;height:160px;object-fit:contain}
#jcPickerItems strong {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#jcMentions {display:flex;flex-wrap:wrap;gap:8px}
#jcSubmittedPrompt {white-space:pre-wrap;overflow-wrap:anywhere;max-height:60dvh;overflow:auto;font:inherit}
/* Media and reference controls share one exact width; removal stays on the media. */
#jimengCreationView .jc-strip {container-type:size;overflow:auto}
#jimengCreationView .jc-material {position:relative;flex:0 0 auto;width:clamp(44px,calc((100cqh - 48px)*.5625),160px);height:max-content}
#jimengCreationView .jc-video .jc-material {width:clamp(44px,calc((100cqh - 72px)*.5625),160px)}
html body #jimengCreationView :is(.jc-image,.jc-video) .jc-empty {height:calc(100cqh - 16px)}
#jimengCreationView .jc-media {flex:none;aspect-ratio:9/16;container-type:normal;overflow:hidden;width:100%}
#jimengCreationView .jc-media :is(img,video) {width:100%;height:100%;max-width:100%;display:block}
#jimengCreationView .jc-material-footer {width:100%}
#jimengCreationView [data-ref] {width:100%;height:28px;box-sizing:border-box;white-space:nowrap;justify-content:center;padding-inline:0;min-width:0}
#jimengCreationView [data-remove] {position:absolute;top:4px;right:4px;width:24px;height:24px;min-height:24px;padding:0;background:var(--bc-surface);z-index:1}
#jimengCreationView .jc-audio .jc-strip {container-type:normal}
#jimengCreationView .jc-audio .jc-material {width:100%;padding-top:28px}
#jimengCreationView .jc-audio .jc-media {aspect-ratio:auto}
#jimengCreationView .jc-prompt {position:relative;overflow:visible;z-index:2}
#jcMentionMenu {position:absolute;left:12px;right:12px;bottom:calc(100% - 40px);max-height:260px;overflow-y:auto;background:var(--bc-surface);border:1px solid var(--bc-border);border-radius:6px;padding:6px;box-shadow:0 8px 24px #0002;z-index:20}
#jcMentionMenu[hidden],#jcProgress[hidden] {display:none}
#jimengCreationView .jc-mention-option {display:flex;width:100%;align-items:center;gap:12px;text-align:left;padding:6px;height:54px;border:0;background:transparent}
#jimengCreationView .jc-mention-option[aria-selected=true] {background:var(--bc-selected)}
.jc-mention-option img,.jc-mention-icon {width:28px;height:40px;object-fit:contain;flex:none;font-size:12px}
.jc-mention-icon {display:flex;align-items:center;justify-content:center}
#jcProgress {display:flex;flex-direction:column;gap:6px;font-size:12px;line-height:18px;color:var(--bc-muted);max-height:32%;overflow:auto;flex-shrink:0;border-bottom:1px solid var(--bc-border);padding-bottom:8px}
#jcProgress strong {font-size:13px;color:var(--bc-text)}



#jimengCreationView .jc-slot-row {display:flex;gap:6px;flex:1;min-height:0;min-width:0;align-items:flex-start}
#jimengCreationView .jc-slot-row>.jc-strip {height:100%;min-width:0}
#jimengCreationView .jc-slot-row>.desktop-slot-add {flex-shrink:0}
html body #jimengCreationView .jc-empty {border-width:2px;padding:0;transition:none;transform:none;box-shadow:none}
html body #jimengCreationView .jc-empty.paste-ready {outline:2px solid var(--bc-muted);outline-offset:-2px;box-shadow:inset 0 0 0 3px var(--bc-hover)}
#jimengCreationView .jc-empty .slot-icon {font-size:22px}
#jimengCreationView .jc-empty .slot-text {font-size:12px}

html body #jimengCreationView .jc-image .jc-empty {width:clamp(44px,calc((100cqh - 48px)*.5625),160px);height:auto;align-self:flex-start;aspect-ratio:9/16}
html body #jimengCreationView .jc-video .jc-empty {width:clamp(44px,calc((100cqh - 72px)*.5625),160px);height:auto;align-self:flex-start;aspect-ratio:9/16}

/* Use the full panel height, with only the reference-button row reserved. */
#jimengCreationView .jc-media-row {grid-template-columns:var(--jc-video-panel-width,minmax(0,1fr)) minmax(208px,1fr)}
#jimengCreationView .jc-strip {scrollbar-gutter:auto;padding-bottom:4px}
html body #jimengCreationView .jc-image :is(.jc-material,.jc-empty) {width:var(--jc-image-width,100px);max-width:none}
html body #jimengCreationView .jc-video :is(.jc-material,.jc-empty) {width:var(--jc-video-width,100px);max-width:none}
#jimengCreationView .desktop-slot-add[hidden] {display:none!important}
#jimengCreationView .jc-audio .jc-empty:only-child {height:100%;min-height:84px}

#jimengCreationView .jc-media-row {grid-template-columns:repeat(2,minmax(0,1fr))}
#jimengCreationView .jc-audio .jc-strip {flex-direction:row;overflow-x:auto;overflow-y:hidden}
html body #jimengCreationView .jc-audio :is(.jc-material,.jc-empty) {width:var(--jc-video-width,100px);height:100%;min-height:0;max-width:none;flex:0 0 auto;padding-bottom:0}
html body #jimengCreationView .jc-audio .jc-empty {height:auto;aspect-ratio:9/16;align-self:flex-start}
#jimengCreationView .jc-audio .jc-media {flex:1;min-height:0;align-items:center;container-type:size}

#jimengCreationView .jc-media-row .jc-strip {justify-content:space-between;gap:16px}

#jimengCreationView .jc-material-footer .jc-move {flex:0 0 28px;min-width:28px;padding:0;cursor:grab;touch-action:none}
#jimengCreationView .jc-material-footer .jc-move:active {cursor:grabbing}
#jimengCreationView .jc-material-footer [data-ref] {flex:1;width:auto}
#jimengCreationView .jc-material.jc-dragging {opacity:.45}
#jimengCreationView .jc-material.jc-drop-target {outline:2px solid var(--bc-ring);outline-offset:2px;border-radius:6px}
