.library-categories { margin:20px 0 28px; padding:18px 20px; border:1px solid #d7e0d4; background:#f2f5ee; border-radius:10px; color:#183c35; }
.library-categories-title,#library .library-categories-title { font:500 1rem/1.4 Georgia,"Times New Roman",serif; letter-spacing:normal; margin:0 0 12px; }
.library-categories ul { list-style:none; margin:0; padding:0; }
.library-categories>ul { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px 24px; align-items:start; }
.library-categories ul ul { display:block; padding-left:12px; margin-top:6px; border-left:1px solid #ccd7c8; }
.library-categories a { display:inline-block; padding:5px 0; color:#185448; text-underline-offset:.2em; line-height:1.45; }
.library-categories li { min-width:0; overflow-wrap:anywhere; }
.library-categories>ul>li>a { font-weight:600; }
.library-categories ul ul a { font-size:.9em; }
.category-menu { position:relative; min-width:0; color:#183c35; }
.site-header .category-menu { border:0; }
.category-menu>summary::after,.category-menu[open]>summary::after { content:none; }
.category-menu>summary { display:flex; align-items:center; gap:6px; min-height:44px; padding:0; cursor:pointer; list-style:none; font:inherit; }
.category-menu>summary::-webkit-details-marker { display:none; }
.category-menu-arrow { font-size:1em; }
.category-menu[open]>summary .category-menu-arrow { transform:rotate(180deg); }
.category-menu>summary:focus-visible,.category-dropdown a:focus-visible,.library-categories a:focus-visible { outline:3px solid #b38e43; outline-offset:3px; border-radius:2px; }
.category-dropdown { position:absolute; z-index:20; top:calc(100% + 8px); right:0; width:min(360px,calc(100vw - 36px)); max-height:min(70vh,560px); overflow:auto; padding:14px 18px; border:1px solid #d7e0d4; border-radius:10px; background:#fbf8f2; box-shadow:0 12px 28px #183d351a; }
.category-dropdown ul { display:block; list-style:none; margin:0; padding:0; }
.category-dropdown ul ul { margin:2px 0 6px; padding-left:14px; border-left:1px solid #d7e0d4; }
.category-dropdown li { min-width:0; }
.site-header .category-dropdown a { display:block; white-space:normal; overflow-wrap:anywhere; min-height:44px; padding:10px 4px; font-size:16px; font-weight:400; line-height:1.4; text-decoration:none; }
.site-header .category-dropdown a:hover { text-decoration:underline; }
/* Shared navigation geometry: anchors and disclosure summary are equal flex controls. */
.site-header :is(.links,.reader-navigation,.reader-mobile-menu nav)>a,
.site-header :is(.links,.reader-navigation,.reader-mobile-menu nav)>.category-menu>summary {
 display:flex; align-items:center; box-sizing:border-box; min-height:44px;
 padding:10px 0; font-size:16px; font-weight:500; line-height:1.4; white-space:nowrap;
}
.site-header .category-menu { align-self:center; }
.site-header .category-dropdown ul ul a { font-size:15.5px; }
@media(min-width:1001px) { .site-header .links { gap:14px; flex-wrap:nowrap; } }
@media(min-width:1001px) and (max-width:1240px) {
 .site-header .links { gap:8px; }
}
@media(max-width:1000px) {
 .library-categories>ul { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .site-header .links .category-menu { width:100%; }
 .site-header :is(.links,.reader-mobile-menu nav)>a,
 .site-header :is(.links,.reader-mobile-menu nav)>.category-menu>summary {
  min-height:48px; padding:12px 4px; font-size:17px;
 }
 .site-header .category-dropdown a,.site-header .category-dropdown ul ul a { font-size:16px; }
 .reader-page .reader-navigation { display:none; }
 .reader-mobile-menu { display:block; width:100%; }
 .reader-mobile-menu>summary { min-height:44px; padding:10px 0; font-size:17px; line-height:1.4; cursor:pointer; }
 .reader-mobile-menu nav { display:flex; flex-direction:column; gap:0; padding:12px 0; }
 .reader-mobile-menu .category-menu { width:100%; }
 .reader-mobile-menu .category-dropdown { position:static; width:100%; max-height:none; box-shadow:none; margin:0 0 8px; }
 .site-header .links .category-dropdown { position:static; width:100%; max-height:none; margin:0 0 8px; box-shadow:none; }
}
@media(max-width:480px) { .library-categories>ul { grid-template-columns:minmax(0,1fr); gap:12px; } }
.reader-toc { padding:18px 22px; margin:24px 0 32px; border:1px solid #d7e0d4; border-radius:10px; background:#f2f5ee; }
.reader-toc summary { cursor:pointer; font-weight:600; }
.reader-toc li { margin:.5em 0; }
.material-body :is(h2,h3,h4,h5,h6) { scroll-margin-top:24px; margin:1.6em 0 .7em; }
.material-body h4 { font-size:1.3rem; }
.reader-page .reader-navigation { display:flex; align-items:center; flex-wrap:nowrap; gap:14px; font-size:16px; }
.reader-page .site-header { flex-wrap:wrap; }
.reader-page .reader-navigation { width:100%; }
.reader-mobile-menu { display:none; }
.reader-account { font-size:.85rem; }
.reader-preview-banner { padding:16px; background:#eef2e8; border:1px solid #a6b69c; }
.reader-source pre { white-space:pre-wrap; overflow-wrap:anywhere; font-size:.85rem; }
.reader-page .education-assistant { margin:36px auto 0; max-width:1160px; padding:0 18px; }
.reader-page .assistant-panel { display:flex; gap:20px; align-items:center; border:1px solid #dce3da; background:#f2f4ef; border-radius:12px; padding:24px; }
.reader-page .assistant-mark { flex:0 0 54px; width:54px; height:54px; padding:12px; border-radius:50%; background:#25a6d5; color:white; }
.reader-page .assistant-mark svg { width:100%; height:100%; }
.reader-page .assistant-copy { flex:1; }
.reader-page .assistant-copy h2 { font-size:1.3rem; margin:0 0 .5em; }
.reader-page .assistant-copy p { font-size:.9rem; margin:.3em 0; }
.reader-page .assistant-note { color:#546b61; }
.reader-page .assistant-button { flex-shrink:0; padding:12px 16px; border:1px solid #91a39b; border-radius:6px; background:transparent; font:inherit; color:#546b61; }
@media(max-width:1000px) { .reader-page .reader-navigation { display:none; } .reader-mobile-menu { display:block; width:100%; } }
@media(max-width:767px) {
 .reader-page .assistant-panel { flex-wrap:wrap; padding:18px; }
 .reader-page .assistant-copy { flex-basis:calc(100% - 74px); }
 .reader-page .assistant-button { margin-left:74px; max-width:100%; }
 .library-categories { padding:18px; }
}
@media(prefers-reduced-motion:reduce) { .reader-page { scroll-behavior:auto; } }
