.creation-library-dialog{width:min(940px,94vw);max-height:90dvh;padding:24px;border:1px solid var(--line);border-radius:18px;background:var(--paper,var(--bg));color:var(--ink);overflow:auto;box-sizing:border-box}
.creation-library-dialog::backdrop{background:#0009;backdrop-filter:blur(5px)}
.creation-library-dialog.cl-reference-picker[open]{display:flex;flex-direction:column;max-height:90dvh;overflow:hidden;padding-bottom:max(16px,env(safe-area-inset-bottom))}
.cl-reference-picker>.cl-dialog-head,.cl-reference-picker>input,.cl-reference-picker>.cl-muted,.cl-reference-picker>.cl-reference-pagination,.cl-reference-picker>.cl-reference-footer{flex:0 0 auto}
.cl-reference-pagination{display:flex;align-items:center;justify-content:center;gap:14px;padding:6px 0 12px;font-size:13px}.cl-reference-pagination[hidden]{display:none}.cl-reference-pagination button{width:auto;margin:0}
.cl-reference-picker .cl-work-grid{grid-auto-rows:max-content;grid-template-columns:repeat(auto-fill,minmax(min(180px,100%),1fr))}
.cl-reference-picker .cl-work-card{flex-shrink:0;align-self:start}.cl-reference-picker .cl-work-preview{flex:0 0 auto;height:auto;min-height:0;max-height:none}
.cl-reference-picker .cl-work-preview img,.cl-reference-picker .cl-cover-fallback{display:block;height:auto;aspect-ratio:16/9;object-fit:cover;flex:none}.cl-reference-picker .cl-cover-fallback{display:grid}
.cl-reference-picker .cl-card-text strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal;overflow-wrap:anywhere}.cl-reference-picker .cl-select{margin:0;min-height:36px}
.cl-reference-picker>.cl-dialog-head{position:relative;top:0}
.cl-reference-picker>.cl-reference-list{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;align-content:start;margin:12px 0;padding-bottom:4px}
.cl-reference-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;border-top:1px solid var(--line);padding-top:12px;background:var(--paper,var(--bg))}
.cl-reference-footer>button{width:auto;margin:0;flex:0 0 auto}.cl-reference-count{font-size:13px;color:var(--muted)}
.creation-relation-actions>button[hidden]{display:none}
.cl-dialog-head,.cl-card-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.cl-dialog-head{position:sticky;top:-24px;z-index:2;margin:-24px -24px 16px;padding:16px 24px;background:var(--paper,var(--bg));border-bottom:1px solid var(--line);flex-wrap:nowrap}.cl-dialog-head h2{margin:0;font-size:20px;min-width:0;overflow-wrap:anywhere}.cl-dialog-head .cl-dialog-close{flex:0 0 32px;width:32px;height:32px;min-height:32px;margin:0;padding:0;font-size:22px;line-height:1}
.cl-options,.creation-relation-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:14px 0}
.creation-relation-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:end;gap:12px 16px;max-width:840px}
.creation-relation-options>label{max-width:100%;width:100%;margin:0}
.creation-relation-options label input,.creation-relation-options label select{height:38px;min-height:38px;margin:0;padding:8px 12px;font-size:12px;line-height:20px}
#creation-relations{padding:16px 20px}
#creation-relations>.creation-relation-title{display:list-item;cursor:pointer;font-size:14px;color:var(--ink)}
.creation-relation-title>.creation-relation-status{margin-left:14px;font-weight:400;overflow-wrap:anywhere}
.creation-relation-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.creation-relation-actions>button{width:auto;margin:0}
#creation-relations>.creation-relation-status:empty{display:none}
@media(max-width:600px){.creation-relation-title>.creation-relation-status{display:block;margin:6px 0 0}}
.cl-options label,.creation-relation-options label{display:flex;flex-direction:column;gap:7px;min-width:0;font-size:13px;color:var(--muted)}
.cl-options input,.cl-options select,.creation-relation-options input,.creation-relation-options select{width:100%;box-sizing:border-box;min-width:0}
.cl-options [hidden],.creation-relation-options [hidden],[hidden].cl-work-grid{display:none}
.cl-work-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(210px,100%),1fr));gap:12px;margin:14px 0}
.cl-work-card{border:1px solid var(--line);border-radius:12px;overflow:hidden;min-width:0;background:var(--soft,var(--bg))}.cl-work-preview{display:flex;flex-direction:column;width:100%;padding:0;border:0;border-radius:0;text-align:left;background:transparent;color:inherit;overflow:hidden}
.cl-work-preview img{width:100%;height:110px;object-fit:cover}.cl-cover-fallback{display:grid;place-items:center;width:100%;height:110px;background:linear-gradient(135deg,#3679db29,#9268ce26);font-size:12px;color:var(--muted)}
.cl-series-work-grid{--episode-row-height:320px;--episode-cover-height:220px;grid-auto-rows:var(--episode-row-height);max-height:min(calc(var(--episode-row-height) * 2 + 12px),calc(90dvh - 120px));overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.cl-series-work-grid .cl-work-preview{text-decoration:none}.cl-series-work-grid .cl-work-preview img,.cl-series-work-grid .cl-cover-fallback{height:var(--episode-cover-height)}.cl-series-work-grid .cl-card-text strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;white-space:normal;overflow-wrap:anywhere}
@media(max-width:600px){.cl-series-work-grid{--episode-row-height:220px;--episode-cover-height:120px;max-height:min(calc(var(--episode-row-height) * 2 + 8px),calc(90dvh - 120px))}}
.cl-card-text{display:flex;flex-direction:column;gap:6px;padding:12px;max-width:100%;box-sizing:border-box}.cl-card-text strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}.cl-card-text small,.cl-muted{color:var(--muted);font-size:12px;line-height:1.65}
.cl-work-card{display:flex;flex-direction:column}.cl-work-card .cl-work-preview{flex:1;justify-content:flex-start;gap:0;min-height:0}.cl-work-preview>img,.cl-work-preview>.cl-cover-fallback{flex-shrink:0}.cl-work-card .cl-card-actions{padding:0 10px 10px;justify-content:flex-end;gap:6px;flex-wrap:nowrap;margin-top:auto}.cl-work-card .cl-card-actions button{width:auto;min-width:0;min-height:28px;height:28px;margin:0;padding:3px 8px;font-size:12px;line-height:20px;white-space:nowrap}.cl-select{display:flex!important;align-items:center;gap:8px;padding:0 12px 12px}.cl-select input{width:auto!important}
.cl-series-footer{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;border-top:1px solid var(--line);padding-top:14px;margin-top:14px}.cl-series-footer>button{width:auto;margin:0}.cl-series-status:empty{display:none}
@media(pointer:coarse){.cl-work-card .cl-card-actions button{min-height:44px;height:auto;padding:7px 8px}}
.cl-shot{margin:14px 0;padding:14px;border:1px solid var(--line);border-radius:12px}.cl-shot h3{margin:0 0 12px;font-size:15px}.cl-shot img{max-width:100%;max-height:340px;border-radius:8px;object-fit:contain;margin:0 8px 8px 0}.cl-readable{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.85}.creation-library-dialog details{margin:10px 0}.creation-library-dialog summary{cursor:pointer;font-size:13px}
.cl-shot .sbv-picture img{margin:0;width:100%;height:auto}.cl-shot .sbv-timeline h4{margin:0 0 8px}.cl-shot .sbv-timeline>.cl-readable{height:180px;max-height:180px;line-height:calc(180px / 7);overflow:hidden;display:block;-webkit-line-clamp:unset}
.cl-episode-list{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.cl-episode-list button[aria-current=true]{border-color:var(--blue);color:var(--accent,var(--blue))}.series-navigation{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 0;margin-bottom:12px;border-bottom:1px solid var(--line)}
.cl-series-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.cl-series-tools select{flex:1 1 220px;width:auto;min-width:0;max-width:100%;margin:0}.cl-series-tools button{width:auto;margin:0;white-space:nowrap}.creation-library-dialog .cl-series-directory{padding:10px 12px}.cl-series-directory .cl-episode-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));max-height:240px;overflow:auto;overscroll-behavior:contain}.cl-episode-list button{min-width:0;margin:0;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:600px){.cl-dialog-head{top:-16px;margin:-16px -16px 12px;padding:12px 16px}.cl-series-directory .cl-episode-list{grid-template-columns:1fr}.cl-series-tools select{flex-basis:100%}}
.series-library-card .work-poster{width:100%;border:0;text-align:left}.creation-relation-title{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.creation-relation-title h3{margin:0;font-size:15px}.creation-relation-status{font-size:12px;color:var(--muted)}
@media(max-width:600px){.creation-library-dialog{padding:16px}.cl-options,.creation-relation-options{grid-template-columns:1fr}.cl-work-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.cl-card-text{padding:9px}.cl-card-text strong{font-size:12px}.cl-cover-fallback,.cl-work-preview img{height:80px}.cl-work-card .cl-card-actions{padding:0 6px 8px;gap:4px}.cl-work-card .cl-card-actions button{padding-left:5px;padding-right:5px}}
.curated-episode-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); gap: 6px; max-height: 180px; overflow-y: auto; margin: 10px 0; }
.curated-episode-choices label { display: flex; align-items: center; gap: 6px; padding: 5px 8px; }
.curated-episode-choices input[type="checkbox"] { width: 14px; height: 14px; margin: 0; flex: 0 0 auto; }
