/* Additive student presentation: all selectors confined to its own root. */
#studentLibrary{--sl-gold:#eed49d;--sl-ink:#4d3624;position:fixed;inset:0;z-index:1100;display:flex;flex-direction:column;background:#17122e url("student-ui/assets/bg_info.b6a3105a39430cc5b.webp") center/cover;color:var(--sl-gold);font:15px/1.5 Georgia,var(--wordbook-ui-font),serif;padding:env(safe-area-inset-top) 0 calc(14px + env(safe-area-inset-bottom));height:100dvh;box-sizing:border-box}
#studentLibrary *,#studentLibrary *::before,#studentLibrary *::after{box-sizing:border-box}
#studentLibrary button,#studentLibrary input,#studentLibrary select,#studentLibrary textarea{font:inherit}
#studentLibrary button{cursor:pointer;color:inherit;border:1px solid #ac8a58;border-radius:10px;background:#39274f;padding:8px 12px;min-height:40px;box-shadow:none}
#studentLibrary button:disabled{opacity:.4;cursor:default}
#studentLibrary button:focus-visible,#studentLibrary input:focus-visible,#studentLibrary select:focus-visible,#studentLibrary textarea:focus-visible{outline:3px solid #9471cb;outline-offset:2px}
#studentLibrary h2,#studentLibrary h3,#studentLibrary p{margin:0}
#studentLibrary .sl-brand{flex:none;min-height:76px;padding:10px 150px 8px 16px;border-bottom:1px solid #a98a5338;display:flex;flex-direction:column;justify-content:center}
#studentLibrary .sl-brand>b{font-size:17px;white-space:nowrap;letter-spacing:2px}
#studentLibrary .sl-brand>small{font-size:8px;letter-spacing:1px;white-space:nowrap}
#studentLibrary .sl-main{flex:1;min-height:0;overflow:hidden;padding:10px 12px}
#studentLibrary .sl-nav{flex:none;display:grid;grid-template-columns:repeat(4,1fr);gap:4px;border-top:1px solid #a98a5338;padding:5px 8px 0;background:#151027}
#studentLibrary .sl-nav button{border:0;background:none;padding:2px;display:flex;flex-direction:column;align-items:center;gap:1px;font-size:12px;min-height:61px}
#studentLibrary .sl-nav img{width:36px;height:36px;object-fit:contain}
#studentLibrary .sl-nav [aria-current]{background:#d5b77812;border-radius:12px}
body[data-student-library='open'].student-active>.shell,body[data-student-library='open'].student-active>#studentNativeTools{display:none!important}
body[data-student-library='open']{overflow:hidden!important}
body:not(.student-active)>#studentLibrary{display:none!important}
#studentLibrary .sl-shelf{height:100%;overflow-y:auto;display:flex;flex-direction:column;gap:9px;align-items:center;background:url("student-ui/assets/bg_scene.b6a3105a39430cc5b.webp") center/cover;border:1px solid #ac8a5866;border-radius:16px;padding:12px}
#studentLibrary .sl-shelf h2{font-size:19px;text-align:center;text-shadow:0 2px 4px #17122e}
#studentLibrary .sl-shelf>p{font-size:12px;background:#17122ed9;border-radius:12px;padding:3px 12px}
#studentLibrary .sl-books{width:100%;max-width:410px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 15px;margin:auto 0}
#studentLibrary .sl-books button{display:flex;flex-direction:column;align-items:center;gap:2px;background:#17122ecf;padding:6px;border-color:#c4a67277;min-width:0}
#studentLibrary .sl-books img{width:100%;height:clamp(70px,13dvh,127px);object-fit:contain;filter:drop-shadow(0 4px 4px #0006)}
#studentLibrary .sl-books span{font-size:14px}
#studentLibrary .sl-books small{font-size:11px}
#studentLibrary .sl-manual{width:100%;background:#f2dfb9;color:#51375f}
#studentLibrary .sl-manual small{display:block;font-size:11px}
#studentLibrary .sl-list{display:flex;flex-direction:column;gap:8px;height:100%;min-height:0;border:1px solid #c5a06a;border-radius:17px;padding:12px;color:var(--sl-ink);background:#f3e1bc url("student-ui/assets/parchment.b6a3105a39430cc5b.webp") center/cover}
#studentLibrary .sl-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none}
#studentLibrary .sl-heading h2{font-size:18px}
#studentLibrary .sl-heading>span{white-space:nowrap;font-size:12px}
#studentLibrary .sl-list button{color:var(--sl-ink);background:#fffaeb;border-color:#bd965f}
#studentLibrary .sl-search{display:flex;flex-direction:column;gap:3px;font-size:12px}
#studentLibrary input[type=search],#studentLibrary select,#studentLibrary input[type=date]{width:100%;border:1px solid #bd965f;border-radius:8px;background:#fff9e9;color:var(--sl-ink);padding:7px;min-width:0;min-height:40px}
#studentLibrary input[type=search]{font-size:16px}
#studentLibrary .sl-advanced{flex:none;max-height:39%;overflow-y:auto;border-bottom:1px solid #c5a06a;padding-bottom:5px;font-size:12px}
#studentLibrary .sl-advanced summary{cursor:pointer;min-height:35px;display:list-item;margin-left:16px;padding:6px 0}
#studentLibrary .sl-filter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
#studentLibrary .sl-filter-grid label{display:flex;flex-direction:column;gap:2px}
#studentLibrary .sl-features{display:flex;flex-wrap:wrap;gap:9px;margin:10px 0}
#studentLibrary .sl-features label{display:flex;align-items:center;gap:4px;min-height:32px}
#studentLibrary .sl-results{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#studentLibrary .sl-row{display:flex;gap:6px;justify-content:space-between;align-items:center;width:100%;text-align:left;border:0;border-bottom:1px dashed #b9976455;border-radius:0;background:transparent;padding:11px 2px;overflow-wrap:anywhere}
#studentLibrary .sl-row>span:first-child{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}
#studentLibrary .sl-row b{font-size:18px}
#studentLibrary .sl-row span span{font-size:13px}
#studentLibrary .sl-row small{font-size:10px;color:#775c40;display:block}
#studentLibrary .sl-badges{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:3px;max-width:62px}
#studentLibrary .sl-badges i{font-style:normal;font-size:9px;color:#fff4df;background:#694d85;border-radius:5px;padding:2px 4px}
#studentLibrary .sl-foot{flex:none;font-size:10px;line-height:1.5;text-align:center;color:#775c40}
#studentLibrary .sl-empty{text-align:center;padding:24px 12px}
#studentLibrary .sl-card{display:flex;flex-direction:column;height:100%;gap:6px}
#studentLibrary .sl-card-scroll{flex:1;min-height:0;overflow-y:auto;display:flex;justify-content:center;align-items:safe center}
#studentLibrary .sl-book{position:relative;width:min(100%,420px);aspect-ratio:2/3;flex:none;background:url("student-ui/assets/card_book.b6a3105a39430cc5b.webp") center/contain no-repeat}
#studentLibrary .sl-book-content{position:absolute;inset:11% 15% 13% 14%;display:flex;min-height:0}
#studentLibrary .sl-book-scroll{flex:1;min-width:0;overflow-y:auto;overscroll-behavior:contain;text-align:center;padding:3px}
#studentLibrary .sl-word{font-size:clamp(26px,7vw,36px);line-height:1.25;color:#3e2b21;overflow-wrap:anywhere}
#studentLibrary .sl-ipa{font-size:16px;color:#3d6285;margin:6px 0;overflow-wrap:anywhere}
#studentLibrary .sl-ipa button{padding:0 4px;min-height:32px;background:transparent;color:#694d85;border:0}
#studentLibrary .sl-meaning{font-size:15px;color:#624b70;margin:6px 0;overflow-wrap:anywhere}
#studentLibrary .sl-blocks{display:flex;justify-content:center;flex-wrap:wrap;gap:6px;margin:12px 0;color:#4d3624}
#studentLibrary .sl-blocks>span{border:1px solid #bb9c6c;border-radius:8px;background:#fff7e6;padding:5px 7px;min-width:42px;display:flex;flex-direction:column}
#studentLibrary .sl-blocks b{font-size:17px}
#studentLibrary .sl-blocks small{font-size:12px}
#studentLibrary .sl-strip{display:flex;flex-direction:column;gap:4px;width:100%;padding:12px 9px;margin:10px 0;text-align:left;border:0;border-radius:9px;color:var(--sl-ink);overflow-wrap:anywhere;white-space:pre-wrap;font-size:13px;line-height:1.65}
#studentLibrary .sl-strip b{font-size:12px;letter-spacing:1px}
#studentLibrary .sl-tip{background:#f6e4b6}
#studentLibrary .sl-memo{background:#e9d8ed}
#studentLibrary .sl-note{display:block;color:#624b70;text-align:left;font-size:13px;margin-top:12px}
#studentLibrary textarea{display:block;width:100%;min-height:96px;font-size:16px;background:#fff8ec;color:var(--sl-ink);border:1px solid #bb9c6c;border-radius:8px;padding:8px}
#studentLibrary .sl-actions{display:flex;gap:6px;justify-content:flex-end;margin-top:5px}
#studentLibrary .sl-actions button{font-size:12px;padding:5px 9px}
#studentLibrary .sl-marks{position:absolute;top:17%;right:5%;display:flex;flex-direction:column;gap:6px}
#studentLibrary .sl-marks button{font-size:11px;writing-mode:vertical-rl;padding:7px 4px;min-height:44px;background:#887398;color:#fff3de;border-color:#c5a06a}
#studentLibrary .sl-marks [aria-pressed=true]{background:#674a83}
#studentLibrary .sl-card-rules{margin:10px 0;text-align:left;color:#624b70}
#studentLibrary .sl-card-rules h3{font-size:12px}
#studentLibrary .sl-card-rules button{display:block;width:100%;margin-top:5px;font-size:13px;min-height:38px;background:#fff7e6;color:#624b70}
#studentLibrary .sl-card-footer{display:flex;gap:6px;align-items:center;justify-content:space-between;flex:none}
#studentLibrary .sl-card-footer button{font-size:12px;padding:7px 10px;white-space:nowrap}
#studentLibrary .sl-card-footer span{font-size:11px;text-align:center;color:#fff1c9}
#studentLibrary .sl-rule-shade{position:absolute;inset:0;background:#110d24cf;display:grid;place-items:center;padding:22px;z-index:20}
#studentLibrary .sl-rule-dialog{width:100%;max-width:450px;max-height:80dvh;overflow:auto;background:#f7e7c6;color:var(--sl-ink);border:1px solid #c5a06a;border-radius:16px;padding:22px;display:flex;flex-direction:column;gap:16px;overflow-wrap:anywhere}
#studentLibrary .sl-rule-dialog h2{font-size:22px}
#studentLibrary .sl-rule-dialog p{white-space:pre-wrap}
@media(max-height:780px){#studentLibrary .sl-brand{min-height:66px}#studentLibrary .sl-books img{height:clamp(65px,12dvh,100px)}#studentLibrary .sl-shelf{gap:5px;padding:9px}#studentLibrary .sl-books{gap:6px 14px}}
#studentLibrary .sl-mode-bar{display:flex;gap:6px;flex:none;justify-content:center;flex-wrap:wrap}
#studentLibrary .sl-mode-bar button{font-size:12px;min-height:36px;padding:5px 9px;background:#30213f}
#studentLibrary .sl-mode-bar [aria-pressed=true]{background:#765295;border-color:#efd49c;color:#fff2d4}
#studentLibrary .sl-session-warning{font-size:11px;color:#ffe0b2;border:1px solid #b99362;border-radius:8px;padding:5px 8px;flex:none}
#studentLibrary .sl-grade-bar{display:flex;justify-content:center;gap:8px;flex:none}
#studentLibrary .sl-grade-bar button{font-size:13px;min-height:40px;padding:7px 12px}
#studentLibrary .sl-grade-bar [data-value=good]{background:#346e5f;color:#fff4d8}
#studentLibrary .sl-grade-bar [data-value=bad]{background:#874d61;color:#fff4d8}
#studentLibrary .sl-grade-bar [aria-pressed=true]{outline:2px solid #f2d69a;outline-offset:1px}
#studentLibrary .sl-guess-caption{color:#765582;font-size:17px;margin:6px 0;line-height:1.5}
#studentLibrary .sl-guess-form{display:flex;flex-direction:column;gap:6px;color:#65466c;text-align:left;font-size:12px;margin:10px 0}
#studentLibrary .sl-guess-form input{min-height:42px;width:100%;font-size:16px;padding:7px;background:#fff9e9;border:1px solid #bb9c6c;border-radius:8px;color:#4d3624}
#studentLibrary .sl-guess-form button{width:100%;min-height:40px}
#studentLibrary .sl-guess-result{font-size:13px;color:#765582;margin:7px 0;line-height:1.6}
#studentLibrary .sl-guess-tools{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:7px 0}
#studentLibrary .sl-guess-tools button{font-size:11px;padding:5px 8px;min-height:36px}
#studentLibrary .sl-blocks>button{min-width:42px;background:#fff7e6;color:#5c3d6d;padding:6px 8px;border:1px solid #bb9c6c}
#studentLibrary .sl-blocks>button b{font-size:17px}
#studentLibrary .sl-heading h2{overflow-wrap:anywhere;line-height:1.3}
#studentLibrary .sl-heading>button{white-space:nowrap}
#studentLibrary .sl-stats-banner{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border:1px solid #c5a06a;background:#f0debc;border-radius:9px;font-size:11px;flex:none}
#studentLibrary .sl-stats-banner button{min-height:34px;font-size:10px;white-space:nowrap;padding:4px 7px}
#studentLibrary .sl-rule-groups{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;flex:none}
#studentLibrary .sl-rule-groups button{display:flex;flex-direction:column;align-items:center;gap:3px;padding:5px;min-width:0;background:#fff6e2}
#studentLibrary .sl-rule-groups img{width:40px;height:54px;object-fit:contain}
#studentLibrary .sl-rule-groups b{font-size:12px}#studentLibrary .sl-rule-groups small{font-size:10px}
#studentLibrary .sl-rule-groups [aria-pressed=true],#studentLibrary .sl-rule-count [aria-pressed=true]{background:#e9d9eb;border-color:#79558f}
#studentLibrary .sl-rule-count{display:flex;align-items:center;justify-content:space-between;gap:6px;flex:none;font-size:11px}
#studentLibrary .sl-rule-count button{min-height:34px;font-size:11px;padding:4px 10px}
#studentLibrary .sl-rule-dialog h3{font-size:14px;margin:0 0 6px}
#studentLibrary .sl-rule-dialog .sl-rule-caution{padding:8px 10px;background:#f2d8b3;border-left:3px solid #a5764c;border-radius:4px}
#studentLibrary .sl-rule-words{border-top:1px solid #c5a06a;padding-top:12px}
#studentLibrary .sl-rule-words button{display:flex;align-items:baseline;gap:9px;width:100%;text-align:left;background:#fff7e6;color:#62446e;margin:5px 0;padding:7px 9px;min-height:40px;overflow-wrap:anywhere}
#studentLibrary .sl-rule-words small{font-size:11px;color:#715840}
@media(max-height:800px){#studentLibrary .sl-rule-groups img{width:33px;height:44px}}
#studentLibrary .sl-list .sl-heading h2{flex:1;min-width:0;font-size:17px;text-align:center}
#studentLibrary .sl-rule-dialog>[data-sl=rule-close]{background:#694a80;color:#fff2d5;border-color:#b18c60;min-height:42px}
#studentLibrary .sl-rule-dialog h2:focus{outline:none}

/* Knowledge navigation reuses the existing manual and modal, independent of Rule IDs. */
#studentLibrary .sl-knowledge-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:12px}
#studentLibrary .sl-knowledge-heading button{font-size:11px;min-height:32px;padding:4px 8px}
#studentLibrary .sl-knowledge-groups{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
#studentLibrary .sl-knowledge-groups button{min-height:50px;padding:6px 2px;gap:3px}
#studentLibrary .sl-knowledge-groups b{font-size:11px}
#studentLibrary .sl-knowledge-members{list-style:none;padding:0;margin:0}
#studentLibrary .sl-knowledge-members li{padding:9px 0;border-bottom:1px solid #c5a06a77;overflow-wrap:anywhere}
#studentLibrary .sl-knowledge-members b{display:inline-block;margin-right:10px}
#studentLibrary .sl-knowledge-members small{display:block;line-height:1.6;margin-top:4px;color:#715840}
#studentLibrary .sl-knowledge-heading [aria-pressed=true]{background:#e9d9eb;border-color:#79558f}
#studentLibrary .sl-manual-view .sl-heading span{font-size:10px;white-space:nowrap}

/* Seven handbook categories. Empty categories remain navigable. */
#studentLibrary .sl-handbook-summary{margin:0;font-size:12px;flex:none}
#studentLibrary .sl-category-grid{min-height:0;flex:1;overflow-y:auto;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-content:start;padding:2px}
#studentLibrary .sl-category{display:flex;align-items:center;gap:7px;text-align:left;min-height:100px;padding:10px 6px;background:#fff8e8;color:#65482f;border:1px solid #b18c60;border-radius:12px}
#studentLibrary .sl-category img{width:36px;height:54px;object-fit:contain;flex:none}
#studentLibrary .sl-category span{display:flex;flex:1;min-width:0;flex-direction:column;gap:7px}
#studentLibrary .sl-category b{font-size:13px;line-height:1.5}
#studentLibrary .sl-category small{font-size:10px;line-height:1.5;color:#715840}
#studentLibrary .sl-category i{font-style:normal;font-size:19px}
#studentLibrary .sl-category:last-child:nth-child(odd){grid-column:1/-1}
#studentLibrary .sl-all-content{min-height:38px;background:#694a80;color:#fff2d5;flex:none}
#studentLibrary .sl-category-description{margin:0;font-size:12px;line-height:1.6;flex:none}
#studentLibrary .sl-subcategories{display:flex;gap:6px;overflow-x:auto;flex:none;padding:2px 0 6px}
#studentLibrary .sl-subcategories button{white-space:nowrap;min-height:40px;padding:6px 9px;font-size:11px;flex:none}
#studentLibrary .sl-subcategories [aria-pressed=true]{background:#694a80;color:#fff2d5}
#studentLibrary .sl-handbook-empty{padding:20px 10px;line-height:1.8}
#studentLibrary .sl-handbook-empty h3{font-size:17px}
#studentLibrary .sl-content-kind{color:#805b85;font-size:10px}
#studentLibrary .sl-handbook-home .sl-foot{margin:0;font-size:10px;flex:none}

#studentLibrary .sl-today-draft{flex:none;padding:6px 10px;border:1px solid #c5a06a;background:#fff0d6;color:#59412d;border-radius:8px;font-size:12px;line-height:1.5}
#studentLibrary .sl-today-draft p{margin:3px 0}#studentLibrary .sl-today-draft>div{display:flex;gap:8px}#studentLibrary .sl-today-draft button{min-height:40px;flex:1}#studentLibrary .sl-today-readonly{flex:none;margin:3px 0;font-size:12px}

#studentLibrary .sl-today-draft button{background:#694a80;color:#fff2d5;border:1px solid #b18c60;min-height:44px;font-size:14px}#studentLibrary .sl-today-draft button:disabled{opacity:.5}

/* Query semantics and list facts; retain the existing art and scrolling surface. */
#studentLibrary .sl-query-modes{display:flex;gap:8px;flex:none}#studentLibrary .sl-query-modes button{flex:1;min-height:40px}
#studentLibrary .sl-query-modes [aria-pressed=true]{background:#694a80;color:#fff2d5}
#studentLibrary .sl-query-summary,#studentLibrary .sl-course-note{font-size:11px;line-height:1.5;margin:0;flex:none;overflow-wrap:anywhere}
#studentLibrary .sl-query-summary{max-height:48px;overflow-y:auto}
#studentLibrary .sl-advanced[open]{max-height:clamp(65px,calc(100% - 440px),240px);overflow-y:auto;flex:none}
#studentLibrary .sl-dictionary{padding:10px;background:#fbebcb;border:1px solid #bd965d;border-radius:8px;margin-bottom:10px;overflow-wrap:anywhere}
#studentLibrary .sl-dictionary h3{margin:5px 0;font-size:20px}#studentLibrary .sl-dictionary p{margin:5px 0;line-height:1.6}#studentLibrary .sl-dictionary small{font-size:11px;line-height:1.6}
#studentLibrary .sl-list-record{display:flex;align-items:stretch;border-bottom:1px solid #c5a06a77}
#studentLibrary .sl-list-record>.sl-row{flex:1;min-width:0;border-bottom:0}
#studentLibrary .sl-row-speak{flex:none;align-self:center;min-width:40px;min-height:44px;padding:4px;background:transparent}
#studentLibrary .sl-list-record.is-selected{box-shadow:inset 3px 0 #79558f}
#studentLibrary .sl-row-ipa{font-size:13px;line-height:1.5}
#studentLibrary .sl-resume{min-height:42px;flex:none;width:100%}
#studentLibrary .sl-tip small{display:block;font-size:11px;line-height:1.6;margin-top:6px;overflow-wrap:anywhere}
#studentLibrary .sl-tip button{min-height:42px;margin-top:8px;background:#fff5df;color:#62446e}
#studentLibrary .sl-tip-alternatives{border-top:1px solid #bc985e;margin-top:9px}
#studentLibrary .sl-tip-alternatives article{padding:10px 0;border-bottom:1px solid #c5a06a77}
#studentLibrary .sl-tip-alternatives h3{font-size:14px;line-height:1.5}
#studentLibrary .sl-tip-alternatives p{line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
#studentLibrary .sl-list-pager{display:flex;gap:4px;align-items:center;justify-content:space-between;flex:none;font-size:11px}
#studentLibrary .sl-list-pager button{min-height:42px;padding:5px 7px;font-size:12px}
#studentLibrary .sl-list-pager input{width:3.5em;min-height:42px;padding:4px;font-size:16px}
#studentLibrary .sl-list:not(.sl-manual-view){overflow-y:auto}
#studentLibrary .sl-list:not(.sl-manual-view) .sl-results{min-height:100px}
