:root{color-scheme:light;--bg:#f3f6fb;--surface:#fff;--soft:#e8eff8;--text:#263b51;--muted:#62768c;--link:#295e9b;--line:#ccd9e9;--active:#244f87;--header:#172d47}*{box-sizing:border-box}html[data-theme=dark]{color-scheme:dark;--bg:#0e1720;--surface:#1b2837;--soft:#24374e;--text:#d7e4f1;--muted:#a0b2c6;--link:#91c1ff;--line:#344a62;--active:#315e91;--header:#102031}body{margin:0;background:var(--bg);color:var(--text);font:16px/1.65 system-ui,sans-serif}a{color:var(--link)}button,select,input{font:inherit}button,select{color:var(--text);background:var(--surface);border:1px solid var(--line);border-radius:7px;cursor:pointer}button{padding:8px 14px;transition:background .15s,border-color .15s}button:hover:not(:disabled),.card:hover{background:var(--soft);border-color:var(--link)}button:disabled{opacity:.4;cursor:default}button[aria-pressed=true],button[aria-selected=true]{background:var(--active);color:#fff;border-color:var(--active)}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid var(--link);outline-offset:3px}button,summary{touch-action:manipulation}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}#site-header{background:var(--header);color:#fff;display:flex;align-items:center;gap:16px;padding:10px 16px;position:relative;z-index:30}.logo{display:flex;align-items:center;gap:10px;font-size:20px;font-weight:650;color:#fff;text-decoration:none;white-space:nowrap}.logo img{flex:none}.search-wrap{position:relative;width:min(650px,50vw)}#search{width:100%;min-height:42px;border:1px solid #69839e;border-radius:5px;padding:7px 12px;background:var(--surface);color:var(--text)}.rules-choice{margin-left:auto}#ruleset{min-height:42px;padding:4px 8px}#theme{height:42px;min-width:42px;font-size:22px}#navigation{background:var(--surface);border-bottom:1px solid var(--line);display:flex;flex-wrap:wrap;justify-content:center;gap:5px;padding:10px}#navigation a{padding:6px 12px;text-decoration:none;border-radius:5px}#navigation a[aria-current=page]{background:var(--active);color:white}#mode-message{max-width:1080px;margin:8px auto 0;padding:0 20px;color:var(--muted);font-size:14px}main{max-width:1120px;margin:0 auto;padding:16px 24px 40px;min-height:60vh}h1{font-size:28px;line-height:1.3;margin:8px 0 22px}h2{font-size:21px;line-height:1.4}h3{font-size:18px}p{margin:12px 0}.muted,.count{color:var(--muted)}.count{font-size:15px;font-weight:400;margin-left:10px}.directory-head,.reader-head{display:flex;align-items:center;gap:12px}.directory-head h1,.reader-head h1{flex:1}.filters{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0}.levels{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:6px;margin:12px 0 20px}.levels button{padding:9px 3px}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px}.schools{position:relative;margin-left:auto}.schools summary{cursor:pointer;color:var(--link);padding:8px}.school-options{position:absolute;right:0;top:100%;z-index:15;background:var(--surface);border:1px solid var(--line);box-shadow:0 10px 30px #0003;padding:12px;border-radius:8px;width:250px}.school-options label{display:flex;align-items:center;gap:12px;min-height:38px;cursor:pointer}.school-options input{width:18px;height:18px}.grid{list-style:none;padding:0;margin:16px 0 26px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.card{display:flex;align-items:center;gap:9px;min-height:52px;padding:10px 13px;text-decoration:none;background:var(--surface);border:1px solid var(--line);border-radius:7px;transition:background .15s}.card[aria-current=true]{background:var(--soft);border-color:var(--link)}.card .label{flex:1}.card .chevron{opacity:.65}.badge{display:inline-block;white-space:nowrap;font-size:11px;line-height:1.6;border:1px solid var(--line);border-radius:4px;padding:0 5px;background:var(--soft);color:var(--text);vertical-align:middle}.class-icon{width:30px;height:30px;flex:none;background:currentColor;mask:var(--icon) center/contain no-repeat}.reader{border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:22px 26px;margin-top:20px;scroll-margin-top:20px}.reader-head h1{font-size:25px;margin:0}.back{padding:0;width:38px;min-height:38px;font-size:27px;border:0;background:transparent;color:var(--link);flex:none}.edition-bar{display:flex;align-items:center;gap:8px;margin:12px 0 18px;font-size:14px}.edition-bar button{padding:5px 13px}.source-link{font-size:13px;color:var(--muted)}.article{overflow-wrap:anywhere;min-width:0}.article #page-content{margin:0;padding:0}.article h1{font-size:23px}.article h2{font-size:21px}.article h3{font-size:18px}.article img{max-width:100%;height:auto}.article .feature-disclosure,.article details{border:1px solid var(--line);border-radius:6px;margin:10px 0;padding:0}.article summary{cursor:pointer;padding:10px 14px;font-weight:600}.article summary h1,.article summary h2,.article summary h3{display:inline;margin:0;font-size:17px}.article .feature-body,.article details>div{padding:0 14px 12px}.article summary::marker{color:var(--link)}.article table{width:100%;border-collapse:collapse;font-size:14px;line-height:1.5}.article th,.article td{padding:9px 11px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top}.article th{background:var(--soft)}.article tr:nth-child(even){background:color-mix(in srgb,var(--soft) 45%,transparent)}.rules-table-scroll{overflow:auto;max-width:100%;margin:15px 0;scrollbar-width:thin;scrollbar-color:var(--muted) transparent}.rules-table-scroll:focus-visible{outline:2px solid var(--link)}.article .page-tags,.article .class-back,.article #breadcrumbs,.article .subclass-badge{display:none}.subclasses{border-bottom:1px solid var(--line);padding-bottom:16px;margin-bottom:20px}.subclass-reader{margin:14px 0;padding:18px;border-left:3px solid var(--link);background:var(--soft);border-radius:6px}.notice{background:var(--soft);border:1px solid var(--line);border-radius:7px;padding:12px 16px}.notice h2{margin-top:0}.reference-link{margin-top:18px}.empty{color:var(--muted);padding:20px 0}footer{padding:25px 15px;text-align:center;color:var(--muted);font-size:12px}dialog{max-width:560px;width:calc(100% - 32px);background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:12px;padding:26px}dialog::backdrop{background:#0009;backdrop-filter:blur(3px)}.mode-options{display:grid;gap:10px;margin:20px 0}.mode-options button{text-align:left;padding:13px 16px}.mode-options span,.mode-options strong{display:block}.mode-options span{font-size:14px;color:var(--muted)}#suggestions{position:absolute;top:calc(100% + 6px);left:0;right:0;max-height:65vh;overflow:auto;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:8px;box-shadow:0 10px 30px #0004}#suggestions a{display:block;padding:10px 14px;text-decoration:none;line-height:1.4}#suggestions a:hover,#suggestions a[aria-selected=true]{background:var(--soft)}#suggestions .search-type{display:block;color:var(--muted);font-size:12px}#preview{position:fixed;width:440px;max-width:calc(100vw - 24px);z-index:50;border:1px solid var(--line);background:var(--surface);box-shadow:0 12px 40px #0005;border-radius:10px;overflow:hidden}.preview-heading{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:var(--soft)}#preview-close{border:0;font-size:24px;padding:0 8px}#preview-body{padding:14px 18px;overflow:auto;max-height:55vh;font-size:14px;scrollbar-width:thin;scrollbar-color:var(--muted) transparent}.article :target{scroll-margin-top:20px;background:var(--soft)}@media(max-width:800px){.grid{grid-template-columns:repeat(3,minmax(0,1fr))}.logo{font-size:18px}.search-wrap{flex:1}}@media(max-width:600px){#site-header{flex-wrap:wrap;gap:8px;padding:10px 12px}.logo{font-size:17px;flex:1}.logo img{width:32px;height:32px}.search-wrap{order:4;width:100%;flex-basis:100%}#ruleset{font-size:14px;max-width:120px}.rules-choice{margin:0}#theme{min-width:38px;padding:0}#navigation{gap:0;padding:7px 5px}#navigation a{font-size:13px;min-height:40px;padding:8px 10px}main{padding:14px 12px 30px}h1{font-size:25px}.grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.card{font-size:14px;min-height:48px;padding:9px}.class-icon{width:26px;height:26px}.filters button{font-size:14px;min-height:42px;padding:6px 10px}.levels{display:flex;overflow-x:auto;padding:3px 2px 9px;scrollbar-width:thin}.levels button{flex:0 0 54px;min-height:44px;font-size:14px}.reader{padding:16px 13px}.reader-head h1{font-size:23px}.article{font-size:15px}.rules-table-scroll table{min-width:460px}.rules-table-scroll table th:first-child,.rules-table-scroll table td:first-child{position:sticky;left:0;background:var(--surface);min-width:115px;max-width:180px}.article .rules-table-scroll th:first-child{background:var(--soft)}.edition-bar{flex-wrap:wrap}.badge{font-size:10px}.subclass-reader{padding:12px}.subclasses button{font-size:14px}.notice{font-size:14px}#preview{display:none!important}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

.mobile-class-select{display:none}.class-filters button{display:flex;align-items:center;gap:5px}.class-filters .class-icon{width:20px;height:20px}
@media(max-width:600px){#site-header{gap:7px}.logo{font-size:16px;gap:6px}.logo img{width:36px;height:36px}#ruleset{max-width:72px;width:72px;font-size:13px;padding:3px}#theme{min-width:34px;width:34px;height:40px;font-size:20px}.class-filters{display:none}.mobile-class-select{display:block;min-width:116px;min-height:42px;font-size:14px;padding:5px}.spell-list-label{display:none}.schools summary{font-size:14px;padding:6px 0}.toolbar{gap:8px}.logo{min-width:0}.rules-choice{flex:none}.search-wrap{flex-basis:100%}}

/* Existing Companion presentation, reused for the local edition preview. */
/* Font Awesome 4.2.0 by Dave Gandy: font SIL OFL 1.1, CSS MIT.
   Original font and license files are preserved in source-2024. */
.fa{display:inline-block;font: 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
.fa-bookmark:before{content:"\f02e"}
.fa-users:before{content:"\f0c0"}
.fa-flask:before{content:"\f0c3"}
.fa-magic:before{content:"\f0d0"}
.fa-puzzle-piece:before{content:"\f12e"}
.fa-unlock-alt:before{content:"\f13e"}
.fa-archive:before{content:"\f187"}
.fa-university:before{content:"\f19c"}
@font-face{font-family:FontAwesome;src:url(/static/icons.638419274cb545d0.woff2) format("woff2");font-weight:normal;font-style:normal;font-display:swap;}
html { scrollbar-gutter:stable; }
#site-header { display:flex; gap:20px; align-items:center; padding:12px 24px; background:#162d4a; color:white; position:relative; z-index:1000; font:15px/1.4 system-ui,sans-serif; }
#site-header a { color:#fff; text-decoration:none; white-space:nowrap; }
#site-header .logo { display:inline-flex; align-items:center; gap:8px; font-size:18px; font-weight:600; letter-spacing:-.4px; }
#site-header .logo img { display:block; width:36px; height:36px; flex:none; object-fit:contain; }
.search-wrap { display:flex; flex:1; gap:6px; margin:0; max-width:560px; position:relative; }
.search-wrap input { width:100%; min-width:80px; padding:7px 10px; border:1px solid #adc1d6; border-radius:4px; color:#182639; background:#fff; font:inherit; }
.search-wrap > button { display:none; }
#site-header .source-link { margin-left:auto; font-size:13px; }
#navigation { display:flex; flex-wrap:wrap; justify-content:center; gap:4px; padding:10px 20px; background:#fff; border-bottom:1px solid #dce4ef; font:14px/1.5 system-ui,sans-serif; }
#navigation a { padding:5px 10px; color:#1c4e8c; text-decoration:none; border-radius:5px; white-space:nowrap; }
#navigation a:hover { background:#eef3fa; text-decoration:none; }
#navigation a[aria-current="page"] { background:#1c4987; color:#fff; }
#navigation a:focus-visible { outline:3px solid #e8b34f; outline-offset:2px; }
@media(max-width:600px) { #navigation { gap:1px; padding:8px; } #navigation a { padding:5px 8px; font-size:13px; } }
#search-results { position:absolute; top:calc(100% + 6px); left:0; right:0; max-height:min(420px,55dvh); overflow-y:auto; overscroll-behavior:contain; margin:0; padding:5px; border:1px solid #b4c6d9; border-radius:8px; background:#fff; color:#172b44; box-shadow:0 12px 30px #10243c33; font:15px/1.4 system-ui,sans-serif; text-align:left; }
#search-results[hidden] { display:none; }
#search-results #search-status { margin:0; padding:8px 10px; color:#52657b; font-size:12px; }
#search-options a { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 10px; min-height:44px; box-sizing:border-box; border-radius:4px; color:#172b44; white-space:normal; text-decoration:none; }
#search-options a:hover, #search-options a[aria-selected="true"] { background:#e4edf7; color:#123f70; }
#search-options span { overflow-wrap:anywhere; }
#search-options small { flex-shrink:0; color:#52657b; font-size:11px; text-transform:capitalize; }
.search-wrap input:focus-visible { outline:2px solid #a9d5ff; outline-offset:2px; }
#main-content { margin-left:0 !important; }
[data-search-feature] { scroll-margin-top:24px; }
#side-bar, #top-bar, #login-status, #account-topbutton, #page-options-container, #extrac-div-1, #extrac-div-2 { display:none !important; }
.collapsible-block-link { cursor:pointer; }
.yui-navset .yui-nav { display:flex; flex-wrap:wrap; gap:5px; list-style:none; padding:0; border-bottom:1px solid #b4c6d9; }
.yui-navset .yui-nav a { display:block; padding:8px 13px; background:#e8eef5; border-radius:4px 4px 0 0; }
.yui-navset .yui-nav .selected a { background:#244f80; color:#fff; }
.yui-navset .yui-content > [hidden] { display:none !important; }
table { max-width:100%; }
.feature-disclosure { margin:8px 0; border:1px solid #d7e0ec; border-radius:6px; background:#fff; }
.feature-disclosure > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; color:#20334c; cursor:pointer; list-style:none; font-size:15px; line-height:1.4; }
.feature-disclosure > summary::-webkit-details-marker { display:none; }
.feature-disclosure > summary::after { content:''; flex:none; width:7px; height:7px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); margin:0 3px 4px; }
.feature-disclosure[open] > summary::after { transform:rotate(225deg); margin-top:5px; margin-bottom:0; }
.feature-disclosure > summary:hover { background:#edf3fa; }
.feature-disclosure > summary:focus-visible { outline:3px solid #e8b34f; outline-offset:2px; }
.companion-site #page-content .feature-disclosure > summary > :is(h1,h2,h3,h4,h5,h6), .spell-reader-content .feature-disclosure > summary > :is(h1,h2,h3,h4,h5,h6) { margin:0; font-size:16px; line-height:1.4; }
.feature-body { padding:2px 12px 12px; }
.feature-body > :last-child { margin-bottom:0; }
.companion-site { background:#f3f6fb !important; }
.companion-site .container-wrap-wrap, .companion-site .container-wrap, .companion-site .content-wrap { background:transparent !important; margin-top:0 !important; padding-top:0 !important; }
.companion-site .content-wrap > .container.content { top:0; width:100%; max-width:1000px; margin:0 auto; padding:20px 28px; background:transparent; border:0; border-radius:0; box-shadow:none; }
.companion-site .main-content-wrap { padding:0 15px; }
.companion-site .main-content { margin:0; padding:20px 24px; border:1px solid #d7e0ec; border-radius:8px; box-shadow:none; background:#fff; }
.companion-site .main-content .page-title { margin:0 0 12px; padding:0; border:0; background:none; color:#20334c; font:600 24px/1.3 system-ui,sans-serif; }
.companion-site .main-content .page-title span { height:auto; margin:0; padding:0; background:none; }
.companion-site .page-title::before, .companion-site .page-title::after { display:none; }
.companion-site .breadcrumbs { margin:0 0 16px; padding:0; font-size:13px; }
.companion-site .main-content .class-title { display:flex; align-items:center; gap:8px; }
.companion-site .class-back { display:inline-flex; align-items:center; justify-content:center; flex:none; width:32px; height:32px; border-radius:5px; color:#315374; text-decoration:none; font:24px/1 system-ui,sans-serif; }
.companion-site .class-back:hover { background:#e7eef8; text-decoration:none; }
.companion-site .class-back:focus-visible { outline:3px solid #e8b34f; outline-offset:2px; }
.companion-site .main-content #page-content { font-size:15px; line-height:1.65; }
.companion-site .main-content #page-content h1, .companion-site .main-content #page-content h2 { font-size:21px; line-height:1.3; margin:20px 0 10px; }
.companion-site .main-content #page-content h3, .companion-site .main-content #page-content h4, .companion-site .main-content #page-content h5 { font-size:17px; line-height:1.4; margin:18px 0 8px; }
.companion-site .footer-wrap { margin:0; padding:12px 20px; background:transparent; }
.companion-site .footer { width:100%; max-width:1000px; padding:0; font-size:12px; line-height:1.5; }
.companion-site .class-art-credit { display:block; margin-top:4px; text-align:center; color:#667a92; font:12px/1.5 system-ui,sans-serif; }
/* Replace decorative wiki heading endcaps with the shared plain headings. */
.companion-site #page-content :is(h1,h2,h3,h4,h5,h6) { background-image:none !important; padding-left:0; padding-right:0; }
.companion-site #toc.page-outline { float:none; clear:both; width:auto; max-width:100%; margin:0 0 16px; padding:0; border:1px solid #d7e0ec; border-radius:6px; background:#f3f6fb; color:#20334c; text-align:left; font:14px/1.5 system-ui,sans-serif; }
.page-outline > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:44px; box-sizing:border-box; padding:11px 14px; cursor:pointer; font-weight:600; list-style:none; }
.page-outline > summary::-webkit-details-marker { display:none; }
.page-outline > summary::after { content:''; flex:none; width:7px; height:7px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); margin:0 3px 4px; }
.page-outline[open] > summary::after { transform:rotate(225deg); margin-top:5px; margin-bottom:0; }
.page-outline > summary:focus-visible { outline:3px solid #e8b34f; outline-offset:2px; }
.page-outline nav { max-height:min(50vh,360px); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; padding:0 10px 10px; }
.companion-site #toc.page-outline ul { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:2px 12px; margin:0; padding:0; list-style:none; }
.page-outline li { min-width:0; }
.page-outline li.outline-subitem { padding-left:12px; }
.page-outline a { display:block; padding:7px 4px; overflow-wrap:anywhere; }
@media(max-width:650px) { .companion-site #toc.page-outline ul { grid-template-columns:minmax(0,1fr); } }
@media(max-width:650px) { .companion-site .content-wrap > .container.content { padding:16px; } .companion-site .main-content { padding:16px; } .companion-site .main-content .page-title { font-size:22px; } }
@media(max-width:650px) { #site-header { flex-wrap:wrap; gap:10px; padding:12px; } .search-wrap { order:3; flex-basis:100%; max-width:none; } #page-content { overflow-wrap:anywhere; } .wiki-content-table { display:block; overflow-x:auto; } }
.companion-site :is(.group-tabs button,#navigation a,.category-card,.entry-grid a,.spell-school-option,#spell-school-toggle,.feature-disclosure > summary) { transition:background-color 140ms ease-out,border-color 140ms ease-out,color 140ms ease-out; }
.feature-disclosure { box-sizing:border-box; }
.feature-disclosure > summary::after { transition:transform 180ms ease-out; }
@media (hover:hover) {
  .entry-grid a:hover { background:#eaf1fb; border-color:#83a6d3; }
}
@media (prefers-reduced-motion:reduce) {
  .companion-site :is(.group-tabs button,#navigation a,.category-card,.entry-grid a,.spell-school-option,#spell-school-toggle,.feature-disclosure > summary), .feature-disclosure > summary::after { transition:none; }
}
#class-subclasses { margin:8px 0 18px; }
.subclass-buttons { display:flex; flex-wrap:wrap; gap:6px; }
.subclass-buttons button { padding:7px 12px; border:1px solid #cbd8e8; border-radius:6px; background:#fff; color:#315374; font:inherit; font-size:14px; cursor:pointer; transition:background-color 140ms,color 140ms; }
.subclass-buttons button[aria-pressed="true"] { background:#1c4987; border-color:#1c4987; color:#fff; }
.subclass-buttons button:focus-visible { outline:3px solid #e8b34f; outline-offset:2px; }
#subclass-description { margin:8px 0 0; color:#52647d; font-size:13px; }
.subclass-badge { margin-left:auto; padding:2px 7px; border-radius:4px; background:#e5edf8; color:#315374; font-size:11px; white-space:nowrap; }
[data-integrated-subclass] { border-left:3px solid #7297c5; }
[data-integrated-subclass][hidden] { display:none; }
@media(prefers-reduced-motion:reduce) { .subclass-buttons button { transition:none; } }
.subclass-badge { max-width:40%; white-space:normal; text-align:center; }
#link-preview { position:fixed; z-index:1500; box-sizing:border-box; display:flex; flex-direction:column; overflow:hidden; border:1px solid #afc3de; border-radius:9px; background:#fff; color:#303e50; box-shadow:0 10px 35px #162d4a33; font:14px/1.55 system-ui,sans-serif; }
#link-preview[hidden] { display:none; }
#link-preview-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 14px; border-bottom:1px solid #d7e0ec; background:#f3f6fb; }
#link-preview-title { color:#1c4e8c; font-size:16px; font-weight:600; text-decoration:none; }
#link-preview-header button { padding:0; min-width:30px; min-height:30px; border:0; background:transparent; color:#315374; font-size:24px; cursor:pointer; }
#link-preview-body { padding:12px 14px; overflow:auto; overscroll-behavior:contain; min-height:0; overflow-wrap:anywhere; }
#link-preview-body p { margin:0 0 10px; }
#link-preview-body :is(h1,h2,h3,h4,h5,h6) { font-size:15px; margin:12px 0 8px; }
#link-preview-body a { color:#1c4e8c; }
#link-preview-body table { display:block; max-width:100%; overflow:auto; border-collapse:collapse; font-size:13px; }
#link-preview-body :is(th,td) { padding:5px; border:1px solid #d7e0ec; }
#link-preview-body :is(ul,ol) { padding-left:20px; }
#link-preview :focus-visible { outline:2px solid #1c4987; outline-offset:2px; }
#link-preview-body img { max-width:100%; height:auto; }
/* A quiet, slim scrollbar inside reference previews. */
#link-preview-body { scrollbar-width:thin; scrollbar-color:#90a8c5 transparent; }
#link-preview-body::-webkit-scrollbar { width:7px; height:7px; }
#link-preview-body::-webkit-scrollbar-track { background:transparent; }
#link-preview-body::-webkit-scrollbar-thumb { background:#90a8c5; border:1px solid #fff; border-radius:12px; }
#link-preview-body::-webkit-scrollbar-thumb:hover { background:#607fa5; }
#link-preview-body::-webkit-scrollbar-button { display:none; width:0; height:0; }
#link-preview-body::-webkit-scrollbar-corner { background:transparent; }
@media(forced-colors:active) { #link-preview-body { scrollbar-color:auto; } }
/* Shared theme surfaces. Dark mode also covers fetched reader/preview content. */
:root { color-scheme:light; }
:root[data-theme="dark"] { color-scheme:dark; background:#101822; }
#site-header #theme { margin-left:auto; flex:none; display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; padding:0; border:1px solid #637994; border-radius:7px; background:transparent; color:#eff6ff; font:0/1 system-ui,sans-serif; cursor:pointer; }
#theme::before { content:'☾'; font:25px/1 system-ui,sans-serif; }
html[data-theme="dark"] #theme::before { content:'☀'; }
#site-header #theme:hover { background:#304963; }
#theme:focus-visible { outline:3px solid #e8b34f; outline-offset:3px; }
html[data-theme="dark"] body { background:#101822 !important; color:#dce5f0 !important; }
html[data-theme="dark"] #site-header { background:#111f30; }
html[data-theme="dark"] :where(#navigation,.main-content,.category-card,.entry-grid a,.spell-reader-card,.feature-disclosure,.cantrip-option,.empty-category,#search-results,#link-preview,#spell-school-panel,.spell-school-option,.group-tabs button,.subclass-buttons button) { background:#1a2635 !important; border-color:#37485f !important; color:#dce5f0 !important; }
html[data-theme="dark"] :is(h1,h2,h3,h4,h5,h6,.page-title,.spell-reader-content,.feature-disclosure > summary,.category-card .fa,#search-options a) { color:#dce5f0 !important; }
html[data-theme="dark"] a { color:#91c1ff; }
html[data-theme="dark"] :is(.entry-grid a,#navigation a,.class-back,#spell-reader-back,#species-reader-back,#spell-school-toggle,#spell-school-clear,#link-preview-title,#link-preview-body a,#link-preview-header button) { color:#91c1ff !important; }
html[data-theme="dark"] :is(.entry-count,.spell-filter-label,.spell-school-hint,.spell-empty,.directory-footer,.footer,.breadcrumbs,#subclass-description,#search-status,#search-options small,#spell-school-panel legend) { color:#a6b6cb !important; }
html[data-theme="dark"] :is(.group-tabs,.yui-nav,.page-tags,hr) { border-color:#37485f !important; }
html[data-theme="dark"] :is(#link-preview-header,.subclass-badge,.yui-navset .yui-nav a,blockquote,pre,code) { background:#233347 !important; color:#c4d7ef !important; border-color:#37485f !important; }
html[data-theme="dark"] :is(.search-wrap input,input[type="search"]) { background:#1a2635; color:#e4edf8; border-color:#526b8b; }
html[data-theme="dark"] input::placeholder { color:#a6b6cb; }
html[data-theme="dark"] :where(.entry-grid a:hover,.category-card:hover,#navigation a:hover,.group-tabs button:not(:disabled):hover,.subclass-buttons button:hover,.feature-disclosure > summary:hover,#search-options a:hover,#search-options a[aria-selected="true"],.class-back:hover,#spell-reader-back:hover,#species-reader-back:hover,#spell-school-toggle:hover) { background:#293e57 !important; border-color:#6e95c4 !important; }
html[data-theme="dark"] :is(.group-tabs button[aria-selected="true"],.group-tabs button[aria-pressed="true"],.subclass-buttons button[aria-pressed="true"],#navigation a[aria-current="page"],.yui-navset .yui-nav .selected a) { background:#305d92 !important; border-color:#6797d2 !important; color:#fff !important; }
html[data-theme="dark"] :is(.entry-grid a[aria-current="true"],.spell-school-option:has(input:checked),.cantrip-option button) { background:#263f60 !important; border-color:#6797d2 !important; color:#dceaff !important; }
html[data-theme="dark"] .group-tabs button:disabled { background:#161f2a !important; color:#7d8a9c !important; border-color:#29374a !important; }
html[data-theme="dark"] :is(th,td) { border-color:#3a4b60 !important; }
html[data-theme="dark"] :is(table,tbody,tr,td) { background:#1a2635 !important; color:#dce5f0 !important; }
html[data-theme="dark"] :is(th,thead) { background:#263f60 !important; color:#e4edf8 !important; }
html[data-theme="dark"] tr:nth-child(even), html[data-theme="dark"] tr:nth-child(even) > td { background:#202e3f !important; }
html[data-theme="dark"] #link-preview-body { scrollbar-color:#617e9f transparent; }
html[data-theme="dark"] #link-preview-body::-webkit-scrollbar-thumb { background:#617e9f; border-color:#1a2635; }
html[data-theme="dark"] :focus-visible { outline-color:#a9cfff; }


/* Legacy tab panels and image-backed headings need their own dark surfaces. */
html[data-theme="dark"] .yui-navset .yui-content { background:#1a2635 !important; border-color:#37485f !important; box-shadow:none; }
html[data-theme="dark"] .companion-site #toc.page-outline { background:#233347; border-color:#37485f; color:#dce5f0; }
html[data-theme="dark"] .class-art-credit { color:#a6b6cb; }
html[data-theme="dark"] #page-content :is(h1,h2,h3,h4,h5,h6) { background-image:none !important; }
/* Keep wide tables inside a keyboard-accessible scroll region. */
.table-scroll { max-width:100%; min-width:0; overflow-x:auto; overscroll-behavior-x:contain; margin:12px 0; scrollbar-width:thin; }
.table-scroll:focus-visible { outline:2px solid #6c97cc; outline-offset:3px; }
.table-scroll > table { display:table !important; width:100%; margin:0 !important; }
@media(max-width:650px) {
  .companion-site .main-content-wrap { padding:0; }
  .companion-site .content-wrap > .container.content { padding:12px; }
  .companion-site .main-content { min-width:0; padding:14px; }
  .table-scroll[data-wide-table] > table { min-width:var(--table-min-width,600px); }
  .table-scroll :is(th,td) { white-space:normal; overflow-wrap:normal; }
  .table-scroll th { font-size:13px; }
  .table-scroll td { font-size:14px; }
  .table-scroll { scrollbar-color:#839bb8 transparent; }
  .spell-reader-heading a { white-space:normal; }
  .spell-reader-title-group { max-width:100%; }
  .spell-reader-title-group h2 { overflow-wrap:anywhere; }
  .yui-navset .yui-content { padding:8px; min-width:0; }
}

@media(max-width:650px) {
  .table-scroll[data-wide-table]::before { content:'Swipe table to see all columns'; display:block; position:sticky; left:0; width:fit-content; margin-bottom:6px; color:#65758b; font:12px/1.4 system-ui,sans-serif; }
  html[data-theme="dark"] .table-scroll[data-wide-table]::before { color:#a6b6cb; }
}
/* Hide the returning directory until its entrance effects are installed. */
/* Keep destination articles hidden until their entrance animation is ready too. */
html[data-return-entry] :is(.directory-main,#main-content,.main-content) { visibility:hidden; }
/* External SVG masks inherit text color, including dark/selected states. */
.class-symbol { display:inline-block; background-color:currentColor; -webkit-mask:var(--class-symbol) center / contain no-repeat; mask:var(--class-symbol) center / contain no-repeat; }
.entry-grid .class-card .class-symbol { color:inherit; margin-left:0; flex:0 0 36px; }
@media(max-width:600px) { .entry-grid .class-card .class-symbol { flex-basis:30px; } }
.companion-site .class-mention { display:inline; white-space:nowrap; color:inherit; font-size:inherit; font-weight:inherit; }
.companion-site .class-mention > span.class-mention-icon { display:inline-block; background-color:currentColor; width:1.15em; height:1.15em; max-width:none; margin:0 .22em 0 0; padding:0; border:0; vertical-align:-.2em; object-fit:contain; }
@media (max-width:600px) { .companion-site .class-mention > span.class-mention-icon { width:1.05em; height:1.05em; } }

/* Phone improvements are inert above 600px, including their extra controls. */
.mobile-only { display:none !important; }
.mobile-reader-title-group, .mobile-level-strip, #spell-class-options { display:contents; }
@media(max-width:600px) {
  .mobile-only { display:inline-flex !important; }
  .mobile-hide { display:none !important; }
  .companion-site .search-wrap input { font-size:16px; min-height:44px; box-sizing:border-box; }
  .companion-site #site-header #theme { width:44px; height:44px; }
  .companion-site .content-wrap > .container.content { box-sizing:border-box; }
  .companion-site .content-wrap > .container.content > .row { margin-left:0; margin-right:0; }
  .companion-site .main-content-wrap, .companion-site .main-content { box-sizing:border-box; max-width:100%; }
  .companion-site .mobile-reader-title-group { display:flex; align-items:center; gap:8px; min-width:0; }
  .companion-site :is(#spell-reader-back,#species-reader-back,.class-back,.mobile-reader-back) {
    display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px;
    flex:none; padding:0; border:0; border-radius:6px; background:transparent; color:#315374; font:24px/1 system-ui,sans-serif; cursor:pointer;
  }
  .companion-site .mobile-reader-return, .companion-site .mobile-class-jumps a {
    align-items:center; justify-content:center; min-height:44px; box-sizing:border-box; padding:8px 12px;
    border:1px solid #cbd8e8; border-radius:6px; background:#fff; color:#1c4e8c; font:14px/1.4 system-ui,sans-serif; cursor:pointer; text-decoration:none;
  }
  .companion-site .mobile-reader-return { margin-top:16px; }
  .companion-site .mobile-class-jumps { display:flex !important; gap:8px; margin:0 0 12px; }
  .companion-site .mobile-class-jumps a { display:inline-flex; }
  .companion-site :is(#spell-reader-full,#feat-reader-full,#background-reader-full) { display:none; }
  .companion-site :is(#spell-reader,#feat-reader,#background-reader):has([role="status"]:not([hidden])) .spell-reader-heading a { display:inline; }
  .companion-site .spell-filter-heading { gap:8px; align-items:stretch; }
  .companion-site .spell-filter-heading > .spell-filter-label { display:none; }
  .companion-site #mobile-class-toggle, .companion-site #spell-school-toggle {
    display:flex; align-items:center; justify-content:space-between; gap:6px; min-height:44px; box-sizing:border-box;
    padding:7px 10px; border:1px solid #cbd8e8; border-radius:6px; background:#fff; font:14px/1.35 system-ui,sans-serif; color:#315374; text-align:left; cursor:pointer;
  }
  .companion-site #mobile-class-toggle { flex:1 1 48%; }
  .companion-site #mobile-class-toggle::after { content:'▾'; }
  .companion-site #mobile-class-toggle[aria-expanded="true"]::after { transform:rotate(180deg); }
  .companion-site #spell-school-filters { flex:1 1 52%; }
  .companion-site #spell-school-toggle { width:100%; height:100%; }
  .companion-site #spell-class-options { display:none; }
  .companion-site #spell-class-options[data-open] { display:flex; flex-wrap:wrap; gap:6px; width:100%; padding-top:4px; }
  .companion-site #spell-class-options button { min-height:44px; }
  .companion-site .spell-class-filters { margin-bottom:10px; }
  .companion-site .spell-school-option { min-height:44px; }
  .companion-site #spell-school-clear { min-height:44px; padding:8px; }
  .companion-site .mobile-level-strip { display:flex; align-items:flex-start; gap:5px; border-bottom:1px solid #cbd8e8; margin-bottom:16px; }
  .companion-site .spell-level-tabs { flex:1; min-width:0; margin:0; padding-bottom:8px; border:0; scrollbar-width:thin; }
  .companion-site .spell-level-tabs button { min-height:44px; }
  .companion-site .mobile-level-more { align-items:center; justify-content:center; flex:none; width:44px; height:44px; border:1px solid #cbd8e8; border-radius:6px; background:#fff; color:#315374; font:26px/1 system-ui,sans-serif; cursor:pointer; }
  .companion-site .mobile-level-more:disabled { visibility:hidden; }
  .companion-site .feat-type-tabs { gap:6px; margin-bottom:12px; padding-bottom:12px; }
  .companion-site .feat-type-tabs button { min-height:44px; padding:6px 10px; }
  .companion-site .table-scroll[data-wide-table] tr > :first-child:not([colspan]) { position:sticky; left:0; z-index:1; width:110px; max-width:130px; overflow-wrap:anywhere; box-shadow:1px 0 #cbd8e8; }
  .companion-site .table-scroll[data-mobile-row-key="level"] tr > :first-child:not([colspan]) { width:52px; min-width:52px; max-width:52px; box-sizing:border-box; padding-left:6px; padding-right:6px; white-space:nowrap; overflow-wrap:normal; }
  .companion-site .table-scroll[data-mobile-price] tr > :last-child:not([colspan]) { width:90px; max-width:90px; }
  .companion-site .table-scroll[data-wide-table] tr > td:first-child { background:#fff !important; }
  .companion-site .table-scroll[data-wide-table] tr:nth-child(even) > td:first-child { background:#f3f6fb !important; }
  html[data-theme="dark"] .companion-site :is(.mobile-reader-back,.mobile-reader-return,.mobile-class-jumps a,#mobile-class-toggle,#spell-school-toggle,.mobile-level-more) { background:#1a2635; color:#91c1ff; border-color:#37485f; }
  html[data-theme="dark"] .companion-site .mobile-level-strip { border-color:#37485f; }
  html[data-theme="dark"] .companion-site .table-scroll[data-wide-table] tr > td:first-child { background:#1a2635 !important; }
  html[data-theme="dark"] .companion-site .table-scroll[data-wide-table] tr:nth-child(even) > td:first-child { background:#202e3f !important; }
}

body.local-navigation { margin:0; min-height:100vh; display:flex; flex-direction:column; background:#f3f6fb; color:#20334c; font:16px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif; }
.local-navigation * { box-sizing:border-box; }
.local-navigation a { color:#1c4e8c; }
.local-navigation a:focus-visible, .local-navigation button:focus-visible, .category-group:focus-visible { outline:3px solid #e8b34f; outline-offset:4px; }
.directory-header { background:#1c4987; color:#fff; }
.directory-header > div { max-width:1000px; margin:auto; padding:21px 28px; }
.directory-header .site-name { display:block; color:#fff; text-decoration:none; font-size:27px; font-weight:500; line-height:1.2; }
.directory-header span { display:block; margin-top:7px; color:#d9e6f7; font-size:13px; letter-spacing:1.5px; }
.directory-main { width:100%; max-width:1000px; margin:0 auto; padding:20px 28px; }
.home-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.category-card { min-height:88px; padding:14px 12px; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:8px; text-align:center; color:#173f75 !important; text-decoration:none; border:1px solid #d7e0ec; border-radius:10px; background:white; font-size:17px; font-weight:500; transition:background .15s,border-color .15s; }
.category-card .fa { font-size:35px; color:#303a46; }
.category-card:hover { background:#eaf1fb; border-color:#83a6d3; }
#navigation { display:flex; flex-wrap:wrap; justify-content:center; gap:4px; padding:10px 20px; background:#fff; border-bottom:1px solid #dce4ef; }
#navigation a { padding:5px 10px; text-decoration:none; border-radius:5px; font-size:14px; }
#navigation a:hover { background:#eef3fa; }
#navigation a[aria-current="page"] { background:#1c4987; color:#fff; }
.directory-title { display:flex; gap:16px; justify-content:space-between; align-items:center; margin-bottom:16px; }
.directory-title h1 { display:flex; align-items:center; gap:10px; font-size:24px; font-weight:600; margin:0; line-height:1.3; }
.directory-title h1 .fa { font-size:25px; }
.reference-link { font-size:14px; white-space:nowrap; }
.group-tabs { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 16px; padding-bottom:10px; border-bottom:1px solid #cbd8e8; }
.group-tabs button { padding:7px 12px; border:1px solid #cbd8e8; border-radius:6px; background:#fff; color:#315374; font:inherit; font-size:14px; line-height:1.35; cursor:pointer; }
.group-tabs button:hover { background:#e7eef8; border-color:#83a6d3; }
.group-tabs button[aria-selected="true"] { background:#1c4987; border-color:#1c4987; color:#fff; }
.group-tabs button:disabled { background:#edf0f4; border-color:#dce2ea; color:#8a95a5; cursor:not-allowed; }
.spell-class-filters { margin-bottom:16px; padding-bottom:0; border-bottom:0; }
.spell-filter-label { flex-basis:100%; font-size:13px; font-weight:600; color:#52647d; }
.spell-filter-heading { position:relative; display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; }
.spell-filter-heading .spell-filter-label { flex-basis:auto; flex-shrink:0; }
.spell-level-tabs { flex-wrap:nowrap; overflow-x:auto; }
.spell-level-tabs button { flex:1 0 auto; padding:9px 12px; white-space:nowrap; }
#spell-school-filters { min-width:0; margin:0; }
#spell-school-toggle { display:flex; align-items:center; gap:8px; max-width:100%; padding:0; border:0; border-radius:3px; background:transparent; color:#315374; font:inherit; font-size:13px; line-height:1.5; cursor:pointer; }
#spell-school-toggle::after { content:'\25be'; margin-left:auto; }
#spell-school-toggle[aria-expanded="true"]::after { transform:rotate(180deg); }
#spell-school-toggle:hover { background:#e7eef8; border-color:#83a6d3; }
#spell-school-panel { position:absolute; top:calc(100% + 6px); right:0; z-index:20; width:340px; max-width:100%; max-height:65vh; overflow-y:auto; margin:0; padding:12px; border:1px solid #cbd8e8; border-radius:8px; background:#fff; box-shadow:0 8px 24px #20334c26; }
#spell-school-panel legend { float:left; width:100%; padding:0; font-size:13px; font-weight:600; color:#52647d; }
.spell-school-hint { clear:both; margin:0 0 8px; color:#667a92; font-size:12px; }
.spell-school-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.spell-school-option { display:flex; align-items:center; gap:7px; min-height:40px; padding:7px; border:1px solid #cbd8e8; border-radius:6px; background:#fff; color:#315374; font-size:13px; cursor:pointer; }
.spell-school-option input { margin:0; accent-color:#1c4987; }
.spell-school-option:has(input:checked) { color:#173f75; background:#dce8f8; border-color:#83a6d3; }
.spell-school-option:focus-within { outline:3px solid #e8b34f; outline-offset:2px; }
#spell-school-clear { margin-top:8px; padding:6px 0; border:0; background:none; color:#1c4e8c; text-decoration:underline; font:inherit; font-size:13px; cursor:pointer; }
#spell-school-filters[hidden], #spell-school-panel[hidden], #spell-school-clear[hidden], #spell-no-results[hidden] { display:none; }
.spell-class-filters button { padding:7px 12px; font-size:14px; }
.spell-class-filters button[aria-pressed="true"] { background:#1c4987; border-color:#1c4987; color:#fff; }
.spell-class-filters[hidden], .entry-grid li[hidden], .spell-empty[hidden] { display:none; }
.spell-empty { color:#52647d; padding:16px 0; }
.cantrip-option { max-width:620px; padding:16px 18px; border:1px solid #d7e0ec; border-radius:8px; background:#fff; color:#52647d; }
.cantrip-option[hidden] { display:none; }
.cantrip-option p { margin:0 0 12px; }
.cantrip-option button { padding:8px 12px; border:1px solid #a9c1e0; border-radius:6px; background:#eaf1fb; color:#173f75; font:inherit; font-size:14px; cursor:pointer; }
.cantrip-option button:hover { background:#dce8f8; }
#spell-list[hidden], #spell-reader[hidden], #spell-reader-status[hidden] { display:none; }
.spell-reader-heading { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:8px 16px; margin-bottom:16px; }
.spell-reader-heading a { font-size:14px; white-space:nowrap; }
.spell-reader-title-group { display:flex; align-items:center; gap:8px; min-width:0; }
#spell-reader-back { display:inline-flex; align-items:center; justify-content:center; flex:none; width:32px; height:32px; padding:0; border:0; border-radius:5px; background:transparent; color:#315374; font:24px/1 system-ui,sans-serif; cursor:pointer; }
#spell-reader-back:hover { background:#e7eef8; }
#background-reader { margin-top:24px; }
#background-reader[hidden], #background-reader-status[hidden] { display:none; }
#background-reader-title { margin:0; font-size:23px; line-height:1.3; }
#background-reader-title:focus { outline:none; }
.entry-grid a[aria-current="true"] { border-color:#1c4987; background:#e7eef8; }
.spell-reader-card { padding:24px; border:1px solid #d7e0ec; border-radius:10px; background:#fff; overflow-wrap:anywhere; }
#spell-reader-title { margin:0; font-size:23px; line-height:1.25; color:#20334c; }
#spell-reader-title:focus { outline:none; }
.spell-reader-content { color:#303e50; font-size:15px; line-height:1.65; }
.spell-reader-content p { margin:0 0 16px; }
.spell-reader-content h3, .spell-reader-content h5 { font-size:17px; margin:24px 0 12px; }
.spell-reader-content ul { padding-left:24px; }
.spell-reader-content table { display:block; max-width:100%; overflow-x:auto; border-collapse:collapse; margin:16px 0; font-size:14px; }
.spell-reader-content th, .spell-reader-content td { padding:9px 12px; border:1px solid #d7e0ec; text-align:left; vertical-align:top; }
.spell-reader-content th { background:#eaf1fb; color:#173f75; }
#spell-reader-status { color:#52647d; }
@media(max-width:600px) { .spell-reader-card { padding:18px; } #spell-reader-title { font-size:22px; } }
.feat-type-tabs { gap:8px; margin-bottom:16px; padding-bottom:16px; border-bottom:2px solid #cbd8e8; }
.feat-type-tabs button { font-weight:600; }
[id^="feat-setting-"][role="tablist"], .category-group > .group-tabs { border-bottom:0; padding-bottom:0; margin-bottom:20px; }
.category-group > .group-tabs button { padding:7px 12px; font-size:14px; }
.category-group > .group-tabs button[aria-selected="true"] { color:#173f75; background:#dce8f8; border-color:#a9c1e0; }
.category-group[hidden] { display:none; }
.category-group h2 { font-size:16px; font-weight:600; margin:0 0 10px; }
.entry-count { color:#667a92; font-size:13px; font-weight:400; margin-left:7px; }
.entry-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; list-style:none; padding:0; margin:0; }
.entry-grid li { min-width:0; }
.entry-grid a { min-height:44px; height:100%; display:flex; gap:12px; align-items:center; justify-content:space-between; padding:8px 11px; border:1px solid #d7e0ec; border-radius:6px; background:#fff; text-decoration:none; overflow-wrap:anywhere; }
.entry-grid a:hover { border-color:#83a6d3; background:#eaf1fb; }
.entry-grid a > span { color:#8ba1bc; font-size:20px; }
.directory-footer { margin-top:auto; padding:15px 20px; text-align:center; color:#65758b; font-size:12px; }
.empty-category { background:#fff; border:1px solid #d7e0ec; border-radius:8px; padding:24px; color:#52647d; }
@media(min-width:850px) { .entry-grid { grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media(max-width:600px) { .directory-main { padding:20px 16px; } .directory-header > div { padding:18px 16px; } .home-grid { gap:9px; } .category-card { min-height:105px; padding:14px 7px; font-size:15px; } .category-card .fa { font-size:29px; } .entry-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .directory-title { flex-wrap:wrap; gap:8px; } .directory-title h1 { font-size:24px; } #navigation { gap:1px; padding:8px; } #navigation a { padding:5px 8px; font-size:13px; } }
@media(max-width:350px) { .home-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .entry-grid { grid-template-columns:1fr; } }

#feat-reader { margin-top:24px; }
#feat-reader[hidden], #feat-reader-status[hidden] { display:none; }
#feat-reader-title { margin:0; font-size:23px; line-height:1.3; }
#feat-reader-title:focus { outline:none; }
#species-reader { margin-top:24px; }
#species-reader[hidden], #species-reader-status[hidden] { display:none; }
#species-reader-title { margin:0; font-size:23px; line-height:1.3; }
#species-reader-title:focus { outline:none; }
#species-reader-back { display:inline-flex; align-items:center; justify-content:center; flex:none; width:32px; height:32px; padding:0; border:0; border-radius:5px; background:transparent; color:#315374; font:24px/1 system-ui,sans-serif; cursor:pointer; }
#species-reader-back:hover { background:#e7eef8; }


.entry-grid a.class-card { justify-content:flex-start; gap:9px; }
.class-card .class-portrait { width:36px; height:36px; object-fit:contain; flex:0 0 36px; }
.entry-grid .class-card > .class-label { color:inherit; font-size:inherit; min-width:0; }
.class-card > [aria-hidden="true"] { margin-left:auto; flex:none; }
@media(max-width:600px) { .entry-grid a.class-card { gap:7px; padding:7px 9px; } .class-card .class-portrait { width:30px; height:30px; flex-basis:30px; } }

/* Adapt the new edition controls to the established Companion layout. */
:root{--bg:#f3f6fb;--surface:#fff;--soft:#e7eef8;--text:#20334c;--muted:#667a92;--link:#1c4e8c;--line:#d7e0ec;--active:#1c4987;--header:#162d4a}
html[data-theme=dark]{--bg:#101822;--surface:#1a2635;--soft:#233347;--text:#dce5f0;--muted:#a6b6cb;--link:#91c1ff;--line:#37485f;--active:#305d92;--header:#111f30}
#main{min-height:0}
#mode-message{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
#search{min-height:0;padding:7px 10px;border-radius:4px}
.search-wrap{width:auto;min-width:0}
#site-header .logo{flex:none}
.rules-choice{margin-left:auto;flex:none}
#ruleset{display:inline-flex;align-items:stretch;gap:2px;height:36px;min-height:36px;padding:2px;border-radius:7px;box-shadow:inset 0 0 0 1px #637994;background:transparent;color:#eff6ff;font:14px/1.4 system-ui,sans-serif}
#ruleset label{position:relative;display:flex;cursor:pointer}
#ruleset input{position:absolute;width:1px;height:1px;opacity:0;clip-path:inset(50%)}
#ruleset span{display:flex;align-items:center;justify-content:center;min-width:42px;padding:0 9px;border-radius:5px;transition:background-color 140ms ease-out,color 140ms ease-out;white-space:nowrap}
#ruleset label:hover span{background:#293e57}
#ruleset input:checked+span{background:#305d92;color:#fff;box-shadow:inset 0 0 0 1px #6797d2}
#ruleset input:focus-visible+span{outline:2px solid #a9cfff;outline-offset:2px}
#site-header #theme{margin-left:0;min-width:36px}
.header-actions{display:flex;align-items:center;gap:8px;flex:none}
#animations{display:flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:5px 9px;font-size:13px;background:transparent;color:inherit;border-color:#637994;white-space:nowrap}
#animations svg{flex:none}.motion-state{font-size:11px;min-width:23px;font-weight:600}.motion-slash{display:none}
#animations[aria-pressed=false] .motion-slash{display:block}
#animations[aria-pressed=true]{background:#305d92;color:#fff;border-color:#6797d2}
html[data-motion=off],html[data-motion=off] *,html[data-motion=off] *::before,html[data-motion=off] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
html[data-motion=off] .directory-progress-track{width:100%;opacity:.65}
#navigation a{min-height:0}
.directory-head h1{margin:0}
.category-card{text-decoration:none}
.filters{gap:6px;margin:0 0 16px;padding-bottom:10px;border-bottom:1px solid #cbd8e8}
.filters button,.levels button,.edition-bar button{padding:7px 12px;border:1px solid #cbd8e8;border-radius:6px;font:14px/1.35 system-ui,sans-serif;color:#315374;background:#fff}
.filters button[aria-pressed=true],.levels button[aria-pressed=true],.edition-bar button[aria-pressed=true]{background:#1c4987;border-color:#1c4987;color:#fff}
.filters button:disabled,.levels button:disabled{opacity:1;background:#edf0f4;border-color:#dce2ea;color:#8a95a5;cursor:not-allowed}
.class-filters{border:0;padding:0;margin:0 0 16px}
.class-filters .class-icon{width:1.15em;height:1.15em}
.toolbar{margin-bottom:6px;font:13px/1.5 system-ui,sans-serif}
.spell-list-label{font-weight:600;color:#52647d}
.schools summary{display:flex;align-items:center;gap:8px;padding:0;list-style:none;font:13px/1.5 system-ui,sans-serif;color:#315374;border-radius:3px}
.schools summary::-webkit-details-marker{display:none}
.schools summary::after{content:'▾';margin-left:auto}
.schools[open] summary::after{transform:rotate(180deg)}
.school-options{width:340px;max-width:calc(100vw - 32px);display:grid;grid-template-columns:1fr 1fr;gap:6px}
.school-options label{min-height:40px;padding:7px;border:1px solid var(--line);border-radius:6px;font-size:13px;gap:7px}
.school-options label:has(input:checked){background:var(--soft)}
.school-options input{width:auto;height:auto;margin:0;accent-color:#1c4987}
#school-clear{grid-column:1/-1;justify-self:start;padding:6px 0;border:0;background:transparent;color:var(--link);font-size:13px;text-decoration:underline}
#mobile-class-toggle,.level-more{display:none}
.mobile-class-select{display:none!important}
.levels{display:flex;gap:6px;margin:0 0 16px;padding-bottom:10px;border-bottom:1px solid #cbd8e8}
.levels button{flex:1 0 auto;padding:9px 12px;white-space:nowrap}
.grid.entry-grid{margin:0}
.item-table-scroll{max-width:100%;overflow-x:auto;border:1px solid var(--line);border-radius:7px;background:var(--surface);overscroll-behavior-x:contain}
.item-table{width:100%;min-width:660px;border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:14px;line-height:1.45}
.item-table .item-name-column{width:36%}
.item-table th,.item-table td{padding:10px 12px;text-align:left;vertical-align:middle;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.item-table thead th{background:var(--soft);font-weight:650}
.item-table tbody th{font-weight:400}
.item-table tbody tr:nth-child(even){background:var(--bg)}
.item-table tbody tr:last-child>*{border-bottom:0}
.item-table tbody tr:hover,.item-table tbody tr:has([aria-current=true]){background:var(--soft)}
.item-table .item-link{display:flex;align-items:center;gap:8px;min-height:24px;color:var(--link);text-decoration:none}
.item-table .item-link:hover{text-decoration:underline}
.item-table .badge{flex:none}
/* Keep native table semantics, with independent fixed-column row layout so
   the browser can skip offscreen cells. All rows remain searchable/focusable. */
@supports (content-visibility:auto){
  .item-table,.item-table thead,.item-table tbody{display:block}
  .item-table colgroup{display:none}
  .item-table tr{display:grid;grid-template-columns:36% repeat(4,minmax(0,1fr));content-visibility:auto;contain-intrinsic-block-size:auto 45px}
  .item-table tr>*{min-width:0;display:flex;align-items:center}
  .item-table .item-link{width:100%}
  @media(max-width:600px){.item-table tr{grid-template-columns:190px repeat(4,minmax(0,1fr))}}
  @media print{.item-table tr{content-visibility:visible}}
}
.item-references{position:relative;font-size:14px;margin-left:auto;align-self:center}
.item-references summary{cursor:pointer;color:var(--link);padding:8px}
.item-references nav{position:absolute;right:0;top:100%;z-index:5;min-width:180px;padding:6px;background:var(--surface);border:1px solid var(--line);border-radius:7px;box-shadow:0 8px 24px #0003}
.item-references a{display:block;padding:9px;color:var(--link);text-decoration:none;border-radius:4px}
.item-references a:hover,.item-references a:focus-visible{background:var(--soft)}
html[data-theme=dark] .item-table tbody tr>*{background:var(--surface)!important;color:var(--text)!important}
html[data-theme=dark] .item-table tbody tr:nth-child(even)>*{background:#202e3f!important}
html[data-theme=dark] .item-table tbody tr:hover>*,html[data-theme=dark] .item-table tbody tr:has([aria-current=true])>*{background:var(--soft)!important}
@media(max-width:600px){.item-table{min-width:620px;font-size:14px}.item-table .item-name-column{width:190px}.item-table th,.item-table td{padding:8px 10px}.item-table .item-link{min-height:28px}.item-table tr>:first-child{position:sticky;left:0;background:var(--surface);z-index:1;box-shadow:1px 0 var(--line)}.item-table thead tr>:first-child{background:var(--soft)}.item-table tbody tr:nth-child(even)>:first-child{background:var(--bg)}.item-table tbody tr:hover>:first-child,.item-table tbody tr:has([aria-current=true])>:first-child{background:var(--soft)}}
#main{position:relative}
.directory-progress{position:absolute;left:24px;right:24px;height:3px;border-radius:3px;overflow:hidden;background:var(--line);pointer-events:none;z-index:5}
.directory-progress-track{display:block;width:35%;height:100%;border-radius:inherit;background:var(--link);animation:directory-progress-slide 1s ease-in-out infinite}
@keyframes directory-progress-slide{from{transform:translateX(-105%)}to{transform:translateX(390%)}}
@media(max-width:600px){.directory-progress{left:16px;right:16px}}
@media(prefers-reduced-motion:reduce){.directory-progress-track{animation:none;width:100%;opacity:.65}}
.entry-grid .card{height:100%;min-height:44px;padding:8px 11px;border-radius:6px;gap:12px}
.entry-grid .card>.label{font-size:inherit;color:inherit;min-width:0}
.entry-grid .card>.chevron{color:#8ba1bc;font-size:20px;opacity:1}
.entry-grid .card>.badge{font-size:11px;color:var(--text)}
.entry-grid .card>.class-icon{width:36px;height:36px;color:inherit;margin:0;flex:0 0 36px}
.entry-grid .card:has(>.class-icon){gap:9px}
.count{font-size:13px;margin-left:7px}
.category-group h2{line-height:1.5}
.directory-head h1{flex:none}
html[data-theme=dark] .directory-title h1 .fa{color:#dce5f0}
.reader{margin-top:24px;padding:24px}
.reader-head{gap:8px;margin-bottom:16px}
.reader-head h1{font-size:23px;line-height:1.3;margin:0}
.reader[data-kind=spell] .reader-head h1{font-size:23px;line-height:1.25;flex:none}
.reader[data-inline=true][data-kind=spell]{margin-top:16px}
.reader[data-inline=false]{font:14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif}
.reader[data-inline=false] .reader-head h1{font:600 24px/1.3 system-ui,sans-serif}
.reader[data-inline=false] .article{font:15px/1.65 "Helvetica Neue",Helvetica,Arial,sans-serif}
.reader[data-inline=false] .article p{margin:0 0 10px}
.reader[data-inline=false] .article h1,.reader[data-inline=false] .article h2{font-size:21px;line-height:1.3;font-weight:500;margin:20px 0 10px}
.reader[data-inline=false] .article h3,.reader[data-inline=false] .article h4{font-size:17px;line-height:1.4;font-weight:500;margin:18px 0 8px}
.reader[data-inline=false] .reader-head{margin-bottom:12px}
.reader[data-inline=false] .article table{display:table;width:100%;margin:0;font-size:15px;line-height:1.42857143}
.reader[data-inline=false] .article :is(th,td){padding:8px;border:0;border-top:1px solid #ddd}
.reader[data-inline=false] .article .table-scroll{margin:12px 0}
.reader[data-inline=false] .subclass-buttons{font:14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif}
.reader[data-inline=false] .subclass-buttons button{font:inherit}
.reader[data-inline=false] .subclass-buttons{margin-bottom:0}
.reader[data-inline=false] #subclass-description{line-height:18.5714px}
html[data-theme=dark] #navigation a[aria-current=page]{color:#91c1ff!important}
.reader-head>.class-icon{width:28px;height:28px}
.reader-head .back{width:32px;min-height:32px;height:32px;font:24px/1 system-ui,sans-serif;border-radius:5px}
#main:has(>.reader-slot) .reader{margin-top:0}
#main>#reader-slot:only-child>.reader{margin-top:0;border-radius:8px;padding:20px 24px}
.edition-bar{margin:0 0 16px;gap:6px}
.article{color:#303e50;font-size:15px;line-height:1.65}
.article p{margin:0 0 16px}
.article .feature-disclosure{margin:8px 0}
.article .feature-disclosure>summary{font-weight:400;padding:10px 12px}
.article .feature-disclosure>summary :is(h1,h2,h3,h4){font-size:16px;font-weight:400;line-height:1.4;margin:0}
.article .feature-disclosure>.feature-body{padding:2px 12px 12px}
.article .feature-body>:last-child{margin-bottom:0}
.subclasses{border:0;padding:0;margin-bottom:20px}
.subclasses .filters{border:0;padding:0}
.subclass-reader{padding:0;margin:12px 0 0;border:0;background:transparent}
.subclass-reader:empty{display:none}
.article .subclass-badge{display:block;font-size:11px;font-weight:400}
.subclass-buttons{font:14px/1.65 Arial,sans-serif}
.filters.nested-tabs{border:0;padding:0;margin-bottom:20px}
.filters.feat-type-tabs{gap:8px;margin-bottom:16px;padding-bottom:16px;border-bottom:2px solid #cbd8e8}
.filters.feat-type-tabs button{font-weight:600}
.article table{font:14px/1.5 inherit}
@media(max-width:650px){.article .table-scroll[data-imported-many-columns]>table{min-width:960px}}
.source-link{font-size:12px;margin-bottom:0}
.directory-footer{line-height:1.5}
/* Avoid flashing the footer in the content area while the first list loads. */
html[data-booting] .directory-footer{visibility:hidden}
#preview{display:flex;flex-direction:column;max-height:min(430px,calc(100vh - 24px));border:1px solid #afc3de;border-radius:9px;box-shadow:0 10px 35px #162d4a33;font:14px/1.55 system-ui,sans-serif}
.preview-heading{gap:12px;padding:10px 14px;border-bottom:1px solid #d7e0ec;background:#f3f6fb;flex:none}
#preview-title{font-size:16px;font-weight:600;color:#1c4e8c}
#preview-title{text-decoration:none}
.school-mobile{display:none}
#preview-close{padding:0;min-width:30px;min-height:30px;border:0;background:transparent;color:#315374;font-size:24px}
#preview-body{padding:12px 14px;min-height:0;max-height:none;font:14px/1.55 system-ui,sans-serif;overscroll-behavior:contain;scrollbar-color:#90a8c5 transparent}
#preview-body p{margin:0 0 10px}
#preview-body :is(h1,h2,h3,h4,h5,h6){font-size:15px;margin:12px 0 8px}
#preview-body table{display:block;max-width:100%;overflow:auto;font-size:13px}
#preview-body :is(th,td){padding:5px;border:1px solid #d7e0ec}
#preview-body :is(ul,ol){padding-left:20px}
#preview-body::-webkit-scrollbar{width:7px;height:7px}
#preview-body::-webkit-scrollbar-thumb{background:#90a8c5;border:1px solid #fff;border-radius:12px}
#preview-body::-webkit-scrollbar-button{display:none;width:0;height:0}
html[data-theme=dark] #preview{border-color:#37485f;color:#dce5f0}
html[data-theme=dark] .preview-heading{background:#233347;border-color:#37485f}
html[data-theme=dark] :is(#preview-title,#preview-close){color:#91c1ff}
html[data-theme=dark] #preview-body{scrollbar-color:#617e9f transparent}
html[data-theme=dark] #preview-body::-webkit-scrollbar-thumb{background:#617e9f;border-color:#1a2635}
.companion-site :is(.filters button,.levels button,.edition-bar button,.schools summary,.school-options label){transition:background-color 140ms ease-out,border-color 140ms ease-out,color 140ms ease-out}
.companion-site #main[data-filter-commit] :is(.filters button,.class-filters button,.levels button){transition:none}
.filters button:not(:disabled):hover,.levels button:not(:disabled):hover,.edition-bar button:hover,.schools summary:hover{background:#e7eef8;border-color:#83a6d3}
html[data-theme=dark] :is(.article,.spell-list-label,.schools summary){color:#dce5f0}
html[data-theme=dark] :is(.filters button,.levels button,.edition-bar button){background:#1a2635;border-color:#37485f;color:#dce5f0}
html[data-theme=dark] :is(.filters,.levels){border-color:#37485f}
html[data-theme=dark] :is(.filters button:not(:disabled):hover,.levels button:not(:disabled):hover,.edition-bar button:hover,.schools summary:hover){background:#293e57;border-color:#6e95c4}
html[data-theme=dark] :is(.filters button[aria-pressed=true],.levels button[aria-pressed=true],.edition-bar button[aria-pressed=true]){background:#305d92;border-color:#6797d2;color:#fff}
html[data-theme=dark] :is(.filters button:disabled,.levels button:disabled){background:#161f2a;color:#7d8a9c;border-color:#29374a}
@media(min-width:601px){.grid.entry-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:601px){.reader[data-inline=true]:is([data-kind=feat],[data-kind=background]) .reader-head .back{display:none}}
@media(min-width:850px){.grid.entry-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:650px){#site-header{gap:10px;padding:12px}.search-wrap{order:4;width:100%;flex-basis:100%;max-width:none}}
@media(max-width:600px){
 #site-header{gap:7px}#site-header .logo{font-size:16px;gap:6px;letter-spacing:-.4px}
 #site-header .logo img{width:36px;height:36px}.rules-choice{margin-left:auto}
 #site-header{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"logo theme" "search rules"}
 #site-header .logo{grid-area:logo}#site-header .header-actions{grid-area:theme;justify-self:end;gap:5px}
 #site-header #animations{width:44px;min-width:44px;height:44px;padding:0}
 #animations .motion-label,#animations .motion-state{display:none}
 #site-header .search-wrap{grid-area:search;width:100%;min-width:0}
 #ruleset{grid-area:rules;justify-self:end;width:auto;max-width:none;margin:0;padding:0;gap:0;font-size:13px;min-height:44px;height:44px}
 #ruleset span{min-width:44px;min-height:44px;padding:0 6px}
 #suggestions{width:calc(100vw - 24px);max-width:calc(100vw - 24px)}
 #site-header #theme{width:44px;min-width:44px;height:44px}
 #site-header .search-wrap #search{font-size:16px;min-height:44px}
 .reader{padding:18px}.reader-head h1{font-size:22px}.reader-head .back{width:44px;min-height:44px;height:44px}
 #main>#reader-slot:only-child>.reader{padding:18px 14px}
 .entry-grid .card{min-height:44px;font-size:16px;padding:8px 11px}
 .entry-grid .card>.class-icon{width:30px;height:30px;flex-basis:30px}
 .filters button{min-height:44px}.levels{overflow-x:auto;padding-bottom:8px}.levels button{min-height:44px;flex:1 0 auto}
 .toolbar{margin-bottom:10px;align-items:stretch}.mobile-class-select{flex:1 1 48%;width:0;min-width:0;min-height:44px;border-radius:6px;font:14px/1.35 system-ui,sans-serif;padding:7px 10px}
 .schools{flex:1 1 52%;min-width:0;margin:0}.schools summary{height:100%;min-height:44px;padding:7px 10px;border:1px solid var(--line);background:var(--surface);border-radius:6px;font:14px/1.35 system-ui,sans-serif}
 .school-options label{min-height:44px}
 .school-desktop{display:none}.school-mobile{display:inline}
 .grid.entry-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 #mobile-class-toggle{display:flex;align-items:center;justify-content:space-between;gap:6px;flex:1 1 48%;min-width:0;min-height:44px;padding:7px 10px;border:1px solid var(--line);background:var(--surface);color:var(--link);border-radius:6px;font:14px/1.35 system-ui,sans-serif;text-align:left}
 #mobile-class-toggle::after{content:'▾'}#mobile-class-toggle[aria-expanded=true]::after{transform:rotate(180deg)}
 .class-filters[data-open]{display:flex}.class-filters button{min-height:44px}
 .level-strip{display:flex;align-items:flex-start;gap:5px;border-bottom:1px solid var(--line);margin-bottom:16px}
 .level-strip .levels{flex:1;min-width:0;margin:0;border:0;padding-top:0}
 .level-more{display:flex;align-items:center;justify-content:center;flex:none;width:44px;height:44px;padding:0;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--link);font:26px/1 system-ui,sans-serif}
 .level-more:disabled{visibility:hidden}
}
@media(max-width:350px){.grid.entry-grid{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.companion-site :is(.filters button,.levels button,.edition-bar button,.schools summary,.school-options label){transition:none}}

@media(prefers-reduced-motion:reduce){#ruleset span{transition:none}}
