.spell-library-shell{padding:22px}.spell-library-filters{display:grid;grid-template-columns:minmax(220px,2fr) repeat(5,minmax(135px,1fr));gap:12px;align-items:end}.spell-library-filters .field{margin:0}.spell-library-filters input,.spell-library-filters select{width:100%}.spell-library-results{display:grid;gap:14px}.spell-library-cards{grid-template-columns:repeat(auto-fill,minmax(265px,1fr));align-items:start}.spell-library-card{border:1px solid #b9a373;background:#fffaf0;color:#382b30;min-width:0}.spell-library-card[open]{grid-column:1/-1}.spell-library-card>summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:92px minmax(0,1fr);gap:14px;padding:14px;min-height:150px}.spell-library-card>summary::-webkit-details-marker{display:none}.spell-library-card>summary:hover{background:#f4e8d3}.spell-library-art{width:92px;height:92px;display:grid;place-items:center;align-self:start;background:#292434;border:1px solid #745463;overflow:hidden}.spell-library-art img{width:100%;height:100%;object-fit:cover}.spell-school-mark{font:700 29px Georgia,serif;color:#ead6a5;letter-spacing:.04em}.spell-library-copy{display:flex;flex-direction:column;min-width:0;gap:6px}.spell-library-copy small{color:#8b6543;text-transform:uppercase;letter-spacing:.07em}.spell-library-copy strong{font:24px/1.1 Georgia,serif}.spell-library-copy>span{font-size:12px;line-height:1.5;color:#65595a;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.spell-library-copy em{font-style:normal;font-size:11px;color:#8b6543;margin-top:auto}.spell-library-badges{grid-column:1/-1;display:flex;gap:6px;align-items:center;min-height:22px}.spell-library-badges b{font:600 10px system-ui,sans-serif;text-transform:uppercase;letter-spacing:.06em;padding:4px 7px;background:#e5d2aa;color:#5d4130}.spell-library-badges i{font:normal 11px system-ui,sans-serif;color:#806052;margin-left:auto}.spell-library-detail{border-top:1px solid #cfbd97;padding:18px 20px 22px}.spell-facts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;background:#cfbd97;margin:0 0 18px}.spell-facts div{background:#f8efdd;padding:11px}.spell-facts dt{font:600 10px system-ui,sans-serif;text-transform:uppercase;letter-spacing:.08em;color:#8b6543}.spell-facts dd{margin:5px 0 0;font-size:13px}.spell-full-text{max-width:900px;font:14px/1.7 Georgia,serif;white-space:pre-wrap}.spell-source{font-size:12px;margin-top:18px}.spell-source a{color:#8b3c40;text-decoration:underline}.spell-library-list{gap:0}.spell-library-list .spell-library-card{border-width:0 0 1px;background:transparent}.spell-library-list .spell-library-card>summary{grid-template-columns:68px minmax(0,1fr) auto;min-height:92px;padding:10px 8px}.spell-library-list .spell-library-art{width:68px;height:68px}.spell-library-list .spell-library-copy>span{display:none}.spell-library-list .spell-library-copy strong{font-size:20px}.spell-library-list .spell-library-badges{grid-column:auto;align-self:center}.spell-library-note{margin-top:18px}.spell-school-abjuration{background:#253d55}.spell-school-conjuration{background:#4a343e}.spell-school-divination{background:#394556}.spell-school-enchantment{background:#51344f}.spell-school-evocation{background:#57352d}.spell-school-illusion{background:#34304d}.spell-school-necromancy{background:#2e493f}.spell-school-transmutation{background:#54482c}
@media(max-width:1250px){.spell-library-filters{grid-template-columns:repeat(3,minmax(0,1fr))}.spell-library-filters .field:first-child{grid-column:span 2}}@media(max-width:700px){.spell-library-shell{padding:14px}.spell-library-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.spell-library-filters .field:first-child{grid-column:1/-1}.spell-library-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.spell-library-card>summary{grid-template-columns:68px minmax(0,1fr);padding:10px;gap:9px}.spell-library-art{width:68px;height:68px}.spell-library-copy strong{font-size:19px}.spell-library-copy>span{grid-column:1/-1}.spell-facts{grid-template-columns:repeat(2,minmax(0,1fr))}.spell-library-list .spell-library-badges{display:none}}@media(max-width:460px){.spell-library-cards{grid-template-columns:1fr}.spell-library-filters{grid-template-columns:1fr}.spell-library-filters .field:first-child{grid-column:auto}.spell-library-card>summary{min-height:0}}

/* Two short rules sentences fit most 5e cards; expanded details remain free to grow. */
.spell-library-cards{grid-template-columns:repeat(auto-fill,minmax(min(100%,390px),1fr))}
.spell-library-cards .spell-library-card:not([open])>summary{height:240px;min-height:0;box-sizing:border-box;grid-template-rows:minmax(0,1fr) auto;overflow:hidden}
.spell-library-cards .spell-library-card:not([open]) .spell-library-copy{min-height:0;overflow:hidden}
.spell-library-cards .spell-library-card:not([open]) .spell-library-copy em{margin-top:0}
.spell-library-cards .spell-library-card:not([open]) .spell-library-copy small,.spell-library-cards .spell-library-card:not([open]) .spell-library-copy em{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.spell-library-cards .spell-library-card:not([open]) .spell-library-copy strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.spell-library-cards .spell-library-card:not([open]) .spell-library-copy>span{-webkit-line-clamp:5}
.spell-library-cards.spell-library-adnd .spell-library-card:not([open])>summary{height:165px}
@media(max-width:700px){.spell-library-cards{grid-template-columns:1fr}}

.spell-library-filters{grid-template-columns:minmax(220px,2fr) repeat(3,minmax(135px,1fr))}
.spell-library-advanced{grid-column:1/-1;min-width:0}
.spell-library-advanced>summary{display:none}
.spell-library-advanced-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
@media(max-width:1250px){.spell-library-filters{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){
 .spell-library-filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .spell-library-filters>.field:first-child,.spell-library-filters>.field:has(#spell-library-edition){grid-column:1/-1}
 .spell-library-filters>.field{min-width:0}
 .spell-library-advanced>summary{display:list-item;cursor:pointer;font-size:12px;padding:8px 0;color:var(--ink)}
 .spell-library-advanced-fields{grid-template-columns:repeat(2,minmax(0,1fr));padding-top:10px;gap:10px}
 .spell-library-advanced-fields>.field:last-child{grid-column:1/-1}
}
