/* Layouts shares Styles' library shell, grid, card bar and pagination. */
 .layout-library .collection{padding-top:16px}
.layout-prompt-toolbar select,#layout-prompt-retry{min-height:36px;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:6px;padding:7px;font-size:14px;max-width:100%}
.layout-library .layout-open{display:block;width:100%;padding:0;cursor:zoom-in}
.layout-library .curtain-number{font-variant-numeric:tabular-nums}
.layout-categories{margin-bottom:16px}
@media(min-width:1280px){
 .layout-library .paired-catalog{grid-template-columns:repeat(6,minmax(0,1fr))}
 .layout-library .curtain-number{flex:0 0 auto;font-size:18px}
 .layout-library .curtain-prompt{flex:0 1 auto;min-width:0}
 .layout-library .row-prompt-action{max-width:100%;white-space:normal;text-align:center;font-size:14px;padding:7px}
 .layout-library .curtain-card-bar{gap:6px;padding-inline:8px}
 .layout-library .favorite-button{width:28px;height:40px}
}
.layout-state:is([data-state=loading],[data-state=error]){position:fixed;inset:var(--header-height) 0 0;z-index:25;min-height:0;background:var(--paper)}
.ls-composer-feedback:has([role=status][hidden]):has(a[hidden]){display:none}
#layout-detail{box-sizing:border-box;width:min(1060px,calc(100vw - 40px));max-height:calc(100dvh - 48px);padding:20px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);overflow:auto}
#layout-detail::backdrop{background:#000b}.layout-detail-header{display:flex;align-items:center;gap:16px;margin-bottom:16px}.layout-detail-header h2{font-size:16px;line-height:1.5;margin:0;flex:1}.layout-detail-header button,.layout-copy{display:grid;place-items:center;width:40px;height:40px;border:1px solid var(--line);border-radius:6px;background:var(--paper);color:var(--ink);flex:none;padding:9px}
.layout-detail-header svg,.layout-copy svg{width:20px;height:20px;stroke:currentColor;stroke-width:1.6;fill:none}
.layout-detail-body{--layout-panel-height:min(64dvh,610px);display:grid;grid-template-columns:fit-content(44%) minmax(0,1fr);gap:24px;align-items:stretch}
.layout-reference-panel{margin:0;min-width:0;width:fit-content;max-width:100%;justify-self:center;height:var(--layout-panel-height);display:grid;place-items:center;background:var(--paper-deep);border-radius:8px;overflow:hidden}
.layout-reference-frame{position:relative;max-width:100%;line-height:0}.layout-reference-frame img{display:block;width:auto;height:auto;max-width:100%;max-height:var(--layout-panel-height);object-fit:contain;border-radius:8px}
.layout-download{padding:0;cursor:pointer;position:absolute;right:8px;bottom:8px;display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--ink);box-shadow:0 2px 8px #0003}.layout-download:hover{background:var(--hover);border-color:var(--muted)}
.layout-prompt-panel{position:relative;min-width:0;height:var(--layout-panel-height)}.layout-prompt-toolbar{position:absolute;top:8px;right:8px;left:8px;display:flex;align-items:center;justify-content:flex-end;gap:6px;font-size:14px}.layout-prompt-toolbar select{max-width:calc(100% - 92px)}.layout-prompt-toolbar .favorite-button{width:40px;height:40px;flex:none}
.layout-prompt-box{position:relative;height:100%}.layout-prompt-box textarea{resize:none;display:block;box-sizing:border-box;width:100%;height:100%;border:1px solid var(--line);border-radius:8px;background:var(--paper-deep);color:var(--ink);padding:64px 16px 16px;font:13px/1.8 ui-monospace,Consolas,monospace}.layout-copy{border:0;background:var(--paper-deep)}
.layout-prompt-feedback{position:absolute;left:16px;right:16px;top:64px;pointer-events:none}.layout-prompt-feedback:has(p:empty):has(button[hidden]){display:none}.layout-prompt-feedback p:not(:empty),.layout-prompt-feedback button{pointer-events:auto;background:var(--paper-deep)}#layout-prompt-status{color:var(--muted);font-size:13px;line-height:1.5;margin:0}
@media(pointer:coarse){.layout-download{width:44px;height:44px}}
@media(max-width:760px){.layout-detail-body{grid-template-columns:1fr;--layout-panel-height:45dvh}.layout-prompt-panel{height:300px}#layout-detail{padding:16px;width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}}

.layout-download:disabled{cursor:wait;opacity:.6}
@media(max-width:600px){
 #layout-detail{width:100%;max-width:100%;height:100dvh;max-height:100dvh;margin:0;padding:12px;border:0;border-radius:0}
 .layout-detail-header{gap:8px;margin-bottom:12px}
 .layout-detail-header h2{font-size:15px;overflow-wrap:anywhere}
 .layout-detail-header button{width:44px;height:44px}
 .layout-detail-body{gap:16px;--layout-panel-height:44dvh}
 .layout-prompt-panel{height:42dvh;min-height:260px}
 .layout-prompt-box textarea{font-size:16px;line-height:1.7;padding-inline:12px}
 .layout-reference-panel{width:100%;max-width:none;height:auto;justify-self:stretch}
 .layout-reference-frame{width:100%;max-width:none}
 .layout-reference-frame img{width:100%;height:auto;max-width:100%;max-height:none}
}
