/* URL-only library covers: the local library stores metadata, never image bytes. */
.library-cover{overflow:hidden;background:var(--soft);border-radius:10px;min-width:0;max-width:100%;width:100%;height:100%}
.library-cover img{display:block;width:100%;height:100%}
.deck-emoji{font-family:"Segoe UI Emoji","Apple Color Emoji",sans-serif;font-size:24px;line-height:1}
.deck-grid .has-library-cover .deck-top{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);align-items:center;isolation:auto;background:var(--soft);gap:0}
.has-library-cover .deck-top>.library-cover,.has-library-cover .deck-top>.deck-icon{grid-area:1/1}
.has-library-cover .deck-top>.deck-icon{z-index:1;align-self:end;justify-self:end;background:var(--panel);box-shadow:0 2px 8px #0002;width:26px;height:26px;border-radius:8px;transform:translate(5px,5px)}
.has-library-cover .deck-top>.deck-icon .icon{width:16px;height:16px}
.has-library-cover .deck-top>.deck-emoji{font-size:17px}
.has-library-cover .deck-cover-wordmark{display:none}
.library-view-compact .library-cover{width:42px;height:48px}
.library-view-compact .library-cover .remote-image-fallback small,.library-view-intermediate .library-cover .remote-image-fallback small{display:none}
.library-view-intermediate .has-library-cover{grid-template-columns:100px minmax(0,1fr)}
.library-view-intermediate .has-library-cover .deck-top{width:100px;height:100px}
.library-view-intermediate .has-library-cover .deck-top>.deck-icon{width:32px;height:32px;font-size:21px}
.library-view-visual .has-library-cover .deck-top{padding:0;min-height:170px;height:170px}
.library-view-visual .library-cover{border-radius:11px}
.library-view-visual .has-library-cover .deck-top>.deck-icon{align-self:end;justify-self:start;transform:none;margin:0 0 14px 16px;width:40px;height:40px;border-radius:12px;font-size:25px}
.library-view-visual .has-library-cover .deck-top>.deck-icon .icon{width:22px;height:22px}
.dialog-library-appearance{width:min(860px,calc(100vw - 32px));max-width:860px}
.library-appearance-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(180px,1fr);gap:24px;align-items:start}
.library-appearance-layout .field{margin-top:14px}
.library-appearance-layout .field:first-child{margin-top:0}
.library-location-controls{display:flex;gap:10px;align-items:end;margin-bottom:12px}
.library-location-controls .field{flex:1;min-width:0;margin:0}
.library-location-controls select{width:100%;min-width:0;text-overflow:ellipsis}
.library-location-controls .btn{white-space:nowrap}
.library-new-folder-fields{padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--soft)}
.library-new-folder-fields[hidden]{display:none}
.library-appearance-preview strong{min-width:0;overflow-wrap:anywhere}
.library-appearance-hint{color:var(--muted);font-size:12px;line-height:1.6;margin:8px 0 16px}
.library-cover-controls{display:flex;gap:10px;align-items:end;margin:15px 0 20px}
.library-cover-controls .field{flex:1;min-width:0;margin:0}
.library-cover-controls .btn{white-space:nowrap;margin-bottom:0}
.library-icon-fieldset{border:0;padding:0;margin:18px 0}
.library-icon-fieldset legend{font-size:13px;font-weight:650;margin-bottom:10px}
.library-icon-choices{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.library-icon-choice{position:relative;cursor:pointer;min-width:0}
.library-icon-choice input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer}
.library-icon-choice>span{display:flex;flex-direction:column;gap:6px;align-items:center;text-align:center;padding:10px 3px;border:1px solid var(--line);border-radius:12px;background:var(--panel);min-height:79px}
.library-icon-choice small{font-size:10px;line-height:1.3;overflow-wrap:anywhere}
.library-icon-choice input:checked+span{border-color:var(--orange);color:var(--orange);background:var(--soft)}
.library-icon-choice input:focus-visible+span{outline:2px solid var(--orange);outline-offset:2px}
.library-emoji-suggestions{display:flex;gap:6px;flex-wrap:wrap}
.library-emoji-suggestions .btn{font-size:22px;min-width:40px;padding:7px}
.library-appearance-preview{padding:18px;border:1px solid var(--line);border-radius:18px;background:var(--soft);position:sticky;top:12px;min-width:0}
#library-cover-preview{margin:16px 0;min-height:160px}
#library-cover-preview .remote-image{width:100%;height:180px;border-radius:12px;overflow:hidden}
#folder-cover-preview{margin:16px 0}
#folder-cover-preview .remote-image{width:100%;height:160px;border-radius:12px;overflow:hidden}
#folder-form .library-appearance-identity .deck-icon{flex-shrink:0;background:var(--panel)}
#folder-form .library-appearance-identity .deck-title{margin:0;font-size:18px}
.library-appearance-identity{display:flex;gap:12px;align-items:center;overflow-wrap:anywhere}
.folder-empty-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}
.dialog-collect-decks{width:min(680px,calc(100vw - 32px));max-width:680px}
.dialog-collect-decks .dialog-intro{overflow-wrap:anywhere}
.collect-decks-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;margin:12px 0;color:var(--muted);font-size:13px}
.collect-decks-toolbar>div{display:flex;gap:4px;flex-wrap:wrap}
.collect-decks-list{display:grid;gap:8px;border:0;margin:0;padding:0;max-height:350px;overflow:auto;overscroll-behavior:contain}
.collect-deck-row{display:flex;align-items:center;gap:12px;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--panel);cursor:pointer;min-width:0}
.collect-deck-row[hidden]{display:none}
.collect-deck-row:has(input:checked){border-color:var(--orange);background:var(--soft)}
.collect-deck-row input{flex:0 0 18px;width:18px;height:18px;accent-color:var(--orange)}
.collect-deck-symbol{display:flex;flex:0 0 30px;justify-content:center;font-size:24px;color:var(--orange)}
.collect-deck-copy{display:grid;gap:4px;min-width:0;overflow-wrap:anywhere}
.collect-deck-copy strong{font-size:14px}.collect-deck-copy small{font-size:12px;color:var(--muted)}
.dialog-collect-decks .field input{width:100%;min-width:0}
@media(max-width:500px){.dialog-collect-decks .form-footer{flex-wrap:wrap}.dialog-collect-decks .form-footer .btn{width:100%}.collect-deck-row{padding:10px;gap:8px}.collect-decks-toolbar .btn{padding-inline:8px}}
#library-icon-preview{flex-shrink:0;background:var(--panel);font-size:24px}
@media(max-width:650px){.library-appearance-layout{grid-template-columns:1fr}.library-appearance-preview{position:static}.library-icon-choices{grid-template-columns:repeat(3,minmax(0,1fr))}.library-icon-choice>span{min-height:76px}.library-cover-controls{flex-wrap:wrap}.library-cover-controls .field{flex-basis:55%}.library-view-intermediate .has-library-cover{grid-template-columns:80px minmax(0,1fr)}.library-view-intermediate .has-library-cover .deck-top{width:80px}}
@media(max-width:500px){.library-location-controls{flex-wrap:wrap}.library-location-controls .field{flex-basis:100%}.library-location-controls .btn{width:100%}.library-appearance-layout input,.library-new-folder-fields select{min-width:0;width:100%}}
