.modal-backdrop:has(.spellbook) .modal { width:1080px; }
.spellbook { --book-gold:#e6cb92; --book-teal:#9bd3c5; --book-line:#46636b; --book-muted:#b1c5c7; }
.book-header,.book-header nav,.book-tab,.book-detail-heading,.book-assign,.book-overview,.book-overview-item { display:flex; align-items:center; }
.book-header { gap:12px; margin-bottom:16px; }
.book-signet { width:45px; height:45px; display:grid; place-items:center; border:1px solid #817557; border-radius:10px; background:linear-gradient(135deg,#364846,#162e38); }
.book-signet img { width:35px; height:35px; object-fit:contain; filter:brightness(2) sepia(.4); }
.book-header h3 { margin:3px 0 0; color:#f3e4c5; font:500 26px/1.15 Georgia,serif; }
.book-header small,.book-detail-heading small,.book-caption,.book-innate>span,.book-overview>div>small { color:var(--book-gold,#e6cb92); text-transform:uppercase; font:650 10px/1.3 system-ui,sans-serif; letter-spacing:1.2px; }
.book-header nav { gap:3px; padding:3px; margin-left:auto; border:1px solid var(--book-line); border-radius:8px; background:#10252e; }
.book-tab { gap:7px; padding:7px 11px; border:1px solid transparent; border-radius:5px; background:transparent; box-shadow:none; color:#bcd1cf; font-size:12px; }
.book-tab b { font:10px/1.5 system-ui,sans-serif; color:#a7c1bf; }
.book-tab[aria-pressed="true"] { border-color:#898464; background:#304747; color:#f2deb2; }
.book-caption { margin:6px 0; }
.book-slots { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px; margin-bottom:17px; }
.book-slot { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:3px 8px; min-width:0; min-height:60px; padding:8px; text-align:left; border:1px solid var(--book-line); border-radius:7px; background:linear-gradient(145deg,#263e46,#182d36); color:#e2e6d7; }
.book-slot kbd { grid-column:2; grid-row:1; justify-self:start; font:600 9px/1 system-ui,sans-serif; color:#e4cc94; background:transparent; padding:0; border:0; box-shadow:none; }
.book-slot .book-emblem { grid-column:1; grid-row:1/3; }
.book-slot strong { align-self:start; font:600 11px/1.2 system-ui,sans-serif; }
.book-slot.empty { border-style:dashed; background:#152a33; color:#a1b7b8; }
.book-slot.empty .book-emblem { color:#6f888a; font:22px/1 Georgia,serif; border-style:dashed; }
.book-slot[aria-pressed="true"],.book-choice[aria-pressed="true"] { border-color:#bda779; background:linear-gradient(115deg,#354c48,#20353e); }
.book-emblem { flex:0 0 auto; width:36px; height:36px; display:grid; place-items:center; overflow:hidden; border:1px solid #637675; border-radius:6px; background:#142a32; box-sizing:border-box; }
.book-emblem img { width:100%; height:100%; object-fit:contain; }
.book-body { display:grid; grid-template-columns:minmax(0,.98fr) minmax(0,1.02fr); gap:16px; align-items:start; }
.book-library h4 { display:flex; align-items:center; gap:8px; margin:0 0 9px; color:var(--book-gold); text-transform:uppercase; font:650 10px/1.5 system-ui,sans-serif; letter-spacing:1px; }
.book-library h4 small { padding:0 5px; border-radius:4px; background:#344b4d; color:#d4e1d8; letter-spacing:0; }
.book-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.book-choice { display:flex; align-items:center; gap:8px; min-width:0; min-height:54px; padding:7px; text-align:left; background:#1b333d; color:#e2e7df; border:1px solid #3e5861; border-radius:6px; box-shadow:none; }
.book-choice b,.book-choice small { display:block; }
.book-choice b { font:600 12px/1.2 system-ui,sans-serif; }
.book-choice small,.book-detail-heading span:not(.book-emblem) { margin-top:3px; color:var(--book-muted); font:10px/1.35 system-ui,sans-serif; }
.book-choice.locked .book-emblem { filter:saturate(.35); }
.book-choice.locked b { color:#b3c3c5; }
.book-detail { min-width:0; border:1px solid #66766b; border-top:2px solid #b39b68; padding:16px; border-radius:8px; background:linear-gradient(140deg,#294149,#192e37); }
.book-detail-heading { gap:10px; }
.book-detail-heading .book-emblem { width:48px; height:48px; border-color:#a39270; border-radius:8px; }
.book-detail-heading h4 { margin:2px 0; font:500 21px/1.12 Georgia,serif; text-transform:none; letter-spacing:0; color:#efdfb9; }
.book-metrics { display:flex; flex-wrap:wrap; gap:7px 15px; margin:14px 0 9px; }
.book-metrics dt { color:var(--book-muted); font-size:10px; }
.book-metrics dd { margin:1px 0 0; color:#e8e6d7; font:600 12px/1.45 system-ui,sans-serif; }
.book-effect,.book-subject,.book-mods { margin:10px 0; font:12px/1.5 system-ui,sans-serif; color:#d1dedb; }
.book-applied,.book-reason { margin:6px 0 0; font-size:11px; color:#cbbd98; }
.book-applied { color:#a9d7c1; }
.book-assign { justify-content:space-between; min-height:30px; gap:10px; padding-top:7px; border-top:1px solid #49636a; margin-top:12px; }
.book-assign strong { color:#c5d8d4; font:550 11px/1.4 system-ui,sans-serif; }
.book-remove { border:0; background:transparent; box-shadow:none; color:#dfbd9d; padding:3px 0 3px 7px; font-size:11px; }
.book-destinations { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; margin-top:5px; }
.book-destination { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; padding:6px 2px; border:1px solid #718079; border-radius:5px; background:#2a4449; min-width:0; color:#f0ddbb; }
.book-destination kbd { font:650 11px/1.2 system-ui,sans-serif; color:inherit; border:0; background:transparent; box-shadow:none; padding:0; }
.book-destination small { font:10px/1.1 system-ui,sans-serif; color:#bacfca; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.book-destination.equipped { opacity:1; color:#a4d7bd; border-color:#578472; }
.book-destination:not(:disabled):hover,.book-choice:hover,.book-slot:is(button):hover,.book-tab:hover { border-color:var(--book-teal); }
.spellbook button:focus-visible,.book-detail:focus-visible { outline:2px solid var(--book-gold); outline-offset:2px; }
.passive-slots,.passive-destinations { grid-template-columns:repeat(2,minmax(0,1fr)); }
.book-innate { display:flex; align-items:center; gap:14px; margin:0 0 12px; padding:10px 14px; background:#28413f; border:1px solid #53726b; border-radius:6px; }
.book-innate>span { flex:0 0 77px; color:#b6d6ba; }
.book-innate strong { color:#e2dfc5; font-family:Georgia,serif; }
.book-innate p { margin:3px 0 0; color:#c0d1c9; font-size:11px; }
.book-mods { padding-left:18px; }
.book-subject { font-weight:650; color:#e0ceac; }
.book-overview { justify-content:space-between; flex-wrap:wrap; gap:8px; margin:12px 0; padding:12px 16px; color:#c5d8d4; background:#1d343c; border:1px solid #48666c; border-radius:8px; }
.book-overview>div>div { display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; font-size:12px; }
.book-overview-item { gap:6px; }
.book-overview-item .book-emblem { width:26px; height:26px; }
@media(max-width:760px) {
 .book-header { flex-wrap:wrap; gap:8px; }
 .book-header nav { width:100%; margin:3px 0 0; }
 .book-tab { flex:1; justify-content:center; }
 .book-body { grid-template-columns:minmax(0,1fr); }
 .book-slot { grid-template-columns:minmax(0,1fr); justify-items:center; padding:6px 2px; gap:4px; text-align:center; }
 .book-slot kbd,.book-slot .book-emblem { grid-column:1; grid-row:auto; justify-self:center; }
 .book-slot strong { font-size:9px; }
 .book-slot .book-emblem { width:30px; height:30px; }
 .book-slots { gap:3px; }
 .book-choice { min-height:52px; padding:5px; gap:5px; }
 .book-choice .book-emblem { width:30px; height:30px; }
 .book-detail { padding:12px; }
 .book-innate { display:block; }
 .book-innate>span { display:block; margin-bottom:4px; }
 .passive-slots .book-slot { display:flex; justify-content:center; gap:6px; }
 .passive-slots .book-slot strong { align-self:center; }
}
