/* R22 · isolated two-page visual preview. One viewport; only inner result/rail/menu regions scroll. */
:root{
  color-scheme:light;
  --night:#1c1435;
  --ink:#4b332b;
  --plum:#59356f;
  --violet:#79549a;
  --gold:#cba66f;
  --gold-soft:#e2c89d;
  --paper:#f8e9c9;
}
*{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0;overflow:hidden;background:var(--night);overscroll-behavior:none}
body{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Noto Serif CJK SC",serif;-webkit-text-size-adjust:100%;touch-action:manipulation}
#host{position:fixed;inset:0;width:100%;height:100vh;height:100dvh;overflow:hidden}
#studentLibrary{position:fixed;inset:0;z-index:10;display:flex;flex-direction:column;width:100%;height:100dvh;min-height:0;overflow:hidden;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);color:var(--paper);background-color:var(--night);background-image:url("./starfield_bg.webp");background-position:center;background-size:100% 100%;background-repeat:no-repeat;touch-action:manipulation}

#studentLibrary[data-view=shelf] .sl-main{position:relative;isolation:isolate}
#studentLibrary[data-view=shelf] .sl-main::after{content:none}
#studentLibrary[data-view=shelf] .sl-shelf{z-index:1}
@media(max-height:720px){#studentLibrary[data-view=shelf] .sl-main::after{content:none}}
#studentLibrary[hidden],#studentLibrary [hidden]{display:none!important}
#studentLibrary button,#studentLibrary input{font:inherit;-webkit-tap-highlight-color:transparent}
#studentLibrary button{cursor:pointer;touch-action:manipulation}
#studentLibrary button:disabled{opacity:.42;cursor:default}
#studentLibrary button:focus-visible{outline:2px solid #f4d59a;outline-offset:2px}
#studentLibrary input:focus,#studentLibrary input:focus-visible{outline:0!important;box-shadow:none!important}
#studentLibrary h2,#studentLibrary p{margin:0}
#studentLibrary .sl-brand.mw-scene-brand{position:relative;isolation:isolate;display:flex;flex:0 0 84px;min-height:84px;flex-direction:column;align-items:center;justify-content:center;gap:0;padding:0 34px 2px;border:0;background:transparent;text-align:center;overflow:visible;z-index:2}
#studentLibrary .sl-brand.mw-scene-brand::before{content:"";position:absolute;z-index:-1;pointer-events:none;left:0;right:0;top:2px;height:76px;background:url("./brand_vine_r19.webp") center/100% 100% no-repeat}
#studentLibrary .sl-brand.mw-scene-brand>b{color:#f8e7b9;font:700 clamp(20px,5.2vw,24px)/1.12 "Songti SC","STSong","Noto Serif CJK SC",serif;letter-spacing:3px;text-shadow:0 2px 7px #090822,0 0 10px #f6cb8a55;white-space:nowrap}
#studentLibrary .sl-brand.mw-scene-brand>small{color:#ead0a7;font:500 9px/1.35 Georgia,serif;letter-spacing:1.5px;text-shadow:0 1px 5px #100923;white-space:nowrap}
#studentLibrary .sl-brand.mw-info-brand{display:none!important}
#studentLibrary .sl-main{flex:1 1 auto;min-height:0;min-width:0;overflow:hidden;padding:0}

/* Bookshelf: the original scene is a single full-screen background. The shelf art itself reaches the viewport edges. */
#studentLibrary .sl-shelf.stage-shelf-scene{
  position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:0;
  overflow:hidden;border:0;border-radius:0;padding:0;margin:0;gap:0;background:none;
}
#studentLibrary .stage-shelf-frame{position:relative;flex:none;height:min(100%,155.7vw);width:auto;aspect-ratio:2/3;max-height:100%;transform:translateY(-4px) scale(1.05);transform-origin:center center}
#studentLibrary .stage-shelf-art{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none}
#studentLibrary .stage-shelf-title{
  position:absolute;top:6.6%;left:17%;width:66%;height:11.6%;z-index:2;pointer-events:none;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;text-align:center;
}
#studentLibrary .stage-shelf-title h2{
  color:#493056;font:750 clamp(21px,5.3vw,26px)/1.12 "Songti SC","STSong","Noto Serif CJK SC",serif;
  letter-spacing:2px;text-shadow:0 1px 1px #ffefc5,0 0 5px #fce8bf;
}
#studentLibrary .stage-shelf-title small{
  color:#77523c;font:italic 600 clamp(10px,2.7vw,12px)/1.2 "Snell Roundhand","Apple Chancery","Brush Script MT","URW Chancery L",cursive;
  letter-spacing:1.15px;text-shadow:0 1px 1px #fff0cb;
}
#studentLibrary .stage-shelf-row{position:absolute;left:2.6%;right:2.6%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:end;column-gap:0;min-height:0}
#studentLibrary .stage-shelf-row-1{top:21.5%;height:23.5%}
#studentLibrary .stage-shelf-row-2{top:46.2%;height:24.0%}
#studentLibrary .stage-shelf-row-3{top:71.0%;height:17.4%;left:3.4%;right:3.4%;display:block}
#studentLibrary .stage-book{
  position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:0;
  min-height:0;height:100%;min-width:0;margin:0;padding:0!important;border:0!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;transition:transform .18s ease;
}
#studentLibrary .stage-book:active{transform:translateY(-2px)}
#studentLibrary .stage-shelf-row .stage-book:nth-child(1) .stage-book-art{transform:perspective(440px) rotateY(-5deg) rotateZ(-1.2deg)}
#studentLibrary .stage-shelf-row .stage-book:nth-child(2) .stage-book-art{transform:perspective(440px) rotateY(1deg)}
#studentLibrary .stage-shelf-row .stage-book:nth-child(3) .stage-book-art{transform:perspective(440px) rotateY(5deg) rotateZ(1.2deg)}
#studentLibrary .stage-book-art{display:block;width:112%;min-width:0;height:90%;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 2px 2px #06021275);pointer-events:none}
/* The plaque deliberately overlaps the lower book edge; it is not a floor contact point. */
#studentLibrary .stage-book-caption{position:relative;z-index:3;display:flex;align-items:center;justify-content:center;min-height:0;height:34%;width:101%;flex:none;margin-top:calc(-19% - 5px);transform:translateY(3px);padding:0 5%;color:#442960;background:url("./book_label_ornate_r20.webp") center/100% 100% no-repeat;text-align:center;pointer-events:none}
#studentLibrary .stage-book-caption b{color:#3f2b4d;font:750 clamp(12px,3vw,15px)/1.12 "Songti SC","STSong",serif;text-shadow:0 1px #fdf0cf;white-space:nowrap}
#studentLibrary .stage-tarot-rail{width:100%;height:100%;display:flex;align-items:center;justify-content:flex-start;gap:1px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;touch-action:pan-x;padding:0 1px}
#studentLibrary .stage-tarot-rail::-webkit-scrollbar{display:none}
#studentLibrary .stage-tarot{position:relative;flex:0 0 auto;height:100%;width:auto;aspect-ratio:2/3;max-height:100%;min-height:0;padding:0!important;margin:0;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;scroll-snap-align:center;transform-origin:center bottom;transform:scale(.99);transition:transform .18s ease,filter .18s ease}
#studentLibrary .stage-tarot[data-focus=near]{transform:scale(1.025);z-index:1}
#studentLibrary .stage-tarot[data-focus=center]{transform:scale(1.08) translateY(-1px);z-index:3;filter:drop-shadow(0 0 6px #f1c77855)}
#studentLibrary .stage-tarot[aria-pressed=true]{filter:drop-shadow(0 0 9px #d6aaf6a0)}
#studentLibrary .stage-tarot img{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 2px 2px #130b2780);pointer-events:none}
#studentLibrary .stage-tarot span{position:absolute;top:73.8%;left:0;right:0;width:100%;height:18%;display:flex;align-items:center;justify-content:center;color:#50385b;font:750 clamp(12px,3.35vw,15px)/1.03 "Songti SC","STSong","Noto Serif CJK SC",serif;text-align:center;white-space:nowrap;letter-spacing:.1px;text-shadow:0 1px 1px #fff4d5;pointer-events:none}
#studentLibrary .sl-nav{position:relative;isolation:isolate;z-index:3;display:flex;flex:0 0 104px;min-height:104px;width:100%;margin:0;align-items:center;justify-content:space-around;gap:0;padding:7px 18px 6px;border:0!important;border-radius:0;background:transparent;box-shadow:none}
#studentLibrary .sl-nav::before{content:"";position:absolute;inset:0 5px;z-index:-1;pointer-events:none;border:20px solid transparent;border-image-source:url("./nav_original_r19.webp");border-image-slice:110 145 110 145 fill;border-image-width:29px 27px 28px 27px;border-image-repeat:stretch}
#studentLibrary .sl-nav button{
  position:relative;flex:1 1 25%;min-width:0;max-width:none;min-height:78px;padding:1px 2px 0;border:0;border-radius:0;
  box-shadow:none;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;
  color:#f8deb4;font:600 12px/1.18 "Songti SC","STSong",serif;
}
#studentLibrary .sl-nav button img{flex:none;width:45px;height:45px;object-fit:contain;filter:drop-shadow(0 2px 2px #08041a55)}
#studentLibrary .sl-nav button[aria-current=page]{color:#fff4d4}
#studentLibrary .sl-nav button[aria-current=page]::before{
  content:"";position:absolute;z-index:-1;top:5px;left:23%;right:23%;height:48px;pointer-events:none;
  background:radial-gradient(ellipse at center,#f4c77b66 0%,#b88ad344 42%,transparent 74%);filter:drop-shadow(0 0 7px #f3bf8470);opacity:.85;
}

