/* Only the creation browsing surface; shared input/navigation styles stay unchanged. */
#creation-top{height:var(--cw-height,560px);min-height:360px;display:flex;flex-direction:column;color:#eee;margin-bottom:12px}
#creation-top [hidden]{display:none!important}
#creation-top button,.cw-detail button{font:inherit;cursor:pointer}
#creation-top svg,.cw-detail svg{width:18px;height:18px;flex-shrink:0}




#cw-panel{display:flex;flex-direction:column;min-height:0;flex:1}
.cw-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:14px;flex-shrink:0;margin-bottom:22px}
.cw-filters,.cw-view-actions,.cw-view{display:flex;gap:10px;align-items:center}
.cw-view-actions{margin-left:auto}
.cw-button{display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:40px;padding:8px 14px;background:#191919;color:#ddd;border:1px solid #363636;border-radius:4px;font:inherit;text-decoration:none;white-space:nowrap}
.cw-button:hover{background:#292929;color:white}
.cw-filters{gap:24px}
.cw-media-filter{display:flex;align-items:center;border:1px solid #3d3d3d;border-radius:12px;padding:5px;gap:3px}
.cw-media-filter button{min-height:40px;min-width:72px;padding:8px 18px;border-radius:7px;color:#c9c9c9;font-size:15px!important;font-weight:500!important;white-space:nowrap}
.cw-media-filter button[aria-pressed=true]{background:#484848;color:#fff}
.cw-media-filter button:hover{background:#303030;color:#fff}
.cw-media-filter button[aria-pressed=true]:hover{background:#505050}
.cw-favorites{display:flex;align-items:center;gap:10px;cursor:pointer;color:#ddd;white-space:nowrap;font-size:15px}
.cw-favorites input{appearance:none;display:grid;place-content:center;width:21px;height:21px;margin:0;border:2px solid #888;border-radius:5px;background:transparent;cursor:pointer}
.cw-favorites input:checked{background:#ddd;border-color:#ddd}
.cw-favorites input:checked::after{content:'';width:9px;height:5px;border-left:2px solid #222;border-bottom:2px solid #222;transform:translateY(-1px) rotate(-45deg)}
.cw-favorites input:focus-visible{outline:1px solid #ddd;outline-offset:3px}
.cw-view{gap:0;border:1px solid #363636;border-radius:4px;overflow:hidden}
.cw-view button{display:flex;align-items:center;gap:8px;min-height:38px;padding:8px 15px;color:#b9b9be}
.cw-view button[aria-pressed=true]{background:#363636;color:white}
.cw-view button:hover{background:#292929;color:white}
.cw-scroll{min-height:0;overflow:auto;overscroll-behavior:contain;flex:1;padding:3px 3px 20px;scrollbar-width:none;outline-offset:-2px}
.cw-batches.is-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 16px}
.cw-batch{min-width:0;scroll-margin-top:10px}
.cw-batch-media{position:relative;border-radius:8px;overflow:hidden;background:#202020}
.cw-result{position:relative;min-width:0;background:#202020;border-radius:6px;overflow:hidden}
.cw-open{position:relative;width:100%;display:block;padding:0;color:#ddd;aspect-ratio:16/9;background:#202020}
.cw-open>img,.cw-open>video{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:contain}
.cw-open>video{pointer-events:none}
.cw-thumbs{position:absolute;left:9px;bottom:9px;right:9px;display:flex;gap:6px;overflow-x:auto;padding:3px;pointer-events:none}
.cw-thumbs button{pointer-events:auto;flex:0 0 40px;width:40px;height:40px;border:2px solid transparent;border-radius:7px;padding:2px;background:#191919ba;overflow:hidden}
.cw-thumbs button[aria-pressed=true]{border-color:white}
.cw-thumbs img{width:100%;height:100%;object-fit:cover;border-radius:3px}
.cw-actions{position:absolute;right:8px;top:8px;display:flex;gap:5px;opacity:0;transition:opacity .12s}
.cw-result:hover .cw-actions,.cw-result:focus-within .cw-actions{opacity:1}
.cw-actions>*{display:grid;place-items:center;width:34px;height:34px;background:#171717b8;color:white;border:1px solid #ffffff15;border-radius:4px;text-decoration:none}
.cw-actions>*:hover{background:#444}.cw-actions [aria-pressed=true] svg{fill:currentColor}
.cw-batches.is-record{display:flex;flex-direction:column;gap:24px}
.is-record .cw-batch{border-bottom:1px solid #2e2e2e;padding-bottom:24px}
.cw-record-header{display:flex;gap:18px;justify-content:space-between;align-items:start;margin-bottom:14px}
.cw-record-header>div{min-width:0}
#creation-top .cw-prompt{margin:0 0 7px;color:#e9e9e9;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
#creation-top .cw-meta,.cw-meta{margin:0;color:#aaa;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.cw-text{display:inline-flex;align-items:center;gap:7px;padding:4px 0;color:#c7c7cd;white-space:nowrap;font-size:12px!important}
.cw-text:hover{color:white;text-decoration:underline}
.cw-record-images{display:flex;flex-wrap:wrap;gap:10px}
.cw-record-images .cw-result{width:min(320px,calc((100% - 10px)/2))}
.cw-record-images .cw-result:only-child{width:min(380px,100%)}
.cw-status-card{aspect-ratio:16/9;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;background:#202020;border-radius:8px;padding:12px;color:#bbb;text-align:center}
#creation-top .cw-status-card>svg{width:18px;height:18px;color:#aaa}
.cw-status-card .cw-button{min-height:28px;padding:4px 10px;font-size:12px}
.cw-status-card strong{font-size:13px;color:#eee;font-weight:500}.cw-status-card span{font-size:12px}
.cw-status-card progress{width:140px;height:5px;accent-color:#aaa}
.is-record .cw-status-card{width:min(380px,100%);aspect-ratio:16/9}
.cw-status-card.is-failed>strong{color:#f1c2bc}
.cw-open>.cw-audio{position:absolute;inset:0;padding:12px}.cw-open .cw-audio>span{-webkit-line-clamp:1}
.cw-audio{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;height:100%;padding:16px;color:#c6c6ca}
#creation-top .cw-audio>svg{width:32px;height:32px;flex-shrink:0}.cw-audio>span{font-size:12px;max-width:300px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;line-height:1.6}
.cw-task-notice{display:flex;align-items:center;gap:16px;flex-wrap:wrap;min-height:34px;flex-shrink:0;font-size:12px;color:#aaa;border-top:1px solid #2a2a2a;padding:6px 0}
.cw-empty{min-height:240px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#999;padding:24px}
.cw-empty strong{font-size:18px;color:#ddd;font-weight:500}.cw-empty p{font-size:13px}
.cw-history-hidden .cw-filters,.cw-history-hidden .cw-view,.cw-history-hidden .cw-scroll{visibility:hidden}
.cw-gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.cw-gallery-card{display:block;position:relative;aspect-ratio:1;padding:0;border-radius:4px;overflow:hidden;background:#202020;text-align:left}
.cw-gallery-card img{width:100%;height:100%;object-fit:cover;display:block}
.cw-gallery-card span{position:absolute;bottom:0;left:0;right:0;padding:32px 12px 12px;color:white;background:linear-gradient(transparent,#000a);font-size:14px}
.cw-gallery.is-inspiration{align-items:start}.cw-gallery.is-inspiration .cw-gallery-card{aspect-ratio:3/4}
#creation-top button:focus-visible,#creation-top a:focus-visible,.cw-detail button:focus-visible,.cw-detail a:focus-visible{outline:1px solid #ddd;outline-offset:-2px}
.cw-detail{width:min(900px,calc(100vw - 32px));max-height:90dvh;overflow:auto;border:1px solid #444;border-radius:8px;padding:24px;background:#202020;color:#eee;box-shadow:0 16px 80px #0008;font:14px Inter,sans-serif}
.cw-detail::backdrop{background:#000b}.cw-detail-close{float:right;display:grid;place-items:center;width:32px;height:32px;background:#333;border:0;color:#eee;border-radius:4px;margin-bottom:12px}
.cw-detail-media{clear:both;background:#151515;border-radius:4px;overflow:hidden}.cw-detail-media>img,.cw-detail-media>video{display:block;max-width:100%;width:100%;height:auto;max-height:55dvh;object-fit:contain}.cw-detail-media audio{width:min(100%,420px)}
.cw-detail-prompt{white-space:pre-wrap;overflow-wrap:anywhere;max-height:25dvh;overflow:auto;line-height:1.7}
.cw-detail-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}
.cw-detail-refs{display:flex;gap:8px;margin-top:12px}.cw-detail-refs img{width:48px;height:48px;object-fit:contain}
.cw-error{color:#f1c2bc;padding:12px}.cw-media-error{color:#bbb;font-size:12px}
@media(max-width:1100px){.cw-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}.cw-toolbar{gap:8px}.cw-filters{gap:8px}.cw-view button{padding:8px 10px}.cw-button{gap:8px;padding:8px 10px}}

@media(max-width:1099px){.cw-media-filter button{min-width:60px;padding:8px 12px}.cw-filters{gap:16px}}
@media(max-width:767px){#creation-top{height:var(--cw-height,440px);min-height:360px}.cw-toolbar{margin-bottom:16px;row-gap:10px}.cw-filters{width:100%;gap:16px}.cw-media-filter{flex:1;padding:4px;gap:1px}.cw-media-filter button{flex:1;min-width:0;min-height:36px;padding:6px 10px;font-size:14px!important}.cw-favorites{font-size:14px;gap:8px}.cw-favorites input{width:20px;height:20px}.cw-view-actions{margin-left:auto;gap:8px}.cw-hide span{font-size:12px}.cw-view button span{display:none}.cw-view button{padding:8px 10px}.cw-batches.is-grid{grid-template-columns:1fr;gap:22px}.cw-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.cw-gallery-card span{font-size:12px}.cw-record-header{gap:12px}.cw-record-header>.cw-text{font-size:11px!important}.cw-record-images .cw-result{width:100%;max-width:380px}.cw-record-images .cw-result:only-child{width:100%}.cw-detail{padding:16px}.cw-actions{opacity:1}.cw-actions>*{width:36px;height:36px}.cw-task-notice{gap:12px}}
@media(hover:none){.cw-actions{opacity:1}}
@media(prefers-reduced-motion:reduce){.cw-actions{transition:none}}

/* History fills the viewport; the composer floats over it without a dock backdrop. */
#workspace.creation-page:has(.create-dock){padding-bottom:0}
#creation-top{min-height:0;margin-bottom:0}
#creation-top .cw-scroll{padding-bottom:calc(var(--history-dock-height,272px) + 32px)}
#creation-top .cw-task-notice{border-top:0}
.create-dock{position:relative;height:0;padding:0;background:none}
.create-dock #composer-slot{overflow-anchor:none}
#creation-app:has(.create-dock)>.hc-enter{animation:none}

/* Record view: type / model, prompt, then full-size media. */
.cw-batches.is-record{gap:36px}
.is-record .cw-batch{border:0;padding:0}
.cw-record-header{align-items:center;gap:12px;margin-bottom:12px}
.cw-record-heading{display:flex;align-items:center;flex-wrap:wrap;gap:6px 8px}
#creation-top .cw-record-heading h3{display:flex;align-items:center;gap:8px;margin:0 4px 0 0;font-size:16px;font-weight:600;line-height:1.5}
#creation-top .cw-record-heading h3 svg{width:20px;height:20px}
.cw-model-chip,.cw-reference-chip{display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:3px 8px;background:#383838;border-radius:4px;color:#eee;font-size:12px;line-height:22px;overflow-wrap:anywhere}
.cw-reference-chip img{width:22px;height:22px;object-fit:cover;border-radius:2px}
.cw-reference-chip{padding:3px 8px 3px 3px}
.cw-record-edit{display:flex;align-self:flex-start;flex-shrink:0;background:#292929;border-radius:6px;overflow:hidden}
.cw-record-edit button{width:30px;height:30px;display:grid;place-items:center;color:#eee}
.cw-record-edit button:hover{background:#444}
#creation-top .cw-record-prompt{font-size:14px;line-height:1.6;color:#bdbbc6;margin:0 0 12px;white-space:pre-wrap;overflow-wrap:anywhere}
.cw-record-images{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.cw-record-images .cw-record-result,.cw-record-images .cw-record-result:only-child{width:min(100%,960px);max-width:none;border-radius:4px}
.cw-record-images .cw-record-result.is-image{width:min(100%,620px);border-radius:0}
.cw-record-result .cw-open{aspect-ratio:var(--result-ratio,1);max-height:720px}
.cw-record-result>video{display:block;width:100%;aspect-ratio:var(--result-ratio,16/9);max-height:720px;background:#191919;object-fit:contain}
.cw-record-actions{opacity:1;right:10px;top:10px;gap:0;border-radius:7px;background:#171717cf;padding:2px;backdrop-filter:blur(8px)}
.cw-record-actions>*{background:none;border:0;border-radius:4px;width:30px;height:28px}
.cw-result-tools{display:flex;align-items:center;gap:0;padding:5px;background:#333;overflow-x:auto;scrollbar-width:none}
.cw-result-tools button{flex-shrink:0;white-space:nowrap;padding:4px 9px;color:#eee;font-size:12px;line-height:20px;border-radius:4px}
.cw-result-tools button:hover{background:#ffffff20}
.is-image .cw-result-tools{position:absolute;bottom:10px;left:50%;transform:translateX(-50%);max-width:calc(100% - 20px);border-radius:7px;background:#171717d9;padding:3px}
.is-image .cw-result-tools button{padding:4px 8px;font-size:12px}
.is-record .cw-status-card{position:relative;width:min(100%,960px);min-height:300px;aspect-ratio:16/9;background:#282828;border-radius:4px;gap:16px;padding:24px}
#creation-top .is-record .cw-status-card>svg{width:64px;height:64px;color:#929292}
#creation-top .is-record .cw-status-card.is-failed>svg{color:#f2ad6d}
.is-record .cw-status-card strong{font-size:18px;font-weight:500;color:#d0d0d0}
.is-record .cw-status-card span{font-size:14px;color:#aaa}
.is-record .cw-status-card .cw-button{font-size:14px;padding:8px 16px;min-height:36px;background:#383838}
.cw-music{display:flex;align-items:center;gap:16px;width:min(100%,600px);padding:10px;border-radius:10px;background:#333}
.cw-album{position:relative;flex:0 0 64px;height:64px;border-radius:5px;overflow:hidden}
.cw-album>img{width:100%;height:100%;object-fit:cover}
.cw-album>span{position:absolute;inset:8px;border-radius:50%;display:grid;place-items:center;background:repeating-radial-gradient(circle,#0a0a0a 0 2px,#262626 3px,#090909 4px 6px);border:1px solid #555;color:white}
#creation-top .cw-album svg{width:28px;height:28px}
.cw-track{width:270px;max-width:calc(100% - 150px);min-width:0}
.cw-wave{display:flex;align-items:end;gap:2px;height:32px;background:none}
.cw-wave i{flex:1;background:#777;min-width:1px}
.cw-track-time{display:flex;justify-content:space-between;margin-top:5px;font-size:12px;color:#fff;font-variant-numeric:tabular-nums}
.cw-play{display:grid;place-items:center;flex:0 0 32px;height:32px;margin-left:auto;margin-right:16px;background:#555;border-radius:8px;color:#fff}
.cw-play:hover{background:#666}
.cw-play svg{fill:currentColor}
.cw-music audio{display:none}
@media(max-width:767px){
 .cw-batches.is-record{gap:36px}
 .cw-record-header{gap:8px;margin-bottom:12px}
 .cw-record-heading{gap:7px}
 #creation-top .cw-record-heading h3{width:100%;font-size:16px;gap:8px}
 #creation-top .cw-record-heading h3 svg{width:20px;height:20px}
 .cw-model-chip,.cw-reference-chip{font-size:12px;min-height:30px;padding:3px 8px;line-height:22px}
 .cw-reference-chip img{width:22px;height:22px}
 .cw-record-edit button{width:32px;height:32px}
 #creation-top .cw-record-prompt{font-size:14px;margin-bottom:12px;line-height:1.6}
 .cw-record-actions{top:6px;right:6px}
 .cw-record-actions>*{width:32px;height:32px}
 .is-image .cw-result-tools{position:static;transform:none;max-width:100%;border-radius:0;padding:5px;background:#303030}
 .cw-result-tools button{font-size:12px;padding:5px 9px}
 .is-record .cw-status-card{min-height:230px;padding:20px;gap:12px}
 .is-record .cw-status-card strong{font-size:16px}
 .cw-music{padding:10px;gap:12px;border-radius:8px}
 .cw-album{flex-basis:58px;height:58px}
 .cw-album>span{inset:5px}
 .cw-track{flex:1;max-width:none}.cw-wave{height:28px;gap:1px}
 .cw-track-time{font-size:12px}
 .cw-play{margin-right:0;flex-basis:34px;height:34px}
}
/* Images keep their actual proportions instead of padding to the task ratio. */
.cw-record-result.is-image .cw-open{aspect-ratio:auto;max-height:none}
.cw-record-result.is-image .cw-open>img{position:static;width:100%;height:auto;max-height:720px;object-fit:contain}

/* Compact history toolbar, matched to the reference density. */
#creation-top .cw-toolbar{margin-bottom:16px;gap:10px}
#creation-top .cw-media-filter{padding:4px;gap:2px;border-radius:8px}
#creation-top .cw-media-filter button{min-height:30px;min-width:56px;padding:4px 12px;font-size:13px!important;border-radius:4px}
#creation-top .cw-filters{gap:20px}
#creation-top .cw-favorites{font-size:13px;gap:8px}
#creation-top .cw-favorites input{width:17px;height:17px;border-radius:4px}
#creation-top .cw-view button{min-height:30px;padding:5px 10px;font-size:12px}
#creation-top .cw-hide{min-height:32px;padding:5px 10px;font-size:12px}
#creation-top .cw-record-edit svg,#creation-top .cw-record-actions svg{width:16px;height:16px}
@media(max-width:767px){
 #creation-top .cw-media-filter button{min-width:0;min-height:32px;padding:4px 10px}
 #creation-top .cw-filters{gap:12px}
 #creation-top .cw-record-heading h3{font-size:15px}
 .cw-batches.is-record{gap:28px}
}

/* Batch images sit side by side; actions belong to the hovered result. */
.cw-record-images:has(>.is-image){flex-direction:row;flex-wrap:wrap;align-items:flex-start;gap:8px}
.cw-record-images:has(>.is-image:nth-child(2))>.is-image{width:calc((100% - 8px)/2)}
@media(hover:hover){
 .cw-record-result.is-image .cw-record-actions,
 .cw-record-result.is-image .cw-result-tools{opacity:0;pointer-events:none}
 .cw-record-result.is-image:hover .cw-record-actions,
 .cw-record-result.is-image:hover .cw-result-tools,
 .cw-record-result.is-image:focus-within .cw-record-actions,
 .cw-record-result.is-image:focus-within .cw-result-tools{opacity:1;pointer-events:auto}
}
@media(max-width:767px){
 .cw-record-images:has(>.is-image:nth-child(2)){flex-wrap:nowrap;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:none}
 .cw-record-images:has(>.is-image:nth-child(2))>.is-image{flex:0 0 88%;width:88%;scroll-snap-align:start}
}

/* Return to the latest record, above the floating composer. */
#cw-panel{position:relative}
.cw-to-bottom{position:absolute;right:10px;bottom:calc(var(--history-dock-height,272px) + 38px);z-index:12;display:grid;place-items:center;width:36px;height:36px;border:1px solid #555;border-radius:50%;background:#292929;color:#eee;box-shadow:0 3px 12px #0005}
.cw-to-bottom{opacity:0;visibility:hidden;pointer-events:none;transition:opacity 180ms ease,visibility 0s linear 180ms}
.cw-to-bottom.is-visible{opacity:1;visibility:visible;pointer-events:auto;transition-delay:0s}
@media(prefers-reduced-motion:reduce){.cw-to-bottom{transition:none}}
.cw-to-bottom:hover{background:#414141}
@media(max-width:767px){.cw-to-bottom{right:4px;width:36px;height:36px}}

.cw-open.cw-image-display{cursor:default}

/* Hidden history keeps the shared composer and offers the Home starting points. */
#creation-app:has(.create-dock)>.hc-enter{position:relative}
.create-welcome[hidden]{display:none}
.create-welcome{pointer-events:none;position:absolute;inset:70px 0 calc(var(--home-dock-height,330px) + 24px);display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:130px;text-align:center;overflow:auto;padding:16px 0}
.create-welcome .home-title{font-size:36px;line-height:1.5;letter-spacing:.2px;font-weight:600;margin:0 0 24px}
.create-welcome #home-shortcuts{pointer-events:auto;width:100%;margin:0;max-width:1000px}
.create-welcome .home-shortcut-row{flex-wrap:wrap;overflow:visible}
@media(max-width:767px){.create-welcome{top:100px;min-height:110px;padding:8px 0}.create-welcome .home-title{font-size:clamp(20px,5.8vw,30px);letter-spacing:0;margin-bottom:14px}.create-welcome .home-shortcut-row{flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start}.create-welcome .home-shortcut-row button{min-height:40px}}

/* Grid results share record actions; overflow tools use a top-layer menu. */
.is-grid .cw-record-result .cw-open,.is-grid .cw-record-result>video{aspect-ratio:16/9;max-height:none}
.is-grid .cw-record-result.is-image .cw-open,.is-grid .cw-batch[data-media="image"]>.cw-status-card{aspect-ratio:1/1}
.is-grid .cw-record-result.is-image .cw-open>img{width:100%;height:100%;object-fit:contain;position:absolute;inset:0}
.is-grid .cw-result-tools{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 12px);background:#171717d9;border-radius:7px;padding:3px}
.is-grid .cw-thumbs{position:absolute;inset:auto auto 12px 12px;transform:none;z-index:2;width:max-content;max-width:calc(100% - 96px);height:56px;padding:4px;min-height:0;gap:6px;border-radius:8px;background:#171717c9;overflow-x:auto;scrollbar-width:none}
.is-grid .cw-batch-media:has(.cw-thumbs) .cw-result-tools{bottom:12px;left:auto;right:8px;transform:none;z-index:3}
.is-grid .cw-music{width:100%;aspect-ratio:auto;height:80px;min-height:0;box-sizing:border-box;border-radius:0;gap:12px;padding:12px;background:#292929}
.is-grid .cw-album{width:52px;height:52px;flex:0 0 52px}
.is-grid .cw-track{min-width:0;max-width:none;flex:1}
.is-grid .cw-wave{width:100%;overflow:hidden}
.is-grid .cw-play{flex-shrink:0;width:30px;height:30px}
.is-grid .cw-record-actions{gap:0;right:6px;top:6px}
.is-grid .cw-record-actions>*{width:28px;height:28px}
.cw-more-menu{position:fixed;inset:auto;margin:0;padding:5px;border:1px solid #ffffff26;border-radius:7px;background:#292929;color:#eee;min-width:128px;max-height:calc(100dvh - 16px);overflow:auto;box-shadow:0 8px 24px #0006}
.cw-more-menu:popover-open{display:flex;flex-direction:column}
.cw-more-menu button{text-align:left;padding:9px 12px;color:inherit;background:none;border:0;border-radius:4px;font-family:inherit;font-size:13px;line-height:1.4;cursor:pointer}
.cw-more-menu button:hover{background:#ffffff15}
.cw-more-menu button:focus-visible{outline:1px solid #ccc;outline-offset:-2px}
@media(hover:hover){.is-grid .cw-result-tools,.is-grid .cw-record-actions{opacity:0;pointer-events:none}.is-grid .cw-result:hover .cw-result-tools,.is-grid .cw-result:focus-within .cw-result-tools,.is-grid .cw-result:hover .cw-record-actions,.is-grid .cw-result:focus-within .cw-record-actions{opacity:1;pointer-events:auto}}

/* Batch selection stays inside the preview at a comfortable touch size. */
.is-grid .cw-thumbs button{flex-basis:48px;width:48px;height:48px;padding:2px;border-radius:6px}
.is-grid .cw-thumbs button:focus-visible{outline:2px solid #fff;outline-offset:-4px}

/* Size the grid against the available history width, excluding navigation. */
.cw-scroll{container-type:inline-size}
@container(min-width:1000px){.cw-batches.is-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@container(min-width:1360px){.cw-batches.is-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:767px){.cw-batches.is-grid{grid-template-columns:1fr}}

/* Icon-only history controls with a tooltip above each trigger. */
#creation-top .cw-view{overflow:visible}
#creation-top .cw-view button,#creation-top .cw-hide{position:relative;justify-content:center;width:34px;height:32px;min-height:32px;padding:6px}
.cw-view button:first-child{border-radius:3px 0 0 3px}.cw-view button:last-child{border-radius:0 3px 3px 0}
.cw-view button::after,.cw-hide::after{content:attr(aria-label);position:absolute;bottom:calc(100% + 7px);left:50%;transform:translateX(-50%);z-index:40;padding:4px 8px;border:1px solid #ffffff20;border-radius:5px;background:#343434;color:#eee;white-space:nowrap;font-size:12px;line-height:18px;font-weight:400;box-shadow:0 3px 10px #0004;opacity:0;visibility:hidden;pointer-events:none;transition:opacity 120ms ease,visibility 120ms}
.cw-view button::before,.cw-hide::before{content:"";position:absolute;bottom:calc(100% + 3px);left:50%;transform:translateX(-50%);border:4px solid transparent;border-top-color:#343434;border-bottom:0;z-index:41;opacity:0;visibility:hidden;pointer-events:none}
.cw-view button:hover::after,.cw-view button:focus-visible::after,.cw-hide:hover::after,.cw-hide:focus-visible::after,
.cw-view button:hover::before,.cw-view button:focus-visible::before,.cw-hide:hover::before,.cw-hide:focus-visible::before{opacity:1;visibility:visible}
@media(prefers-reduced-motion:reduce){.cw-view button::after,.cw-hide::after{transition:none}}

/* Align history content with the shared composer, leaving its toolbar full-width. */
#creation-top[data-view="record"] .cw-scroll{width:100%;max-width:1100px;margin-inline:auto;padding-inline:0}

/* Three or four image results share one evenly divided row in record view. */
.cw-record-images:has(>.is-image:nth-child(3)){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));overflow:visible;scroll-snap-type:none}
.cw-record-images:has(>.is-image:nth-child(4)){grid-template-columns:repeat(4,minmax(0,1fr))}
.cw-record-images:has(>.is-image:nth-child(3))>.is-image{width:100%;min-width:0;max-width:none}

/* Single results and status cards share the half-composer / half-viewport limit. */
.cw-record-images>.cw-record-result:only-child,
.cw-record-images>.cw-record-result.is-image:only-child,
.cw-record-images>.cw-record-result.is-video:only-child,
.cw-record-images>.cw-music:only-child{width:50%;max-height:50dvh}
.cw-record-images>.cw-record-result.is-image:only-child .cw-open>img{max-height:50dvh;object-fit:contain}
.cw-record-images>.cw-record-result.is-video:only-child>video{max-height:calc(50dvh - 48px);object-fit:contain}
.is-record .cw-status-card{width:50%;min-height:0;height:min(310px,50dvh);max-height:50dvh;overflow:auto}
@media(max-width:767px){
 .is-record .cw-status-card{padding:12px;gap:10px;height:min(240px,50dvh)}
 #creation-top .is-record .cw-status-card>svg{width:32px;height:32px;flex-shrink:0}
 .is-record .cw-status-card strong{font-size:14px}
 .is-record .cw-status-card span{font-size:12px}
 .is-record .cw-status-card .cw-button{font-size:12px;padding:6px 10px}
 .is-record .cw-status-card progress{max-width:100%}
}

/* Record images size their frame to the actual artwork, including multi-result batches. */
.cw-record-images{--record-image-height:50dvh}
.cw-record-images>.cw-record-result.is-image,
.cw-record-images>.cw-record-result.is-image:only-child,
.cw-record-images:has(>.is-image:nth-child(2))>.is-image{
 width:min(calc((100% - 8px)/2),calc(var(--record-image-height) * var(--natural-aspect,1)));
 max-width:50%;flex:0 1 auto;background:transparent;
}
.cw-record-images:has(>.is-image:nth-child(3))>.is-image{
 width:min(100%,calc(var(--record-image-height) * var(--natural-aspect,1)));max-width:100%;
}
.cw-record-images>.is-image .cw-open{background:transparent}
.cw-record-images>.is-image .cw-open>img{max-height:var(--record-image-height);aspect-ratio:auto;object-fit:contain}
@media(max-width:767px){.cw-record-images{--record-image-height:calc(50dvh - 38px)}}
