/* Scoped final rules replace the old title-only category layout. */
.workspace #library-categories{gap:18px;align-items:stretch}
.workspace .learning-category-card[data-learning-profile]{padding:16px 18px 18px;border-radius:22px;background:linear-gradient(155deg,var(--surface) 60%,#edf8f2);overflow:visible}
.workspace .learning-category-card[data-learning-profile][data-category=news],.workspace .learning-category-card[data-learning-profile][data-category=vocabulary],.workspace .learning-category-card[data-learning-profile][data-category=patterns]{background:linear-gradient(155deg,var(--surface) 60%,#eef7fc)}
.workspace .learning-category-card[data-learning-profile].is-selected{background:var(--active,#edf8f2);outline:3px solid var(--pine);outline-offset:-3px}
.workspace [data-learning-profile] .category-tools{position:static;height:auto;display:flex;align-items:center;justify-content:space-between;margin:-6px -8px 2px;pointer-events:auto}
.workspace [data-learning-profile] .category-tools button{min-width:48px;min-height:48px;width:48px;height:48px;border-radius:12px;color:var(--pine);font-size:24px}
.workspace [data-learning-profile] .category-open{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:10px;padding:0 0 4px;min-height:336px;position:relative;border-radius:14px;text-align:center}
.workspace [data-learning-profile] .category-open h2{font-size:clamp(22px,1.7vw,27px);line-height:1.35;letter-spacing:-.5px;margin:0;min-height:2.7em;display:flex;align-items:center;justify-content:center;color:var(--ink);max-width:100%}
.workspace [data-learning-profile] .category-open .category-art-wrap{width:100%;height:152px;flex:none;align-self:center;margin:0}
.workspace [data-learning-profile] .category-art-wrap img{width:152px;height:152px;max-width:100%;object-fit:contain;transform:scale(1.06);filter:drop-shadow(0 5px 3px #1b666010)}
.workspace [data-learning-profile] .category-open p{display:block;margin:0;word-break:keep-all;overflow-wrap:anywhere;max-width:100%}
.workspace [data-learning-profile] .category-open .category-goal{font-size:16px;line-height:1.55;color:var(--ink);min-height:3.1em}
.workspace [data-learning-profile] .category-open .category-method{font-size:14px;line-height:1.6;color:var(--muted);min-height:3.2em}
.workspace [data-learning-profile] .category-open .category-counts{display:flex;align-self:center;justify-content:center;margin:0;padding-top:4px;font-size:14px}
.workspace [data-learning-profile] .category-availability{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:7px;padding:6px 12px;background:var(--soft);color:var(--pine);border-radius:12px;line-height:1.4}
.workspace [data-learning-profile] .category-availability strong{font-size:16px;font-variant-numeric:tabular-nums}
.workspace [data-learning-profile] .category-unavailable{color:var(--muted);font-size:13px}
.workspace [data-learning-profile] .category-open::after{right:-4px;bottom:4px}
.workspace [data-learning-profile] .category-open:focus-visible,.workspace [data-learning-profile] .category-tools button:focus-visible{outline:3px solid var(--pine);outline-offset:3px}
@media(min-width:761px) and (max-width:1050px){.workspace #library-categories{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){
 .workspace #library-categories{grid-template-columns:1fr;gap:12px}
 .workspace .learning-category-card[data-learning-profile]{display:grid;grid-template-columns:minmax(0,1fr) 48px;padding:14px;gap:6px;border-radius:18px}
 .workspace [data-learning-profile] .category-tools{grid-column:2;grid-row:1;flex-direction:column;justify-content:flex-start;margin:0;gap:6px}
 .workspace [data-learning-profile] .category-open{grid-column:1;grid-row:1;display:grid;grid-template-columns:82px minmax(0,1fr);grid-template-rows:auto auto auto auto;gap:6px 12px;min-height:164px;text-align:start;align-items:start;padding:0}
 .workspace [data-learning-profile] .category-open h2{grid-column:2;grid-row:1;display:block;font-size:21px;line-height:1.35;min-height:0;margin:0;text-align:start;align-self:start}
 .workspace [data-learning-profile] .category-open .category-art-wrap{grid-column:1;grid-row:1/5;align-self:center;width:82px;height:106px}
 .workspace [data-learning-profile] .category-art-wrap img{width:82px;height:106px;transform:scale(1.08)}
 .workspace [data-learning-profile] .category-open .category-goal{grid-column:2;grid-row:2;min-height:0;font-size:15px;line-height:1.5}
 .workspace [data-learning-profile] .category-open .category-method{grid-column:2;grid-row:3;min-height:0;font-size:14px;line-height:1.6}
 .workspace [data-learning-profile] .category-open .category-counts{grid-column:2;grid-row:4;align-self:end;justify-content:flex-start;padding-top:4px;font-size:14px}
 .workspace [data-learning-profile] .category-availability{justify-content:flex-start;padding:5px 8px;gap:6px}
 .workspace [data-learning-profile] .category-open::after{right:-48px;bottom:2px}
}
@media(max-width:370px){.workspace [data-learning-profile] .category-open{grid-template-columns:64px minmax(0,1fr);gap:6px 8px}.workspace [data-learning-profile] .category-open .category-art-wrap{width:64px;height:90px}.workspace [data-learning-profile] .category-art-wrap img{width:64px;height:90px}.workspace [data-learning-profile] .category-open h2{font-size:20px}}
html[data-theme=dark] .workspace .learning-category-card[data-learning-profile]{background:var(--surface)}
@media(prefers-reduced-motion:reduce){.workspace .learning-category-card[data-learning-profile]{transition:none}}