/* Wordlist: a true full-screen information page, with the full parchment as its own container. */
#studentLibrary[data-view=list] .sl-main{position:absolute;inset:0;width:100%;height:100%;padding:0;overflow:hidden}
#studentLibrary .stage-word-list.sl-list{isolation:isolate;position:absolute;inset:0;display:flex;flex-direction:column;gap:0;width:100%;height:100dvh;min-height:0;margin:0;border:0;border-radius:0;overflow:hidden;padding:calc(env(safe-area-inset-top) + 62px) clamp(46px,11.4vw,52px) calc(env(safe-area-inset-bottom) + 142px);background:transparent;color:var(--ink)}
#studentLibrary .stage-word-list::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background-image:url("./list_fullbleed_r24.webp");background-position:center;background-size:100% 100%;background-repeat:no-repeat}
#studentLibrary .stage-word-list .sl-heading{position:relative;flex:none;display:flex;align-items:center;gap:7px;justify-content:space-between;min-height:51px;padding:0 8px 4px;border-bottom:1px solid #be9d6b80}
#studentLibrary .stage-word-list .sl-heading>button{position:absolute;left:-13px;top:8px;z-index:2;flex:none;min-width:74px;min-height:30px;padding:3px 5px;border:1px solid #d4b889;border-radius:15px;background:#f8e9cbdc;color:#60406f;font:650 12px/1.2 "Songti SC","STSong",serif;text-align:center;box-shadow:0 1px 2px #69452b19}
#studentLibrary .stage-word-list .stage-heading-center{flex:1;min-width:0;text-align:center;display:flex;flex-direction:column;gap:1px;padding:0 8px}
#studentLibrary .stage-word-list .stage-heading-center h2{
  color:#4b2e60;font:750 clamp(17px,4.4vw,21px)/1.2 "Songti SC","STSong","Noto Serif CJK SC",serif;
  white-space:nowrap;text-overflow:ellipsis;overflow:hidden;
}
#studentLibrary .stage-word-list .stage-heading-center small{font-size:11px;color:#785438}
#studentLibrary .stage-word-list .stage-query{isolation:isolate;position:relative;display:flex;flex-direction:column;flex:none;gap:3px;padding:6px 6px 5px;margin:3px -1px 3px;min-height:0}
#studentLibrary .stage-word-list .stage-query::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:url("./filter_panel_ornate_r21.webp") center/100% 100% no-repeat}
#studentLibrary .stage-word-list .sl-query-modes{
  display:flex;gap:0;flex:none;padding:2px;border:1px solid #d5b68c;border-radius:24px;background:#fbebcd;
}
#studentLibrary .stage-word-list .sl-query-modes button{
  flex:1 1 50%;min-width:0;min-height:31px;padding:3px 5px;border:0!important;border-radius:21px;
  color:#593f64;background:transparent!important;box-shadow:none;font:700 13px/1.2 "Songti SC","STSong",serif;
}
#studentLibrary .stage-word-list .sl-query-modes [aria-pressed=true]{
  color:#fef0d6;background:#5e327d url("./tab_t1_on_r19.webp") center/100% 100% no-repeat!important;
  text-shadow:0 1px 2px #2e1739;
}
#studentLibrary .stage-word-list .sl-search{
  display:flex;align-items:center;gap:7px;flex:none;min-height:38px;padding:0 10px;
  border:1px solid #c9a983;border-radius:20px;background:#fff7e8e8;color:#744e89;
  transition:border-color .15s,box-shadow .15s;
}
#studentLibrary .stage-word-list .sl-search:focus-within{border-color:#bf9f74;box-shadow:inset 0 0 0 1px #e6cda1a8}
#studentLibrary .stage-word-list .stage-search-icon{flex:none;font:700 23px/1 Georgia,serif;color:#78509c}
#studentLibrary .stage-word-list .sl-search input{
  flex:1;min-width:0;width:100%;min-height:30px;height:34px;padding:1px 0;border:0!important;border-radius:0;
  outline:0!important;box-shadow:none!important;background:transparent!important;color:#4b342e;
  font:16px/1.4 -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif;appearance:none;
}
#studentLibrary .stage-word-list .sl-search input::-webkit-search-cancel-button{display:none}
#studentLibrary .stage-word-list .stage-filter-core{display:flex;flex-direction:column;gap:2px;padding:2px 0 1px}
#studentLibrary .stage-word-list .stage-filter-line{display:flex;align-items:center;gap:5px;min-height:26px;padding:0 0 1px}
#studentLibrary .stage-word-list .stage-line-name{flex:0 0 55px;white-space:nowrap;color:#693e7c;font:750 11px/1.25 "Songti SC","STSong",serif}
#studentLibrary .stage-word-list .stage-quick-line{flex-wrap:wrap;gap:3px;padding-top:1px}
#studentLibrary .stage-word-list .stage-quick-line .stage-line-name{flex:1 1 100%;}
#studentLibrary .stage-word-list .stage-quick-set{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;width:100%}
#studentLibrary .stage-word-list .stage-quick{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-width:0;min-height:36px;
  padding:2px 1px;border:1px solid #d6b992;border-radius:9px;background:linear-gradient(#fffae9,#f8e5c5);
  color:#5d3f6d;font-size:10px;white-space:nowrap;box-shadow:none;
}
#studentLibrary .stage-word-list .stage-quick>span{font-size:15px;line-height:1;color:#8f62a0}
#studentLibrary .stage-word-list .stage-quick>b{font-weight:650;font-size:clamp(9px,2.3vw,10.5px);line-height:1.15;color:#614765}
#studentLibrary .stage-word-list .stage-quick[aria-pressed=true]{background:linear-gradient(#ead3f3,#f3e1f0);border-color:#9e79b0;box-shadow:inset 0 0 0 1px #c39ccf}
#studentLibrary .stage-word-list .stage-source-set{flex:1;min-width:0;display:flex;align-items:center;gap:3px}
#studentLibrary .stage-word-list .stage-source-set button{
  flex:1;min-width:0;min-height:27px;padding:2px 3px;border:0;border-radius:5px;background:transparent;
  color:#614e40;font-size:clamp(10px,2.45vw,12px);white-space:nowrap;box-shadow:none;
}
#studentLibrary .stage-word-list .stage-source-set button[aria-pressed=true]{color:#623b85;font-weight:750;background:#e6d0edb0}
#studentLibrary .stage-word-list .stage-course-set{display:flex;flex:1;gap:5px;min-width:0}
#studentLibrary .stage-word-list .stage-picker{position:relative;flex:1;min-width:0}
#studentLibrary .stage-word-list .stage-picker-trigger{
  display:flex;align-items:center;justify-content:space-between;gap:3px;width:100%;min-width:0;min-height:28px;
  padding:3px 5px;border:0;border-bottom:1px solid #bda17c;border-radius:0;background:transparent;
  color:#5b4565;font-size:11px;line-height:1.2;text-align:left;white-space:nowrap;box-shadow:none;
}
#studentLibrary .stage-word-list .stage-picker-trigger span{min-width:0;overflow:hidden;text-overflow:ellipsis}
#studentLibrary .stage-word-list .stage-picker-trigger i{flex:none;color:#8b6a8d;font-style:normal;font-size:12px}
#studentLibrary .stage-word-list .stage-picker-trigger:disabled{opacity:.4}
#studentLibrary .stage-word-list .stage-picker-menu{
  position:absolute;z-index:40;top:calc(100% + 3px);left:0;min-width:100%;max-width:min(250px,78vw);max-height:178px;
  overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:4px;
  border:1px solid #c8a575;border-radius:10px;background:#fff0d4;box-shadow:0 5px 15px #2c183b38;touch-action:pan-y;
}
#studentLibrary .stage-word-list .stage-picker-menu[hidden]{display:none!important}
#studentLibrary .stage-word-list .stage-picker-menu button{
  display:block;width:100%;min-height:32px;padding:5px 8px;border:0;border-radius:6px;background:transparent;
  color:#563b60;font-size:12px;text-align:left;white-space:nowrap;box-shadow:none;
}
#studentLibrary .stage-word-list .stage-picker-menu button:active{background:#ead8ed}
#studentLibrary .stage-word-list .stage-advanced{display:block;flex:none;max-height:none;min-height:27px;margin:2px 0 0;padding:0;overflow:visible;border:0;border-top:1px solid #c4a5759c;border-bottom:1px solid #c4a5759c;border-radius:0;background:transparent}
#studentLibrary .stage-word-list .stage-advanced>summary{display:flex;align-items:center;justify-content:center;gap:7px;min-height:27px;padding:3px 5px;cursor:pointer;border:0;border-radius:0;background:transparent;color:#5e3971;font-size:12px;font-weight:750;list-style:none}
#studentLibrary .stage-word-list .stage-advanced>summary::-webkit-details-marker{display:none}
#studentLibrary .stage-word-list .stage-advanced>summary em{font-size:11px;font-style:normal;font-weight:500;color:#80658a}
#studentLibrary .stage-word-list .stage-advanced[open]{max-height:clamp(130px,22dvh,190px);overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;background:transparent;border:0}
#studentLibrary .stage-word-list .stage-filter-body{padding:5px 2px 4px;background:transparent;border:0}
#studentLibrary .stage-word-list .sl-filter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 10px}
#studentLibrary .stage-word-list .sl-filter-grid>label{display:flex;flex-direction:column;min-width:0;gap:1px;color:#5a4540;font-size:10px}
#studentLibrary .stage-word-list .sl-filter-grid .stage-picker-trigger{min-height:27px;font-size:11px}
#studentLibrary .stage-word-list .stage-feature-group{margin:4px 0 2px;padding:0;border:0;border-radius:0}
#studentLibrary .stage-word-list .stage-feature-group legend{padding:0 3px;color:#654579;font-size:10px;font-weight:700}
#studentLibrary .stage-word-list .sl-features{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px 4px;margin:2px 0}
#studentLibrary .stage-word-list .sl-features label{display:flex;align-items:center;gap:3px;min-width:0;min-height:24px;color:#574534;font-size:10px;white-space:nowrap}
#studentLibrary .stage-word-list .sl-features input{width:14px;height:14px;flex:none;margin:0;accent-color:#81579b}
#studentLibrary .stage-word-list .stage-feature-group .stage-picker{max-width:150px;margin-top:3px}
#studentLibrary .stage-word-list .stage-reset{
  display:block;width:auto;min-height:25px;margin:2px auto 0;padding:3px 12px;border:0;border-radius:0;
  color:#624373;background:transparent;font-size:11px;text-decoration:underline;text-underline-offset:3px;box-shadow:none;
}
#studentLibrary .stage-word-list .stage-result-head{
  flex:none;display:flex;align-items:center;justify-content:space-between;gap:4px;min-height:30px;
  padding:2px 0 3px;border-bottom:1px solid #be9d6b9e;color:#4f3463;
}
#studentLibrary .stage-word-list .stage-result-head>b{min-width:0;font-size:clamp(12px,3.2vw,14px);white-space:nowrap}
#studentLibrary .stage-word-list .stage-sort-picker{flex:0 1 112px}
#studentLibrary .stage-word-list .stage-sort-picker .stage-picker-trigger{
  justify-content:flex-end;min-height:27px;padding:2px 0;border:0;background:transparent;color:#6b4d66;font-size:11px;text-align:right;
}
#studentLibrary .stage-word-list .stage-sort-picker .stage-picker-menu{left:auto;right:0;min-width:124px}
#studentLibrary .stage-word-list .stage-result-box{display:flex;position:relative;flex:1 1 auto;min-height:0;min-width:0;overflow:hidden}
#studentLibrary .stage-word-list .sl-results{
  flex:1;min-width:0;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
  scrollbar-width:thin;scrollbar-color:#b596bd #e9d5b6;padding:0 5px 0 0;touch-action:pan-y;
}
#studentLibrary .stage-word-list .sl-results::-webkit-scrollbar{width:3px}
#studentLibrary .stage-word-list .sl-results::-webkit-scrollbar-thumb{background:#9d78b0;border-radius:4px}
#studentLibrary .stage-word-list .stage-scroll-track{position:absolute;top:5px;bottom:4px;right:0;width:3px;background:#a784ac45;border-radius:4px;pointer-events:none}
#studentLibrary .stage-word-list .stage-scroll-track[hidden]{display:none}
#studentLibrary .stage-word-list .stage-scroll-track i{display:block;width:100%;height:24px;border-radius:5px;background:#895baa;transform:translateY(0);transition:transform .08s}
#studentLibrary .stage-word-list .stage-search-prompt{padding:24px 8px;text-align:center;color:#886c72;font-size:12px}
#studentLibrary .stage-word-list .sl-list-record{
  display:flex;align-items:center;gap:3px;min-height:61px;padding:4px 0;border-bottom:1px solid #c8aa7b8f;
}
#studentLibrary .stage-word-list .sl-list-record[hidden]{display:none!important}
#studentLibrary .stage-word-list .sl-list-record.is-selected{background:linear-gradient(90deg,#ead6f2d5,#e7d0e37a 75%,transparent)}
#studentLibrary .stage-word-list .stage-row-number{
  flex:0 0 25px;width:25px;height:26px;display:flex;align-items:center;justify-content:center;
  border:1px solid #d1aa79;border-radius:44% 56% 48% 52%;background:linear-gradient(#ffebc9,#f8dcb5);
  color:#633f72;font:bold 12px Georgia,serif;box-shadow:0 1px 2px #bb926c69;
}
#studentLibrary .stage-word-list .sl-list-record .sl-row{
  flex:1;min-width:0;display:flex;align-items:center;gap:5px;width:100%;min-height:50px;padding:2px 0;
  border:0;border-radius:0;background:transparent;color:#483329;text-align:left;box-shadow:none;
}
#studentLibrary .stage-word-list .sl-list-record .sl-row>.stage-word-main{display:flex;flex:0 0 39%;min-width:0;flex-direction:column;gap:3px}
#studentLibrary .stage-word-list .stage-word-main>b{
  color:#43275d;font:750 clamp(17px,4vw,19px)/1.08 Georgia,"Times New Roman",serif;
  overflow-wrap:anywhere;word-break:normal;
}
#studentLibrary .stage-word-list .sl-row-ipa{display:block;min-width:0;color:#74565b;font:11.5px/1.2 -apple-system,"Arial Unicode MS","Noto Sans",sans-serif;overflow-wrap:anywhere}
#studentLibrary .stage-word-list .sl-list-record .sl-row>.stage-word-detail{display:flex;flex:1 1 0;min-width:0;flex-direction:column;gap:3px}
#studentLibrary .stage-word-list .stage-word-meaning{color:#49352d;font:12px/1.25 -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif;overflow-wrap:anywhere}
#studentLibrary .stage-word-list .stage-word-sub{display:flex;align-items:center;flex-wrap:wrap;gap:2px 4px;min-width:0}
#studentLibrary .stage-word-list .stage-status{padding:2px 4px;border-radius:9px;background:#e5d5ec;color:#5f4671;font:10px/1.2 -apple-system,"PingFang SC",sans-serif;font-style:normal;white-space:nowrap}
#studentLibrary .stage-word-list .stage-status.wrong{background:#f6d0d7;color:#9b4150}
#studentLibrary .stage-word-list .stage-status.mastered{background:#d4e9ce;color:#3f794d}
#studentLibrary .stage-word-list .stage-word-sub small{color:#6f573c;font:10px/1.25 -apple-system,"PingFang SC",sans-serif;white-space:nowrap}
#studentLibrary .stage-word-list .stage-knowledge-icons{display:inline-flex;align-items:center;gap:1px;white-space:nowrap;color:#996bab;line-height:1}
#studentLibrary .stage-word-list .stage-knowledge-icons svg{display:inline-block;width:12px;height:12px;fill:currentColor;stroke:currentColor}
#studentLibrary .stage-word-list .stage-knowledge-icons svg:nth-child(2){fill:none}
#studentLibrary .stage-word-list .sl-row-speak{
  flex:0 0 28px;display:flex;align-items:center;justify-content:center;width:28px;min-width:28px;min-height:35px;
  padding:0;border:0!important;background:transparent!important;color:#8361aa;box-shadow:none!important;
}
#studentLibrary .stage-word-list .sl-row-speak svg{width:20px;height:20px;pointer-events:none}
#studentLibrary .stage-word-list .stage-row-chevron{flex:0 0 10px;min-width:10px;min-height:30px;padding:0;border:0;background:transparent;color:#8757a2;font-size:23px;line-height:1;box-shadow:none}
#studentLibrary .stage-word-list .sl-empty{padding:16px 5px;color:#806044;font-size:12px;text-align:center}

