/* Library collections: keep one primary action color, reserve rose for saved state. */
:root{--favorite:#b8375b;--favorite-border:#d5728e;--favorite-surface:#fff0f4}
.library-controls{border-top:0;padding-top:0}.collection-bar{display:flex;gap:28px;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.collection-switch{border-bottom:0;gap:25px;flex-shrink:0}.collection-switch button{white-space:nowrap;font-size:15px;gap:7px;padding:15px 0 18px;border-bottom-width:3px}.collection-switch button span:not([data-icon]):not(:empty){font-size:12px;min-width:20px;padding:0 5px;border-radius:6px;background:#e9e9e0;text-align:center}.library-search{display:flex;align-items:center;gap:8px;width:290px;max-width:100%;height:45px;border:1px solid var(--line);border-radius:11px;padding:0 12px;background:#fffdf9;color:var(--muted)}.library-controls .library-search input{border:0;min-height:40px;height:40px;width:100%;padding:5px 0;background:transparent;font-size:14px}.library-search .icon{width:18px;height:18px}.library-filter-row{display:flex;align-items:end;justify-content:space-between;gap:24px;margin:24px 0 9px}.library-filter-row fieldset{border:0;padding:0;margin:0;min-width:0}.library-filter-row legend{font-size:14px;font-weight:600;margin-bottom:10px}.library-filter-row legend>span{font-size:12px;font-weight:400;color:var(--muted);margin-left:7px}.age-chips{display:flex;gap:7px;flex-wrap:wrap}.age-chips>button,.age-chip>span{display:flex;align-items:center;justify-content:center;min-height:44px;padding:9px 14px;border:1px solid #c9cdbf;border-radius:10px;background:transparent;color:var(--ink);font-size:14px;white-space:nowrap}.age-chip{position:relative;cursor:pointer}.library-controls .age-chip input{position:absolute;opacity:0;width:1px;height:1px;min-height:0;padding:0}.age-check{display:none!important}.age-chip input:checked+span,.age-chips>button[aria-pressed=true]{background:#e5ecdf;border-color:#91a68b;color:#294e42;font-weight:600}.age-chip input:checked+span .age-check{display:grid!important;place-items:center;position:absolute;top:-5px;right:-4px;background:#294e42;color:white;width:17px;height:17px;border:2px solid var(--paper);border-radius:50%}.age-check .icon{width:11px;height:11px}.age-chip input:focus-visible+span{outline:3px solid #674b70;outline-offset:4px}.kind-chips{display:flex;gap:3px;padding:3px;border-radius:11px;background:#ebece3}.kind-chips button{background:none;border:0;border-radius:8px;padding:8px 13px;min-height:38px;color:var(--muted);display:flex;align-items:center;justify-content:center;gap:7px;font-size:13px;white-space:nowrap}.kind-chips [aria-pressed=true]{background:#fffdf9;color:var(--ink);box-shadow:0 1px 4px #343b3410}.kind-chips .icon{width:17px;height:17px}.results-toolbar{margin-bottom:15px}.results-toolbar .result-line{font-size:13px}
.clickable-card{position:relative;transition:border-color .2s,box-shadow .2s,transform .2s;border-radius:20px;animation:none}.clickable-card:hover{border-color:#a9b6a0;box-shadow:0 7px 24px #3445380b;transform:translateY(-2px)}.clickable-card:active{transform:translateY(0)}.clickable-card .material-cover{height:225px;padding:40px 25px 0;position:relative;display:grid;place-items:center}.clickable-card .material-cover>img{position:static;inset:auto;height:190px;max-height:210px;width:auto;max-width:80%;transform:rotate(-5deg) translateY(12px);transform-origin:bottom}.clickable-card .material-cover>img.explorer-cover{width:180px;height:180px;object-fit:contain;transform:none;filter:none;align-self:center;margin-bottom:12px}.material-type{display:inline-flex;align-items:center;gap:6px;background:#fffdf9ed;color:#674b70;padding:6px 10px;border-radius:8px;font-size:12px;font-weight:600;line-height:1.4}.material-type.is-activity{color:#486348}.material-type .icon{width:15px;height:15px}.material-cover>.material-type{position:absolute;top:15px;left:15px;pointer-events:none}.clickable-card .heart-button{position:absolute;right:13px;top:13px;z-index:2;width:42px;height:42px;background:#fffdf9ed;color:#777c6e;border-color:#e6e3d8}.heart-button[aria-pressed=true],#detail-favorite[aria-pressed=true]{background:var(--favorite-surface);border-color:var(--favorite-border);color:var(--favorite)}.heart-button[aria-pressed=true] .icon,#detail-favorite[aria-pressed=true] .icon{fill:currentColor}.clickable-card .material-body{padding:22px}.material-body .material-meta{font-size:12px;letter-spacing:0;color:var(--muted);font-weight:400}.material-body h2{margin:12px 0}.card-open{display:flex;align-items:flex-start;gap:12px;width:100%;padding:0;border:0;background:none;font:inherit;letter-spacing:inherit;line-height:inherit;color:inherit;text-align:left}.card-open::after{content:'';position:absolute;inset:0;border-radius:20px;cursor:pointer}.card-open>.icon{width:18px;height:18px;flex:0 0 18px;margin-top:6px;color:#73816e;transition:transform .18s}.card-open:focus-visible{outline:0}.card-open:focus-visible::after{outline:3px solid #674b70;outline-offset:-4px}.clickable-card:hover .card-open>.icon{transform:translateX(3px)}.clickable-card .material-body p{margin:0;font-size:16px;line-height:1.55}.downloaded-mark{display:flex;align-items:center;gap:5px;color:#527447;font-size:12px;margin-top:15px}.downloaded-mark .icon{width:15px;height:15px}.library-dialog .detail-type{margin-top:10px;background:#eee7f2}.library-dialog .detail-type.is-activity{background:#e7eddf}.library-dialog #detail-downloaded{clear:both}.library-dialog #detail-favorite{border-radius:12px}.library-dialog #download{border-radius:12px}.library-dialog #detail-downloaded .downloaded-mark{font-size:13px}.material-cover .word-art{font-size:30px}.material-cover .word-art .icon{width:44px;height:44px}.library-dialog .safety-note{font-size:14px!important}.library-empty>.icon{width:30px;height:30px}
@media(max-width:1020px){.library-filter-row{flex-wrap:wrap;gap:20px}.library-search{width:260px}.collection-switch{gap:20px}.collection-switch button{font-size:14px}}
@media(max-width:700px){.library-controls{margin-top:25px}.collection-bar{flex-direction:column-reverse;align-items:stretch;gap:12px}.library-search{width:100%;height:46px}.library-controls .library-search input{font-size:16px}.collection-switch{justify-content:space-between;gap:6px}.collection-switch button{font-size:14px;gap:5px;padding:12px 0 15px}.collection-switch .icon{width:18px;height:18px}.collection-switch button span:not([data-icon]):not(:empty){font-size:11px;min-width:17px;padding:0 3px}.library-filter-row{gap:18px;margin-top:22px}.library-filter-row fieldset{width:100%}.library-filter-row legend{font-size:13px}.library-filter-row legend>span{font-size:11px}.age-chips{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}.age-chips>button,.age-chip>span{font-size:12px;padding:8px 4px;min-height:44px}.kind-chips button{flex:1;font-size:13px;min-height:39px}.results-toolbar .result-line{font-size:12px}.results-toolbar{gap:12px}.results-toolbar .reset-link{font-size:12px}.clickable-card .material-cover{height:215px}.clickable-card .material-cover>img{max-height:200px}.clickable-card .material-body{padding:21px}.material-body h2{font-size:27px}.clickable-card .material-body p{font-size:16px}.material-body .material-meta{font-size:12px}.clickable-card .heart-button{width:44px;height:44px}.material-type{font-size:12px}.downloaded-mark{font-size:13px}.library-dialog #detail-favorite,.library-dialog #download{font-size:16px}}
@media(prefers-reduced-motion:reduce){.clickable-card,.card-open>.icon{transition:none;animation:none}.clickable-card:hover,.clickable-card:hover .card-open>.icon{transform:none}}

/* Collection mode and print choices share the age selection indicator. */
.print-options{border:0;padding:0;margin:21px 0 16px}
.print-options legend{font-size:14px;font-weight:600;margin-bottom:10px}
.print-chips{display:flex;flex-wrap:wrap;gap:8px}
.print-chip>span,.collection-mode-chip>span{gap:7px;font-family:'DM Sans',Arial,sans-serif;font-weight:400}

.print-chip input:checked+span .age-check,.collection-mode-chip input:checked+span .age-check{z-index:1}
.collection-mode-chip>span{min-width:116px}
#library-sentinel{height:1px}#library-loading-more{text-align:center;padding:24px;color:#676e60;font-size:14px}.load-more:has(button[hidden]){margin:0}
@media(max-width:700px){.age-chips{grid-template-columns:repeat(3,minmax(0,1fr))}.print-chips{display:grid;grid-template-columns:1.5fr 1.2fr .8fr;gap:6px}.print-chip>span{justify-content:center;min-width:0;font-size:13px;padding:8px 6px;gap:5px;white-space:normal;height:100%}.print-options legend{font-size:13px}.topics-row{gap:16px}.collection-mode-chip>span{font-size:14px;padding-inline:14px}}

/* Compact catalogue: reveal occasional controls without hiding the results context. */
body[data-explore=library] .explore-main{padding-top:25px}
body[data-explore=library] .page-intro{margin-bottom:20px;max-width:none}
body[data-explore=library] .page-intro h1{font-size:38px;margin:5px 0 0}
body[data-explore=library] .page-intro .eyebrow{font-size:11px}
body[data-explore=library] .sample-note{margin:8px 0 0;font-size:13px}
.library-toolbar{display:flex;align-items:center;gap:10px}
.library-toolbar .library-search{flex:1;width:auto;height:44px}
.filters-toggle,.library-sort select{min-height:44px;border:1px solid var(--line);background:#fffdf9;border-radius:11px;color:var(--ink);font-size:14px}
.filters-toggle{display:flex;align-items:center;justify-content:center;gap:7px;padding:8px 13px}
.filters-toggle .icon{width:16px;height:16px}
.filters-toggle[aria-expanded=true]{border-color:#91a68b;background:#e5ecdf}
.filters-toggle[aria-expanded=true] .icon{transform:rotate(180deg)}
#filter-count:not(:empty){background:var(--green);color:white;border-radius:10px;min-width:19px;font-size:11px;line-height:19px}
.library-sort{min-width:0}
.library-sort select{width:100%;padding:8px 30px 8px 12px;max-width:210px}
.library-toolbar+.collection-bar{margin-top:5px;justify-content:flex-start}
.filter-panel{margin-top:16px;border:1px solid var(--line);border-radius:14px;padding:18px;background:#fcfaf5}
.filter-panel .library-filter-row{margin:0 0 14px}
.filter-panel .print-options{margin-top:14px}
.filter-panel-footer{display:flex;justify-content:flex-end;margin-top:16px}
.filter-panel-footer .button{min-height:44px;padding:10px 18px;border-radius:10px;font-size:14px}
body[data-explore=library] .results-toolbar{margin:12px 0}
body[data-explore=library] .results-toolbar .result-line{margin:0;min-height:0}
@media(max-width:700px){
 body[data-explore=library] .explore-main{padding-top:20px}
 body[data-explore=library] .page-intro{margin-bottom:16px}
 body[data-explore=library] .page-intro h1{font-size:30px}
 body[data-explore=library] .library-controls{margin-top:0}
 .library-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:8px}
 .library-toolbar .library-search{grid-column:1/-1;width:100%}
 .library-toolbar .filters-toggle{justify-content:center}
 .library-sort select{max-width:none;font-size:14px}
 .library-toolbar+.collection-bar{display:block;margin-top:6px}
 .library-controls .collection-switch button{padding:10px 0;font-size:13px}
 .filter-panel{padding:14px;margin-top:12px}
 .filter-panel .library-filter-row{gap:16px}
 .filter-panel .topics-row{margin-bottom:0}
 .filter-panel-footer .button{width:100%}
}
