/* Approved Image layout; shared media workspace. Palette tokens stay shared. */
body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace{display:grid;grid-template-columns:minmax(400px,520px) minmax(0,1fr);gap:18px;align-items:start;max-width:none}
body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>.studio-page-hero{grid-column:1/-1;margin-bottom:0}
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>.media-controls{grid-column:1;grid-row:2;padding:20px;position:sticky;top:96px;max-height:calc(100dvh - 115px);overflow:auto;border-top:1px solid var(--line);border-radius:12px}
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>.atelier-resultat{display:none!important}
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>.atelier-recentes{grid-column:2;grid-row:2;padding:20px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:none;min-width:0}
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>.atelier-recentes>h2{margin:0 0 16px;font:650 23px/1.3 var(--font-body,system-ui)}
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>.atelier-recentes>[data-creations-hint]{display:none}
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace #imgPrompt{min-height:155px!important;resize:vertical}
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace .workshop-launch{position:sticky;bottom:-20px;margin:18px -20px -20px;padding:16px 20px;background:var(--surface);border-top:1px solid var(--line);z-index:2}
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace .workshop-price-note{font-size:11px}
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace .media-result-link{display:none!important}
.image-size-controls{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}
.image-size-controls>div{min-width:0}.image-size-controls select{width:100%;min-height:44px}.image-size-summary{margin:6px 0!important;font-size:12px}
.image-workspace-tabs{display:none}
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace .creations-grid{grid-template-columns:repeat(auto-fill,minmax(215px,1fr));gap:16px}
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace .image-creation-card{position:relative;background:var(--surface);border-radius:12px;min-width:0;overflow:hidden}
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace .image-creation-visual{display:block;width:100%;height:190px;aspect-ratio:auto;border:0;background:var(--surface-2,var(--surface));padding:0;border-radius:0;overflow:hidden;cursor:pointer;color:var(--muted)}
.image-creation-visual img{width:100%;height:100%;object-fit:contain;display:block}.image-preview-placeholder{display:grid;place-items:center;min-height:140px}
.image-creation-info{display:grid;gap:6px;padding:12px 14px 8px}.image-creation-info strong{font-size:13px}.image-creation-info small{font-size:11px;color:var(--muted)}
.image-creation-actions{display:flex;gap:4px;padding:4px 10px 12px;flex-wrap:nowrap}.image-creation-actions .btn{width:auto!important;min-height:36px;padding:0;font-size:12px}.image-creation-actions .image-reuse{color:var(--brand-text);border-color:var(--brand-text)}
.image-creation-actions [data-storage-action],.image-creation-dialog [data-storage-action]{min-height:44px;min-width:44px}
.image-creation-actions .image-keep{color:var(--brand-text);border-color:var(--brand-text)}
.image-creation-actions [data-storage-action][hidden],.image-creation-dialog [data-storage-action][hidden]{display:none!important}
.image-card-status:empty{display:none}.image-card-status{padding:0 12px 12px;font-size:12px;color:var(--danger,var(--warn))}
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace .image-creation-card>.creation-storage{padding:10px 12px;gap:3px;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap}
.image-creation-dialog{width:min(1060px,calc(100vw - 32px));max-height:90dvh;overflow:auto;padding:22px;border:1px solid var(--line);border-radius:16px;background:var(--surface);color:var(--ink)}
.image-creation-dialog::backdrop{background:#000b}.image-creation-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}.image-creation-dialog h2{margin:0;font:650 20px/1.4 var(--font-body,system-ui)}
.image-creation-dialog button{min-height:44px;width:auto}.image-detail-body{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:24px}.image-detail-body>img{width:100%;max-height:62dvh;object-fit:contain;border-radius:10px;background:var(--surface-2)}
.image-prompt-label{display:flex;align-items:center;justify-content:space-between;gap:10px}.image-prompt-label h3{font:650 15px/1.5 var(--font-body,system-ui)}.image-full-prompt{white-space:pre-wrap;overflow-wrap:anywhere;font:14px/1.7 var(--font-body,system-ui);max-height:42dvh;overflow:auto}.image-detail-settings{font-size:12px;color:var(--muted)}
.image-creation-dialog>footer{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:20px}.image-creation-dialog>footer>small{color:var(--muted);font-size:12px}
@media(min-width:761px){
 body.image-workspace-active>.phone>main{overflow:hidden;padding-bottom:14px}
 body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace{height:100%;min-height:0;grid-template-rows:auto minmax(0,1fr);align-items:stretch}
 body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>.media-controls{height:100%;max-height:none;min-height:0;position:relative;top:auto;overflow-y:auto;overscroll-behavior:contain}
 body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>:is(.media-controls,.atelier-recentes)>h2{position:sticky;top:-20px;z-index:3;margin:-20px -20px 18px;padding:18px 20px 14px;background:var(--surface);border-bottom:1px solid var(--line);isolation:isolate}
 body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>.atelier-recentes{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
}
@media(min-width:761px) and (max-height:500px){body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>.studio-page-hero{display:none}body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace{grid-template-rows:minmax(0,1fr)}body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>:is(.media-controls,.atelier-recentes){grid-row:1}}
@media(max-width:1100px){body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace{grid-template-columns:minmax(320px,380px) minmax(0,1fr)}:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace .creations-grid{grid-template-columns:minmax(0,1fr)}}
@media(max-width:760px){
 body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace:not([hidden]){display:flex!important;flex-direction:column;overflow:auto;padding-bottom:16px;gap:14px;align-items:stretch}
 body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>*{flex:none}
 :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>.studio-page-hero{display:none!important}
 :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>.image-workspace-tabs{display:flex;width:100%;gap:4px;padding:4px;background:var(--surface);border:1px solid var(--line);border-radius:10px}
 .image-workspace-tabs>.btn{flex:1;min-height:44px;font-size:13px}.image-workspace-tabs [aria-pressed=true]{background:var(--brand,var(--accent));color:var(--brand-ink,var(--on-accent))}
 body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>.media-controls{display:block!important;position:static;flex:none;height:auto;max-height:none;overflow:visible;padding:16px!important;width:100%;border:1px solid var(--line)!important;border-radius:12px;background:var(--surface)}
 body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace>.atelier-recentes{display:block!important;width:100%;padding:16px!important}
 body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace[data-image-pane=gallery]>.media-controls,body.studio-app :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace[data-image-pane=compose]>.atelier-recentes{display:none!important}
 :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace .workshop-launch{bottom:0;margin:16px -16px -16px;padding:14px 16px;border-radius:0 0 12px 12px}
 :is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace .creations-grid{grid-template-columns:minmax(0,1fr)}
 .image-detail-body{grid-template-columns:minmax(0,1fr);gap:16px}.image-detail-body>img{max-height:45dvh}.image-full-prompt{max-height:none}.image-creation-dialog{padding:16px;max-height:94dvh}.image-creation-dialog>footer{display:grid;grid-template-columns:1fr}.image-creation-dialog>footer>.btn{width:100%}
}

.image-gallery-tools{display:flex;gap:10px;margin-bottom:16px}.image-gallery-tools>input{flex:1;min-width:0}.image-gallery-tools>select{width:45%;min-width:0}.image-gallery-tools :is(input,select){min-height:44px;margin:0}

body.image-workspace-active{--world:none;--world-opacity:0}
.image-reference-help{margin:6px 0 10px;font-size:12px;color:var(--muted)}.image-reference-help summary{cursor:pointer;min-height:30px;padding:6px 0}
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace .image-workspace-tabs [aria-pressed=true]{background:var(--accent)!important;color:var(--on-accent,#131411)!important}
.image-gallery-tools :is(input,select){height:44px!important;padding:8px 12px!important;font-size:13px!important;white-space:nowrap}
@media(max-width:760px){:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace .workshop-launch{position:static}:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace #imgPrompt{min-height:125px!important}.image-creation-dialog>footer{position:sticky;bottom:-16px;padding:12px 0;background:var(--surface)}}

.model-parameter-toggle{display:flex!important;align-items:center;gap:10px;min-height:44px}.model-parameter-toggle input[type=checkbox]{width:18px!important;height:18px!important;min-height:18px;margin:0;flex:none}
/* Compact ordered sources, with keyboard-accessible 44 px actions. */
.image-workspace .image-ref-list,.image-workspace .video-studio-reference-list{display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
.image-workspace .image-ref-card,.image-workspace .workshop-input-file,.image-workspace .video-studio-reference{display:grid;grid-template-columns:52px minmax(0,1fr);gap:8px;padding:8px;border:1px solid var(--line);border-radius:9px;align-items:center;min-width:0}
.image-workspace .image-ref-card>img,.image-workspace .video-studio-reference>img,.image-workspace .workshop-input-file>img{width:52px;height:64px;object-fit:contain;border-radius:5px;margin:0;aspect-ratio:auto}
.image-workspace .reference-copy{min-width:0;display:grid;gap:4px}.reference-copy small,.video-studio-reference-caption>strong,.workshop-input-file>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.image-workspace .reference-actions{display:flex;gap:3px;grid-column:1/-1;justify-content:flex-end}
.image-workspace .reference-actions .icon-action,.image-workspace :is(.image-ref-actions,.workshop-input-actions,.video-studio-reference-actions) .icon-action{width:44px!important;min-width:44px;height:44px!important;min-height:44px;padding:10px!important;flex:none;margin:0}
.image-workspace .image-ref-actions{justify-content:flex-end}.image-workspace .image-ref-tip{font-size:11px}.image-workspace .video-studio-reference-caption{display:grid;gap:4px;min-width:0}.image-workspace .video-studio-reference>label{grid-column:1/-1}
.image-workspace .image-ref-card>.reference-actions{grid-column:2;margin-top:-8px}.image-workspace .image-ref-card>img{grid-row:1/3}
.image-workspace .video-studio-reference>:is(video,audio){width:100%;max-height:90px;grid-column:1/-1}.image-workspace .video-studio-reference>:is(video,audio)+.video-studio-reference-caption{grid-column:1/-1}
.image-creation-visual video{width:100%;height:100%;object-fit:contain;pointer-events:none}.media-detail-preview{min-width:0}.media-detail-preview :is(video,img,audio){width:100%;max-height:60dvh;object-fit:contain}.media-detail-preview .mesh-viewer{height:360px;max-width:100%}
.image-workspace .creations-filters{flex-wrap:wrap}.image-workspace .creation-storage time{font-size:10px}.image-workspace .image-creation-actions .icon-action{width:36px!important;max-width:36px;min-width:0;height:36px!important;min-height:36px;padding:0!important;flex:1 1 0}
.image-workspace .image-creation-info strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(min-width:761px){.image-workspace .workshop-composer>textarea{min-height:135px!important}}
@media(max-width:760px){.image-workspace .image-creation-visual{height:190px!important}.image-workspace .creations-grid{grid-template-columns:repeat(auto-fill,minmax(min(268px,100%),1fr))!important}.image-workspace .image-creation-actions .icon-action{width:44px!important;max-width:44px;min-width:44px;height:44px!important;min-height:44px}}

.creation-prompt-excerpt{font-size:12px!important;line-height:1.5!important;color:var(--muted);margin:0!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:0;overflow-wrap:anywhere}.creation-prompt-excerpt:empty{display:none}

/* Reserve space for the form; keep the price and action compact in every workshop. */
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace .workshop-launch{padding-block:8px;margin-top:10px}
.image-workspace .workshop-launch>.btn{margin:0!important}
.image-workspace .workshop-price{margin-bottom:4px}
.image-workspace .workshop-price>span{padding-block:6px}
.image-workspace .workshop-price-info>summary{min-height:32px}
.image-workspace .workshop-launch .notification-task{margin:2px 0 0;padding:4px 0;min-height:28px}
.image-workspace .workshop-feedback .msg{margin:0;padding:6px 9px;font-size:12px;line-height:1.45}

/* Align the preview, filename and removal action on one row. */
.image-workspace :is(.video-studio-reference,.workshop-input-file,.image-ref-card){grid-template-columns:52px minmax(0,1fr) auto;align-items:center}
.image-workspace :is(.video-studio-reference,.workshop-input-file,.image-ref-card)>img{height:52px;grid-row:auto}
.image-workspace :is(.video-studio-reference,.workshop-input-file,.image-ref-card)>.reference-actions{grid-column:3;grid-row:auto;margin:0;align-items:center}
.image-workspace .video-studio-reference-caption{display:flex;flex-direction:row;align-items:center;gap:8px;min-width:0}
.image-workspace .video-studio-reference-caption>strong{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:1.45}
.image-workspace .workshop-input-file>span{display:block;min-width:0}
.image-workspace .workshop-input-file>span :is(strong,small){display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.image-workspace :is(.video-studio-reference-list,.image-ref-list){container-type:inline-size}
.image-workspace :is(.video-studio-reference,.workshop-input-file,.image-ref-card)>.reference-actions{justify-content:center}
@container(max-width:350px){.image-workspace :is(.video-studio-reference,.image-ref-card){grid-template-columns:52px minmax(0,1fr)}.image-workspace :is(.video-studio-reference,.image-ref-card)>.reference-actions{grid-column:1/-1;justify-content:center}}
/* Equal-height rows keep the action bars aligned despite varying descriptions. */
:is(#s-image,#s-video,#s-audio,#s-mesh3d).image-workspace .image-creation-card{display:flex;flex-direction:column}
.image-workspace .image-creation-visual{flex-shrink:0}
.image-workspace .image-creation-info{align-content:start}
.image-workspace .image-creation-actions{margin-top:auto}
.image-workspace .video-studio-reference>:is(video,audio)+.video-studio-reference-caption{grid-column:1/3}
/* Keep the selected value on one line; the open menu can still wrap long options. */
html[data-ui] body .image-workspace select:not([multiple]){height:44px;min-height:44px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-block:8px;line-height:1.5}
.image-workspace .video-studio-basics{grid-template-columns:minmax(86px,.65fr) minmax(0,1.35fr);align-items:end}
.image-workspace .video-studio-field>span{line-height:18px}
@media(max-width:760px){.image-workspace .video-studio-basics{grid-template-columns:minmax(0,1fr)}}

/* Shared disclosures across Image, Video, Audio and 3D. */
.image-workspace .workshop-composer details:is(.video-studio-advanced,.workshop-advanced,.image-reference-help,.mobile-notification-options)>summary{box-sizing:border-box;display:flex;align-items:center;gap:10px;width:100%;min-height:44px;margin:0;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);font:600 13px/20px var(--font-body,system-ui);cursor:pointer;list-style:none;text-align:start}
.image-workspace .workshop-composer details:is(.video-studio-advanced,.workshop-advanced,.image-reference-help,.mobile-notification-options)>summary::-webkit-details-marker{display:none}
.image-workspace .workshop-composer details:is(.video-studio-advanced,.workshop-advanced,.image-reference-help,.mobile-notification-options)>summary::marker{content:''}
.image-workspace .workshop-composer details:is(.video-studio-advanced,.workshop-advanced,.image-reference-help,.mobile-notification-options)>summary::before{content:'';display:block;flex:0 0 6px;width:6px;height:6px;border-inline-end:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);margin-inline:0 2px}
.image-workspace .workshop-composer details:is(.video-studio-advanced,.workshop-advanced,.image-reference-help,.mobile-notification-options)[open]>summary{margin-bottom:10px}
.image-workspace .workshop-composer details:is(.video-studio-advanced,.workshop-advanced,.image-reference-help,.mobile-notification-options)[open]>summary::before{transform:rotate(45deg)}
.image-workspace .workshop-composer details:is(.video-studio-advanced,.workshop-advanced,.image-reference-help,.mobile-notification-options)>summary:hover{border-color:var(--brand-text)}
.image-workspace .workshop-composer details:is(.video-studio-advanced,.workshop-advanced,.image-reference-help,.mobile-notification-options)>summary:focus-visible{outline:2px solid var(--brand-text);outline-offset:3px}
.image-workspace .workshop-advanced{border-top:0;padding-top:0;margin:10px 0}
.image-workspace .image-reference-help{margin:10px 0}

.image-creation-visual.is-generating{opacity:1}
.image-creation-visual.is-generating .image-preview-placeholder{display:grid;place-items:center;align-content:center;gap:14px}
.image-creation-visual.is-generating .image-preview-placeholder::before{content:"";width:28px;height:28px;box-sizing:border-box;border:3px solid var(--line);border-top-color:var(--brand);border-radius:50%;animation:creation-working 1s linear infinite}
@keyframes creation-working{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.image-creation-visual.is-generating .image-preview-placeholder::before{animation:none}}

/* One compact action row per detail dialog, shared by all media families. */
.image-creation-dialog>footer{display:block;position:sticky;bottom:-22px;margin:16px -22px -22px;padding:14px 22px;background:var(--surface);border-top:1px solid var(--line);border-radius:0 0 16px 16px;z-index:2}
.image-detail-actions{display:flex;align-items:center;gap:8px;flex-wrap:nowrap;overflow-x:auto;padding:3px;scrollbar-width:thin}
.image-creation-dialog .icon-action{display:inline-flex;align-items:center;justify-content:center;width:44px!important;height:44px!important;min-width:44px;min-height:44px;padding:0!important;flex:0 0 44px;margin:0!important}
.image-creation-dialog .image-keep{color:var(--brand-text);border-color:var(--brand-text)}
.image-creation-dialog .media-detail-preview{margin-top:0!important}
@media(max-width:760px){.image-creation-dialog>footer{bottom:-16px;margin:16px -16px -16px;padding:12px 13px}.image-detail-actions{gap:6px}}

.creations-storage-help{flex-basis:100%;font-size:12px;color:var(--muted)}
.creations-storage-help>summary{cursor:pointer;min-height:28px;align-content:center}
.creations-storage-help>p{margin:4px 0 8px;max-width:85ch;line-height:1.5}

.image-workspace .creations-toolbar{flex-wrap:wrap}

/* The main gallery uses the workshop cards and the same responsive grid. */
#s-gallery #galerie,#s-gallery #gensList{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(260px,100%),1fr));gap:16px;align-items:stretch}
#s-gallery #gensList>select,#s-gallery #gensList>.hint,#s-gallery #galerie>.empty,#s-gallery [data-gallery-more]{grid-column:1/-1}
#s-gallery .galerie-card,#s-gallery .image-creation-card{display:flex;flex-direction:column;position:relative;min-width:0;overflow:hidden;border:1px solid var(--line);border-radius:12px;background:var(--surface);padding:0;gap:0}
#s-gallery .image-creation-visual,#s-gallery .galerie-thumb{display:block;width:100%;height:190px;min-height:190px;aspect-ratio:auto;border:0;border-radius:0;padding:0;overflow:hidden;background:var(--surface-2,var(--surface));color:var(--muted)}
#s-gallery .image-creation-visual{cursor:pointer}#s-gallery .galerie-thumb img{width:100%;height:100%;object-fit:contain}
#s-gallery .creation-storage{padding:10px 12px;gap:3px;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap}
#s-gallery .image-creation-actions{margin-top:auto;flex-wrap:wrap}#s-gallery .galerie-info{padding:12px 14px 8px}#s-gallery .result-actions{padding:4px 10px 12px;margin-top:auto}
#s-gallery .creation-prompt-excerpt{overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:anywhere}
#s-gallery [hidden]{display:none!important}#s-gallery .conversation-gallery-cover{display:grid;place-items:center}#s-gallery .conversation-gallery-cover>svg{width:52px;height:52px}

#s-gallery .conversation-gallery-card{grid-column:auto}#s-gallery .conversation-gallery-card .galerie-nom{font:650 13px/1.5 var(--font-body,system-ui)}
#s-gallery .card>h2{font:650 23px/1.3 var(--font-body,system-ui)}