#studentLibrary .stage-query[data-mode="search"] .stage-filter-core,
#studentLibrary .stage-query[data-mode="search"] .stage-advanced{display:none!important}
#studentLibrary .stage-query[data-mode="search"]{padding-bottom:10px}
/* A compact viewport never scrolls as a page; only result, tarot rail and an open picker can scroll. */

#studentLibrary[data-view=list] .sl-brand,#studentLibrary[data-view=list] .sl-nav{display:none!important}
#studentLibrary[data-view=list]{padding:0}
#studentLibrary .stage-shelf-title{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px}
#studentLibrary .stage-shelf-title h2{font-size:clamp(24px,5.8vw,28px);letter-spacing:2px}
#studentLibrary .stage-shelf-title small{display:block;color:#77523c;font:italic 650 clamp(11px,2.9vw,13px)/1.15 "Snell Roundhand","Apple Chancery","Brush Script MT","URW Chancery L",cursive;letter-spacing:1.1px;text-shadow:0 1px 1px #fff0cb}
#studentLibrary .stage-shelf-row .stage-book:nth-child(1) .stage-book-art{transform:perspective(440px) rotateY(-5deg) rotateZ(-1.2deg)}
#studentLibrary .stage-shelf-row .stage-book:nth-child(2) .stage-book-art{transform:perspective(440px) rotateY(1deg)}
#studentLibrary .stage-shelf-row .stage-book:nth-child(3) .stage-book-art{transform:perspective(440px) rotateY(5deg) rotateZ(1.2deg)}
#studentLibrary .stage-word-list .stage-filter-core .stage-course-line:has(.stage-picker[data-disabled="true"]){display:none!important}
#studentLibrary .stage-word-list .sl-heading>button:focus,#studentLibrary .stage-word-list .sl-search input:focus{outline:0!important;box-shadow:none!important}
#studentLibrary .stage-word-list .stage-advanced[open] .stage-rule-line{padding:5px 0 3px;margin:0 0 5px;border-bottom:1px solid #c4a57570}
#studentLibrary .stage-word-list .sl-results{padding-bottom:4px;scroll-padding-bottom:6px}
@media(max-height:780px){
 #studentLibrary .sl-brand.mw-scene-brand{flex-basis:72px;min-height:72px}
 #studentLibrary .sl-brand.mw-scene-brand::before{height:66px}
 #studentLibrary .sl-nav{flex-basis:84px;min-height:84px;padding:4px 14px}
 #studentLibrary .sl-nav button{min-height:70px;font-size:11px}
 #studentLibrary .sl-nav button img{width:39px;height:39px}
 #studentLibrary .stage-shelf-frame{transform:translateY(0) scale(1.05)}
 #studentLibrary .stage-word-list.sl-list{padding-top:calc(env(safe-area-inset-top) + 54px);padding-bottom:calc(env(safe-area-inset-bottom) + 132px)}
 #studentLibrary .stage-word-list .stage-query{margin:2px -1px 2px;padding:4px 5px}
 #studentLibrary .stage-word-list .stage-quick{min-height:29px}
 #studentLibrary .stage-word-list .stage-quick>b{font-size:9px}
 #studentLibrary .stage-word-list .stage-quick>span{font-size:12px}
 #studentLibrary .stage-word-list .sl-query-modes button{min-height:29px}
 #studentLibrary .stage-word-list .sl-search{min-height:35px}
 #studentLibrary .stage-word-list .sl-search input{min-height:33px;height:33px}
 #studentLibrary .stage-word-list .stage-filter-line{min-height:24px}
 #studentLibrary .stage-word-list .stage-advanced,#studentLibrary .stage-word-list .stage-advanced>summary{min-height:24px}
 #studentLibrary .stage-word-list .stage-result-head{min-height:31px}
 #studentLibrary .stage-word-list .sl-list-record{min-height:54px;padding:3px 0}
}
@media(max-width:390px){
 #studentLibrary .stage-word-list.sl-list{padding-left:43px;padding-right:43px}
 #studentLibrary .stage-word-list .stage-line-name{flex-basis:51px;font-size:10px}
 #studentLibrary .stage-word-list .stage-quick>b{font-size:8px}
 #studentLibrary .stage-word-list .sl-list-record{gap:2px}
 #studentLibrary .stage-word-list .stage-row-number{flex-basis:23px;width:23px;height:24px;font-size:11px}
}
@media(prefers-reduced-motion:reduce){#studentLibrary .stage-book,#studentLibrary .stage-tarot{transition:none!important}}

/* R24 final: five complete cards in the rail; no sixth clipped fragment. */
#studentLibrary .stage-tarot-rail{gap:0;scrollbar-width:none}
#studentLibrary .stage-tarot{flex:0 0 20%;width:20%;height:100%;aspect-ratio:auto;max-height:100%}
#studentLibrary .stage-tarot img{object-fit:contain}
/* One-screen reading: the result list may scroll, the page never does. */
#studentLibrary .stage-word-list.sl-list{padding-bottom:calc(env(safe-area-inset-bottom) + 155px)}
@media(max-height:780px){#studentLibrary .stage-word-list.sl-list{padding-bottom:calc(env(safe-area-inset-bottom) + 142px)}}
#studentLibrary .stage-word-list .sl-list-record{flex:none;min-height:61px;height:61px;overflow:hidden}
#studentLibrary .stage-word-list .stage-word-main>b,#studentLibrary .stage-word-list .stage-word-meaning{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#studentLibrary .stage-word-list .stage-word-main>b{line-height:1.15}
#studentLibrary .stage-word-list .sl-results{scrollbar-width:none}
#studentLibrary .stage-word-list .sl-results::-webkit-scrollbar{display:none}
/* A readable focus ring for keyboard navigation, without the ugly native input box. */
#studentLibrary .stage-word-list input:focus{outline:0!important}
#studentLibrary .stage-word-list .sl-search:focus-within{border-color:#bfa278;box-shadow:inset 0 0 0 1px #cba66f55}
@media(prefers-reduced-motion:reduce){#studentLibrary .stage-tarot{transition:none!important}}

/* R24.2 shelf correction — the wood columns, not their outer floral decorations, meet the viewport edges. */
#studentLibrary .stage-shelf-row-1,#studentLibrary .stage-shelf-row-2{left:5%;right:5%;}
#studentLibrary .stage-shelf-row-3{left:6.4%;right:6.4%;}
#studentLibrary .stage-book-art{width:110%;}
#studentLibrary .stage-book-caption{width:100%;}
#studentLibrary .stage-tarot span{font-weight:600;font-size:clamp(10px,2.9vw,13px);}

/* R24.3: tighter original four-object navigation, with larger independent icons.
   Keep the original gold border asset, active glow and labels; do not scale the entire navbar. */
#studentLibrary[data-view=shelf] .sl-nav{
  flex:0 0 92px;
  min-height:92px;
  padding:4px 17px 4px;
}
#studentLibrary[data-view=shelf] .sl-nav::before{
  border-image-width:25px 25px 24px 25px;
}
#studentLibrary[data-view=shelf] .sl-nav button{
  min-height:77px;
  gap:0;
  padding:0 2px;
  font-size:12.5px;
  line-height:1.12;
}
#studentLibrary[data-view=shelf] .sl-nav button img{
  width:54px;
  height:54px;
}
#studentLibrary[data-view=shelf] .sl-nav button[aria-current=page]::before{
  top:3px;
  left:20%;right:20%;height:54px;
}
@media(max-height:780px){
  #studentLibrary[data-view=shelf] .sl-nav{flex-basis:76px;min-height:76px;padding:3px 12px 3px}
  #studentLibrary[data-view=shelf] .sl-nav::before{border-image-width:22px 22px 20px 22px}
  #studentLibrary[data-view=shelf] .sl-nav button{min-height:67px;font-size:11.5px}
  #studentLibrary[data-view=shelf] .sl-nav button img{width:45px;height:45px}
  #studentLibrary[data-view=shelf] .sl-nav button[aria-current=page]::before{top:1px;height:45px}
}

