/* V23 RuleScroll: preferred rule assets + shared information background. */
#studentLibrary[data-view="rule"]{
  --rule-ink:#533f56;--rule-purple:#66507d;--rule-gold:#b9884c;
  background:#1a0f4f url('starfield_bg.webp') center/cover no-repeat;
  color:#f5e4b8;position:fixed;inset:0;display:flex;flex-direction:column;
  height:100dvh;overflow:hidden;padding:env(safe-area-inset-top) 0 calc(10px + env(safe-area-inset-bottom));
}
#studentLibrary[data-view="rule"]::after{
  content:"";position:absolute;inset:calc(env(safe-area-inset-top) + 5px) 9px calc(env(safe-area-inset-bottom) + 7px);
  border:1px solid rgba(224,190,122,.68);border-radius:29px;pointer-events:none;z-index:0;
}
#studentLibrary[data-view="rule"] .sl-brand{z-index:2;flex:none;min-height:70px;padding:7px 70px 4px;text-align:center;display:flex!important;flex-direction:column;justify-content:center;border:0;background:transparent;color:#f1d798}
#studentLibrary[data-view="rule"] .sl-brand>b{font:700 clamp(18px,5.3vw,23px)/1.05 Georgia,'Songti SC','STSong',serif;letter-spacing:3px;text-shadow:0 1px 0 #5b3a39,0 0 10px #d8a95b55;white-space:nowrap}
#studentLibrary[data-view="rule"] .sl-brand>small{margin-top:5px;font:600 clamp(7px,2vw,9px)/1 Georgia,serif;letter-spacing:3.1px;white-space:nowrap;color:#e3cfaa}
#studentLibrary[data-view="rule"] .sl-main{z-index:2;flex:1;min-height:0;overflow:hidden;padding:0 13px 7px}
#studentLibrary[data-view="rule"] .v23-rule-page{height:100%;min-height:0;display:flex;flex-direction:column;gap:5px}
#studentLibrary[data-view="rule"] .v23-rule-top{display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:8px;align-items:center;flex:none;padding:0 5px}
#studentLibrary[data-view="rule"] .v23-rule-back{width:40px;height:40px;border-radius:50%;border:1px solid #d8b96f;background:linear-gradient(145deg,#4c2d73,#281946);color:#f7df9b;display:grid;place-items:center;font-size:27px;box-shadow:inset 0 0 0 2px #d5ae5e35,0 3px 10px #09051a88}
#studentLibrary[data-view="rule"] .v23-rule-heading{min-width:0;text-align:center}
#studentLibrary[data-view="rule"] .v23-rule-heading h2{margin:0;color:#f3dcaa;font:700 16px/1.15 Georgia,'Songti SC','STSong',serif;letter-spacing:1px}
#studentLibrary[data-view="rule"] .v23-rule-heading small{display:block;margin-top:3px;color:#cdbbca;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#studentLibrary[data-view="rule"] .v23-rule-kind{min-width:45px;max-width:66px;padding:5px 7px;border:1px solid #c5a368;border-radius:10px;background:#f1dfb9;color:#5d4568;font:700 10px/1.1 'Songti SC','STSong',serif;text-align:center;box-shadow:inset 0 0 0 1px #fff7d780}
#studentLibrary[data-view="rule"] .v23-scroll-stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden}
#studentLibrary[data-view="rule"] .v23-scroll{position:relative;flex:none;width:min(94vw,430px,calc((100dvh - 154px) * .5628));aspect-ratio:941/1672;background:url('rule_scroll_tall_v23.webp') center/contain no-repeat;filter:drop-shadow(0 8px 11px #08031978)}
#studentLibrary[data-view="rule"] .v23-scroll-content{position:absolute;left:15.7%;right:15.2%;top:10.3%;bottom:10.8%;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none;padding:7px 4px 13px;color:var(--rule-ink);text-align:left}
#studentLibrary[data-view="rule"] .v23-scroll-content::-webkit-scrollbar{display:none}
#studentLibrary[data-view="rule"] .v23-rule-title{text-align:center;margin:0;color:#47324e;font:700 clamp(25px,7.6vw,35px)/1.05 Georgia,'Times New Roman','Songti SC',serif;overflow-wrap:anywhere}
#studentLibrary[data-view="rule"] .v23-rule-subtitle{text-align:center;margin:5px 0 10px;color:#8a6c72;font:600 11px/1.25 Georgia,'Songti SC',serif;letter-spacing:.7px}
#studentLibrary[data-view="rule"] .v23-rule-divider{height:14px;margin:2px 14% 7px;position:relative}
#studentLibrary[data-view="rule"] .v23-rule-divider::before{content:"";position:absolute;left:0;right:0;top:50%;height:1px;background:linear-gradient(90deg,transparent,#b88950,#b88950,transparent)}
#studentLibrary[data-view="rule"] .v23-rule-divider::after{content:"✦";position:absolute;left:50%;top:50%;transform:translate(-50%,-54%);background:#f4dfbc;padding:0 7px;color:#a87b42;font-size:9px}
#studentLibrary[data-view="rule"] .v23-rule-lead{margin:0 0 11px;text-align:center;color:#4c3852;font:700 clamp(15px,4.2vw,18px)/1.55 Georgia,'Songti SC','STSong',serif;white-space:pre-wrap}
#studentLibrary[data-view="rule"] .v23-rule-section{margin:9px 0 0}
#studentLibrary[data-view="rule"] .v23-rule-section h3{margin:0 0 5px;color:#6c4f65;font:700 12px/1.2 Georgia,'Songti SC','STSong',serif;letter-spacing:.4px}
#studentLibrary[data-view="rule"] .v23-rule-caution{margin:10px 0 0;padding:8px 10px;border:1px solid #c9a875;border-radius:9px;background:linear-gradient(135deg,#f1ddc5cc,#e3d4e7c4);color:#6a4e64;font-size:12px;line-height:1.55}
#studentLibrary[data-view="rule"] .v23-rule-caution b{color:#8e663e;margin-right:4px}
#studentLibrary[data-view="rule"] .v23-example-list{display:flex;flex-wrap:wrap;justify-content:center;gap:5px;margin:0;padding:0;list-style:none}
#studentLibrary[data-view="rule"] .v23-example-list li{padding:5px 8px;border:1px solid #c7a16f;border-radius:10px;background:#fff5dcb8;color:#5e4661;font:700 12px/1.1 Georgia,'Times New Roman',serif}
#studentLibrary[data-view="rule"] .v23-linked{display:grid;gap:5px}
#studentLibrary[data-view="rule"] .v23-linked button{width:100%;min-height:37px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:5px 9px;border:1px solid #c5a16d;border-radius:9px;background:#fff6dfba;color:#5b425e;text-align:left}
#studentLibrary[data-view="rule"] .v23-linked button b{font:700 14px/1.15 Georgia,'Times New Roman',serif}
#studentLibrary[data-view="rule"] .v23-linked button small{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#866b75;font-size:10px}
#studentLibrary[data-view="rule"] .v23-rule-empty{margin:0;color:#8c737d;font-size:11px;line-height:1.45}
#studentLibrary[data-view="rule"] .v23-rule-foot{margin:13px 0 0;text-align:center;color:#9a7d7f;font-size:10px;line-height:1.35}
#studentLibrary[data-view="rule"] [hidden]{display:none!important}
@media (max-height:760px){
  #studentLibrary[data-view="rule"] .sl-brand{min-height:55px;padding-top:4px;padding-bottom:1px}
  #studentLibrary[data-view="rule"] .sl-brand>small{margin-top:3px}
  #studentLibrary[data-view="rule"] .sl-main{padding-bottom:2px}
  #studentLibrary[data-view="rule"] .v23-rule-top{grid-template-columns:38px minmax(0,1fr) auto;gap:6px}
  #studentLibrary[data-view="rule"] .v23-rule-back{width:37px;height:37px;font-size:25px}
  #studentLibrary[data-view="rule"] .v23-scroll{width:min(93vw,395px,calc((100dvh - 118px) * .6667));aspect-ratio:2/3;background-image:url('rule_scroll_short_v23.webp')}
  #studentLibrary[data-view="rule"] .v23-scroll-content{left:15.6%;right:15.5%;top:11.2%;bottom:10.2%;padding-top:5px}
  #studentLibrary[data-view="rule"] .v23-rule-title{font-size:clamp(22px,7vw,30px)}
  #studentLibrary[data-view="rule"] .v23-rule-lead{font-size:clamp(14px,3.9vw,17px);margin-bottom:8px}
  #studentLibrary[data-view="rule"] .v23-rule-section{margin-top:7px}
}
@media (max-width:350px){
  #studentLibrary[data-view="rule"] .sl-main{padding-left:8px;padding-right:8px}
  #studentLibrary[data-view="rule"] .v23-rule-kind{display:none}
  #studentLibrary[data-view="rule"] .v23-rule-top{grid-template-columns:38px minmax(0,1fr) 38px}
}