/* R24.4: navigation anchor close to (never across) the bottom safe area.
   Never add an intermediate floating gap or stretch the original gold frame.
   The main shelf retains its 105% centered transform; books/cards unchanged. */
#studentLibrary[data-view=shelf] .sl-nav{
  flex-basis:88px;
  min-height:88px;
  margin-bottom:calc(-1 * min(7px, env(safe-area-inset-bottom, 0px)));
  padding:2px 15px 0;
}
#studentLibrary[data-view=shelf] .sl-nav::before{
  inset:-1px 4px -2px;
  border-image-width:24px 24px 22px 24px;
}
#studentLibrary[data-view=shelf] .sl-nav button{
  min-height:75px;
  gap:0;
  padding:0 2px;
  font-size:12.5px;
}
#studentLibrary[data-view=shelf] .sl-nav button img{
  width:56px;
  height:56px;
}
#studentLibrary[data-view=shelf] .sl-nav button[aria-current=page]::before{
  top:0;height:56px;
}
@media (max-height:780px){
  #studentLibrary[data-view=shelf] .sl-nav{flex-basis:74px;min-height:74px;padding:1px 12px 0;margin-bottom:calc(-1 * min(5px, env(safe-area-inset-bottom, 0px)))}
  #studentLibrary[data-view=shelf] .sl-nav::before{inset:-1px 3px -2px;border-image-width:21px 21px 19px 21px}
  #studentLibrary[data-view=shelf] .sl-nav button{min-height:66px;font-size:11.5px}
  #studentLibrary[data-view=shelf] .sl-nav button img{width:47px;height:47px}
  #studentLibrary[data-view=shelf] .sl-nav button[aria-current=page]::before{top:0;height:47px}
}
