@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2) format("woff2"),url(/assets/KaTeX_Size2-Regular-oD1tc_U0.woff) format("woff"),url(/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(/assets/KaTeX_Size3-Regular-CTq5MqoE.woff) format("woff"),url(/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2) format("woff2"),url(/assets/KaTeX_Size4-Regular-BF-4gkZK.woff) format("woff"),url(/assets/KaTeX_Size4-Regular-DWFBv043.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2) format("woff2"),url(/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff) format("woff"),url(/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf) format("truetype")}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;position:relative;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.17.0"}.katex .katex-mathml{border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .smash{display:inline;line-height:0}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}
:root {
  color: #132033;
  background: #eef2f7;
  font-family:
    "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

/* Final notebook workbench: restored from the optimized server flow. */
.notebook-workbench {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: var(--notebook-nav-width, 140px) 8px var(--note-list-width, 180px) 8px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  background: #eef2f7;
  overflow: hidden;
}

.notebook-workbench.nav-collapsed {
  grid-template-columns: 40px 0 var(--note-list-width, 180px) 8px minmax(0, 1fr);
}

.notebook-workbench.notes-collapsed {
  grid-template-columns: var(--notebook-nav-width, 140px) 8px 40px 0 minmax(0, 1fr);
}

.notebook-workbench.nav-collapsed.notes-collapsed {
  grid-template-columns: 40px 0 40px 0 minmax(0, 1fr);
}

.notebook-nav-pane,
.notebook-workbench .note-list-pane,
.notebook-workbench .note-editor-pane {
  min-width: 0;
  min-height: 0;
  background: #ffffff;
  border-right: 1px solid #d7e0eb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notebook-workbench .note-editor-pane {
  border-right: 0;
  background: #f4f7fb;
}

.notebook-column-resizer {
  min-width: 0;
  cursor: col-resize;
  background: linear-gradient(90deg, transparent, #d7e0eb, transparent);
  position: relative;
  z-index: 2;
}

.notebook-column-resizer::after {
  content: "";
  position: absolute;
  inset: 0 2px;
  border-radius: 999px;
}

.notebook-column-resizer:hover::after,
.notebook-column-resizer:focus-visible::after,
.notebook-column-resizing .notebook-column-resizer::after {
  background: #2563eb;
}

.notebook-workbench.nav-collapsed .notebook-nav-resizer,
.notebook-workbench.notes-collapsed .note-list-resizer {
  display: none;
}

.notebook-column-resizing {
  cursor: col-resize;
  user-select: none;
}

.notebook-nav-pane > header,
.notebook-workbench .note-list-pane > header,
.notebook-workbench .note-editor-pane > header {
  min-height: 58px;
  padding: 10px 12px;
  border-bottom: 1px solid #d7e0eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notebook-nav-pane h2,
.notebook-workbench .note-list-pane h2,
.notebook-workbench .note-editor-pane h2 {
  margin: 0;
  font-size: 16px;
}

.notebook-nav-pane p,
.notebook-workbench .note-list-pane p,
.notebook-workbench .note-editor-pane p {
  margin: 2px 0 0;
  color: #667085;
  font-size: 12px;
}

.pane-collapsed-button {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  color: #475467;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 8px;
  padding: 15px 0;
}

.pane-collapsed-button span {
  writing-mode: vertical-rl;
  letter-spacing: 0;
  font-weight: 800;
}

.new-notebook-area,
.note-list-actions {
  padding: 8px;
  border-bottom: 1px solid #d7e0eb;
}

.notebook-workbench .new-notebook-button,
.note-list-actions button {
  width: 100%;
  justify-content: center;
}

.notebook-workbench .notebook-list,
.notebook-workbench .note-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px;
}

.notebook-row,
.note-row {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-items: stretch;
}

.notebook-row {
  grid-template-columns: minmax(0, 1fr) 32px;
}

.note-row {
  grid-template-columns: minmax(0, 1fr) 32px;
}

.notebook-row .inline-rename-form,
.note-row .inline-rename-form {
  grid-column: 1 / -1;
}

.notebook-workbench .notebook-item,
.notebook-workbench .note-card {
  width: 100%;
  min-width: 0;
  text-align: left;
  border-radius: 8px;
  background: #f8fbff;
  display: grid;
  gap: 5px;
  align-content: center;
  justify-items: start;
  padding: 8px;
}

.notebook-workbench .notebook-item {
  align-items: center;
}

.notebook-workbench .notebook-item.active,
.notebook-workbench .note-card.active {
  border-color: #2563eb;
  background: #edf4ff;
}

.notebook-workbench .notebook-item span,
.notebook-workbench .note-card strong,
.notebook-workbench .note-card span,
.notebook-workbench .note-card small {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notebook-workbench .notebook-item span,
.notebook-workbench .note-card strong {
  font-weight: 800;
  white-space: nowrap;
}

.notebook-workbench .note-card span {
  color: #475467;
  font-size: 13px;
  white-space: nowrap;
}

.notebook-workbench .note-card small {
  color: #1d4ed8;
  font-size: 12px;
}

.row-icon-button {
  width: 30px;
  min-width: 30px;
  padding: 0;
}

.row-actions {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.notebook-row-actions {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notebook-row-actions .row-icon-button {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.danger-icon-button {
  color: #b42318;
  border-color: #f4b8b1;
  background: #fff7f6;
}

.inline-rename-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
}

.inline-rename-form input,
.note-title-input {
  min-width: 0;
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  color: #132033;
  background: #ffffff;
  outline: none;
  font: inherit;
}

.inline-rename-form input {
  min-height: 36px;
  padding: 0 9px;
}

.notebook-workbench .note-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notebook-workbench .word-editor-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
  padding: 12px;
  overflow: hidden;
}

.note-title-input {
  min-height: 44px;
  border-radius: 8px 8px 0 0;
  border-bottom: 0;
  padding: 0 13px;
  font-size: 18px;
  font-weight: 800;
}

.notebook-workbench .word-toolbar {
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px;
  border: 1px solid #d7e0eb;
  border-bottom: 0;
  border-radius: 0;
  background: #fbfdff;
}

.notebook-workbench .word-toolbar button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 7px;
}

.formula-toolbar {
  position: relative;
}

.notebook-workbench .word-toolbar .formula-toolbar > button {
  width: auto;
  min-width: 48px;
  padding: 0 8px;
  font-family: "Cambria Math", "Times New Roman", serif;
  font-weight: 800;
}

.notebook-workbench .word-toolbar .formula-toolbar > button.active {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
}

.formula-palette {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: min(520px, 84vw);
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
}

.formula-palette section {
  display: grid;
  gap: 7px;
}

.formula-palette strong {
  color: #132033;
  font-size: 12px;
}

.formula-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.formula-editor-row input {
  min-width: 0;
  min-height: 34px;
  border: 1px solid #c7d3e4;
  border-radius: 7px;
  padding: 0 9px;
  color: #132033;
  font-family: "Cambria Math", "Times New Roman", serif;
  outline: none;
}

.formula-editor-row input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.word-toolbar .formula-editor-row button,
.notebook-workbench .word-toolbar .formula-editor-row button {
  width: auto;
  min-width: 72px;
  padding: 0 10px;
  border-color: #2563eb;
  color: #ffffff;
  background: #2563eb;
  font-weight: 800;
}

.formula-symbol-grid,
.formula-template-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.notebook-workbench .word-toolbar .formula-symbol-grid button,
.notebook-workbench .word-toolbar .formula-template-grid button {
  width: auto;
  min-width: 34px;
  min-height: 32px;
  padding: 0 9px;
  font-size: 14px;
}

.notebook-workbench .word-toolbar .formula-symbol-grid button {
  font-family: "Cambria Math", "Times New Roman", serif;
  font-size: 17px;
}

.font-size-control {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid #d7e0eb;
  border-radius: 7px;
  background: #ffffff;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.font-size-control select {
  height: 28px;
  min-width: 72px;
  border: 0;
  background: transparent;
  color: #132033;
  font: inherit;
  outline: none;
}

.font-family-control select {
  min-width: 96px;
  max-width: 132px;
}

.color-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-left: 4px;
  border-left: 1px solid #d7e0eb;
}

.color-swatch-button span {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.18);
}

.image-size-control {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border: 1px solid #d7e0eb;
  border-radius: 7px;
  background: #ffffff;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.image-size-control input[type="range"] {
  width: 128px;
  accent-color: #2563eb;
}

.image-size-value {
  min-width: 36px;
  text-align: right;
}

.note-image-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.selected-image-tools {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.notebook-workbench .word-toolbar .delete-selected-image-button {
  color: #dc2626;
  border-color: #fecaca;
  background: #fff7f7;
}

.notebook-workbench .word-toolbar .delete-selected-image-button:hover {
  border-color: #f87171;
  background: #fef2f2;
}

.toolbar-hint {
  margin-left: auto;
  color: #667085;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.notebook-workbench .word-editor-surface {
  min-height: 0;
  overflow: auto;
  border: 1px solid #d7e0eb;
  border-radius: 0 0 8px 8px;
  background: #ffffff;
  padding: 30px 36px 72px;
  color: #111827;
  font-size: 16px;
  line-height: 1.75;
  outline: none;
}

.note-inline-image {
  margin: 6px 0 8px;
  display: grid;
  gap: 5px;
  width: fit-content;
  max-width: min(100%, 680px);
  vertical-align: top;
}

.note-inline-image img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid #d7e0eb;
  border-radius: 8px;
}

.note-inline-image.selected {
  outline: 2px solid #2563eb;
  outline-offset: 4px;
  border-radius: 8px;
}

.note-inline-image figcaption {
  color: #667085;
  font-size: 12px;
}

.note-formula,
.word-editor-surface math,
.note-readonly-body math {
  display: inline-block;
  max-width: 100%;
  margin: 4px 4px 8px 0;
  padding: 2px 4px;
  overflow-x: auto;
  color: #0f172a;
  font-family: "Cambria Math", "Times New Roman", serif;
  line-height: 1.45;
  vertical-align: middle;
}

.note-formula-text {
  white-space: pre-wrap;
  font-family: "Cambria Math", "Times New Roman", serif;
}

.note-formula-image {
  display: inline-block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.word-editor-surface [data-note-image-caret-block] {
  min-height: 32px;
  margin: 2px 0 8px;
  padding: 4px 0;
  line-height: 1.45;
  cursor: text;
}

.web-reader-shell:has(.notebook-workbench) .workspace,
.web-reader-shell:has(.notebook-workbench).article-pane-collapsed .workspace,
.web-reader-shell:has(.notebook-workbench).memory-pane-collapsed .workspace,
.web-reader-shell:has(.notebook-workbench).article-pane-collapsed.memory-pane-collapsed .workspace,
.web-reader-shell:has(.notebook-workbench).immersive-mode .workspace {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 760px) {
  .web-reader-shell:has(.notebook-workbench) {
    height: 100dvh;
  }

  .web-reader-shell:has(.notebook-workbench) .top-panel {
    display: block;
  }

  .notebook-workbench,
  .notebook-workbench.nav-collapsed,
  .notebook-workbench.notes-collapsed,
  .notebook-workbench.nav-collapsed.notes-collapsed {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    background: #ffffff;
  }

  .notebook-nav-pane,
  .notebook-workbench .note-list-pane {
    min-height: 66px;
    max-height: 118px;
    border-right: 0;
    border-bottom: 1px solid #d7e0eb;
  }

  .notebook-nav-pane > header,
  .notebook-workbench .note-list-pane > header {
    display: none;
  }

  .notebook-workbench.nav-collapsed .notebook-nav-pane,
  .notebook-workbench.notes-collapsed .note-list-pane {
    max-height: 40px;
  }

  .pane-collapsed-button {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .pane-collapsed-button span {
    writing-mode: horizontal-tb;
  }

  .new-notebook-area,
  .note-list-actions {
    padding: 6px 8px;
  }

  .notebook-workbench .notebook-list,
  .notebook-workbench .note-list {
    display: flex;
    overflow-x: auto;
    padding: 6px 8px 8px;
  }

  .notebook-row,
  .note-row {
    flex: 0 0 180px;
  }

  .notebook-workbench .note-editor-pane > header {
    min-height: 50px;
    padding: 8px 10px;
  }

  .notebook-workbench .note-editor-actions {
    gap: 6px;
  }

  .notebook-workbench .word-editor-pane {
    padding: 8px;
  }

  .note-title-input {
    min-height: 40px;
    font-size: 16px;
  }

  .notebook-workbench .word-toolbar {
    max-height: 86px;
    overflow-y: auto;
  }

  .toolbar-hint {
    display: none;
  }

  .notebook-workbench .word-editor-surface {
    padding: 20px 18px 48px;
    font-size: 15px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid #c7d3e4;
  background: #ffffff;
  color: #132033;
  border-radius: 7px;
  min-height: 34px;
  padding: 7px 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

button:hover:not(:disabled) {
  background: #f5f8fc;
}

button:disabled {
  color: #98a2b3;
  cursor: not-allowed;
}

.web-reader-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #eef2f7;
  overflow: hidden;
}

.web-reader-shell.immersive-mode {
  grid-template-rows: minmax(0, 1fr);
}

.web-reader-shell.immersive-mode .top-panel {
  display: none;
}

.top-panel {
  background: #ffffff;
  border-bottom: 1px solid #d7e0eb;
  z-index: 2;
}

.hero-strip {
  min-height: 64px;
  background: linear-gradient(135deg, #3b6df0, #2351dc);
  color: #ffffff;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto auto auto;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.reader-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #40bf8b;
  display: grid;
  place-items: center;
  cursor: pointer;
  outline: none;
}

.reader-icon:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5), 0 0 0 5px rgba(20, 184, 166, 0.5);
}

.brand-block h1 {
  margin: 0 0 2px;
  font-size: 18px;
  letter-spacing: 0;
}

.brand-block p,
.hero-metrics span {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, 1fr));
  gap: 10px;
}

.hero-metrics div {
  border-left: 1px solid rgba(255, 255, 255, 0.24);
  padding-left: 12px;
}

.hero-metrics strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.hero-metrics small {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  line-height: 1.1;
}

.scan-button {
  background: #af72dc;
  border-color: #af72dc;
  color: #ffffff;
  min-width: 78px;
  min-height: 36px;
  box-shadow: none;
}

.add-button {
  background: #14b8a6;
  border-color: #14b8a6;
  color: #ffffff;
  justify-self: end;
  width: auto;
  min-width: 92px;
  min-height: 36px;
  white-space: nowrap;
}

.offline-update-button {
  background: #0f766e;
  border-color: #0f766e;
}

.offline-update-button:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.offline-update-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.offline-update-actions .add-button {
  justify-self: auto;
}

.offline-archive-button {
  width: 38px;
  height: 36px;
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(15, 118, 110, 0.86);
  color: #ffffff;
}

.offline-archive-button:hover:not(:disabled) {
  background: #0f766e;
}

.offline-update-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  padding: 8px 14px 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
  background: #f8fafc;
  color: #334155;
}

.offline-update-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.offline-update-progress-head strong,
.offline-update-progress-head span {
  color: #0f766e;
  font-weight: 800;
}

.offline-update-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ccfbf1;
}

.offline-update-progress-track span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: #0f766e;
  transition: width 180ms ease;
}

.offline-update-progress p {
  margin: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offline-update-warning {
  padding: 6px 8px;
  border: 1px solid #fde68a;
  border-radius: 6px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  font-weight: 800;
}

.offline-update-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 6px;
  margin: 2px 0 0;
}

.offline-update-details div {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  background: #ffffff;
}

.offline-update-details div.wide {
  grid-column: span 3;
}

.offline-update-details dt {
  color: #64748b;
  font-size: 11px;
}

.offline-update-details dd {
  margin: 2px 0 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offline-update-log {
  color: #475569;
  font-size: 12px;
}

.offline-update-log summary {
  width: fit-content;
  cursor: pointer;
  color: #0f766e;
  font-weight: 800;
}

.offline-update-log ol {
  display: grid;
  max-height: 96px;
  margin: 6px 0 0;
  padding-left: 18px;
  overflow: auto;
  gap: 3px;
}

.offline-update-cancel {
  justify-self: end;
  min-height: 28px;
  padding: 0 10px;
  border-color: #fecaca;
  background: #fff1f2;
  color: #be123c;
  font-size: 12px;
  font-weight: 800;
}

.readonly-category-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.primary-button {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #eef3f8;
}

.auth-dialog {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid #c7d3e4;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}

.auth-dialog header {
  display: grid;
  gap: 4px;
}

.auth-dialog strong {
  color: #132033;
  font-size: 20px;
}

.auth-dialog span,
.auth-dialog label span {
  color: #667085;
  font-size: 13px;
}

.auth-dialog label {
  display: grid;
  gap: 6px;
}

.auth-dialog input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  padding: 0 12px;
  color: #132033;
  background: #ffffff;
}

.auth-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  background: #16a34a;
}

.auth-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  background: #fff1f2;
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: start center;
  padding: 84px 16px 16px;
  background: rgba(15, 23, 42, 0.32);
}

.import-dialog {
  width: min(760px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

.import-dialog header,
.import-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.import-dialog header strong {
  display: block;
  color: #132033;
  font-size: 17px;
}

.import-dialog header span,
.import-dialog label span,
.import-status {
  color: #475467;
  font-size: 13px;
}

.import-dialog label {
  display: grid;
  gap: 6px;
}

.article-pdf-import-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid #9dbcf5;
  border-radius: 8px;
  background: #f3f7ff;
}

.article-pdf-import-panel > div {
  min-width: 0;
}

.article-pdf-import-panel strong,
.article-pdf-import-panel > div span {
  display: block;
}

.article-pdf-import-panel strong {
  color: #132033;
  font-size: 15px;
}

.article-pdf-import-panel > div span {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
}

.article-pdf-file-picker {
  position: relative;
  grid-template-columns: auto minmax(0, auto);
  align-items: center;
  justify-content: center;
  min-width: 156px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 7px;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

.article-pdf-file-picker span {
  color: inherit !important;
  white-space: nowrap;
}

.article-pdf-file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 640px) {
  .article-pdf-import-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .article-pdf-file-picker {
    width: 100%;
  }
}

.import-dialog input,
.import-dialog select,
.import-dialog textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  padding: 0 10px;
  color: #132033;
  background: #ffffff;
}

.import-dialog textarea {
  min-height: 104px;
  padding: 9px 10px;
  resize: vertical;
  line-height: 1.45;
}

.pdf-upload-mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  background: #eef3f8;
}

.pdf-upload-mode-toggle button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #475467;
  font-weight: 700;
}

.pdf-upload-mode-toggle button.active {
  background: #ffffff;
  color: #132033;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.pdf-upload-selection {
  margin: -4px 0 0;
  padding: 8px 10px;
  border: 1px solid #d8e1ee;
  border-radius: 8px;
  background: #f8fafc;
  color: #475467;
  font-size: 13px;
}

.wechat-batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wechat-batch-list {
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid #d8e1ee;
  border-radius: 8px;
  background: #f8fafc;
}

.wechat-auth-panel {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
}

.wechat-auth-panel strong {
  font-size: 13px;
  line-height: 1.35;
}

.wechat-auth-panel img {
  width: 168px;
  max-width: 100%;
  border: 1px solid #d8e1ee;
  border-radius: 8px;
  background: #ffffff;
}

.wechat-auth-panel small {
  color: #475467;
  font-size: 12px;
}

.wechat-batch-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 9px;
  border: 1px solid #d8e1ee;
  border-radius: 8px;
  background: #ffffff;
}

.wechat-batch-row input {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  padding: 0;
}

.wechat-batch-row strong {
  display: block;
  color: #132033;
  font-size: 14px;
  line-height: 1.35;
}

.wechat-batch-row em {
  display: block;
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.wechat-batch-row small {
  display: inline-flex;
  margin-top: 4px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
}

.wechat-batch-row.existing {
  background: #f1f5f9;
}

.wechat-batch-row.existing strong,
.wechat-batch-row.existing em,
.wechat-batch-row.existing small {
  color: #98a2b3;
}

.wechat-import-status-panel {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid #d8e1ee;
  border-radius: 8px;
  background: #f8fafc;
}

.wechat-import-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  align-items: center;
  gap: 10px;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
}

.wechat-import-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.wechat-import-progress-bar {
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: #2563eb;
  transition: width 160ms ease;
}

.wechat-import-status-list {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.wechat-import-status-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 9px;
  border: 1px solid #d8e1ee;
  border-radius: 8px;
  background: #ffffff;
}

.wechat-import-status-row input {
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
  padding: 0;
}

.wechat-import-status-row strong {
  display: block;
  color: #132033;
  font-size: 13px;
  line-height: 1.35;
}

.wechat-import-status-row em {
  display: block;
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.wechat-import-status-row small {
  display: block;
  margin-top: 4px;
  color: #475467;
  font-size: 12px;
  line-height: 1.35;
}

.wechat-import-status-row.imported {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.wechat-import-status-row.skipped {
  background: #f1f5f9;
}

.wechat-import-status-row.failed {
  border-color: #fecaca;
  background: #fff7f7;
}

.wechat-import-status-row.importing {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.wechat-import-status-row.imported strong {
  color: #047857;
}

.wechat-import-status-row.failed strong {
  color: #b91c1c;
}

.wechat-import-status-row.skipped strong {
  color: #64748b;
}

.import-status-warning {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.pdf-upload-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
}

.pdf-upload-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.pdf-upload-progress-bar {
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: #2563eb;
  transition: width 160ms ease;
}

.import-dialog-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 150px;
  gap: 12px;
}

.article-category-dialog .import-dialog-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.article-category-dialog .topic-category-field {
  grid-column: 1 / -1;
}

.import-category-hint {
  margin: -2px 0 0;
  color: #475569;
  font-size: 13px;
}

.import-status {
  margin: 0;
  padding: 9px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
}

.mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(54px, 1fr));
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.mode-switch button {
  min-height: 36px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
}

.mode-switch button + button {
  border-left: 1px solid rgba(255, 255, 255, 0.28);
}

.mode-switch button.active {
  background: #ffffff;
  color: #2351dc;
  font-weight: 800;
}

.filter-panel {
  display: grid;
  gap: 6px;
  padding: 8px 12px 9px;
}

.filter-summary,
.mobile-filter-head,
.mobile-back-button {
  display: none;
}

.filter-summary {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid #d7e0eb;
  background: #ffffff;
}

.filter-summary span {
  min-width: 0;
  color: #475467;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-row-label {
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 7px;
  background: #2563eb;
  color: #ffffff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
}

.filter-row-label.topic {
  background: #0f766e;
}

.filter-row-label.major {
  background: #7c3aed;
}

.filter-chip {
  background: #edf4ff;
  color: #0f2c56;
  white-space: nowrap;
}

.filter-chip.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 700;
}

.filter-chip.active.ai {
  background: #0f766e;
  border-color: #0f766e;
}

.filter-chip.active.major {
  background: #7c3aed;
  border-color: #7c3aed;
}

.sort-toggle {
  min-height: 34px;
  padding: 7px 10px;
  background: #ffffff;
  color: #475467;
  border-style: dashed;
}

.sort-toggle.active {
  background: #132033;
  border-color: #132033;
  color: #ffffff;
}

.category-add-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-add-form input {
  width: 150px;
  min-height: 34px;
  border: 1px solid #c7d3e4;
  border-radius: 7px;
  padding: 0 10px;
  color: #132033;
  background: #ffffff;
}

.category-add-form button {
  min-height: 34px;
  padding: 7px 10px;
  gap: 4px;
  background: #ffffff;
  color: #2563eb;
}

.filter-chip.sortable {
  cursor: grab;
  border-style: dashed;
}

.filter-chip-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.category-edit-button,
.category-delete-button {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border-color: #c7d3e4;
  background: #ffffff;
  color: #475467;
}

.category-edit-button:hover {
  background: #eaf2ff;
  color: #1d4ed8;
}

.category-delete-button:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.category-rename-form {
  display: inline-grid;
  grid-template-columns: minmax(90px, 150px) auto auto;
  align-items: center;
  gap: 4px;
}

.category-rename-form input {
  min-width: 0;
  min-height: 30px;
  border: 1px solid #93b4e8;
  border-radius: 7px;
  padding: 0 8px;
}

.category-rename-form button {
  min-height: 30px;
  padding: 5px 8px;
  background: #ffffff;
  color: #2563eb;
}

.filter-chip.active .category-delete-button {
  color: #ffffff;
}

.filter-chip.active .category-delete-button:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.filter-chip.sortable:active {
  cursor: grabbing;
}

.drag-handle {
  color: #667085;
  font-weight: 900;
  letter-spacing: 0;
}

.filter-chip.active .drag-handle {
  color: rgba(255, 255, 255, 0.75);
}

.category-sort-status {
  margin: 0;
  color: #667085;
  font-size: 12px;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: var(--article-pane-width, 320px) 8px minmax(520px, 1fr) 300px;
  overflow: hidden;
}

.web-reader-shell.article-pane-collapsed .workspace {
  grid-template-columns: 0 0 minmax(720px, 1fr) 300px;
}

.web-reader-shell.memory-pane-collapsed .workspace {
  grid-template-columns: var(--article-pane-width, 320px) 8px minmax(720px, 1fr) 0;
}

.web-reader-shell.article-pane-collapsed.memory-pane-collapsed .workspace,
.web-reader-shell.immersive-mode .workspace {
  grid-template-columns: 0 0 minmax(0, 1fr) 0;
}

.article-pane-resizer {
  min-width: 0;
  cursor: col-resize;
  background: linear-gradient(90deg, transparent, #d7e0eb, transparent);
  position: relative;
  z-index: 3;
}

.article-pane-resizer::after {
  content: "";
  position: absolute;
  inset: 0 2px;
  border-radius: 999px;
}

.article-pane-resizer:hover::after,
.article-pane-resizer:focus-visible::after,
.article-pane-resizing .article-pane-resizer::after {
  background: #2563eb;
}

.web-reader-shell.article-pane-collapsed .article-pane-resizer,
.web-reader-shell.immersive-mode .article-pane-resizer {
  display: none;
}

.article-pane-resizing {
  cursor: col-resize;
  user-select: none;
}

.article-pane,
.memory-pane {
  background: #ffffff;
  min-width: 0;
  padding: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.article-pane {
  border-right: 1px solid #d7e0eb;
  gap: 10px;
}

.memory-pane {
  border-left: 1px solid #d7e0eb;
  gap: 12px;
}

.web-reader-shell.article-pane-collapsed .article-pane,
.web-reader-shell.memory-pane-collapsed .memory-pane,
.web-reader-shell.immersive-mode .article-pane,
.web-reader-shell.immersive-mode .memory-pane {
  padding: 0;
  border: 0;
  overflow: hidden;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  padding: 0 10px;
  min-height: 39px;
  background: #ffffff;
}

.search-box input {
  border: 0;
  outline: none;
  width: 100%;
  min-width: 0;
}

.search-scope-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(44px, 1fr));
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.search-scope-toggle button {
  min-height: 39px;
  padding: 0 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #475467;
}

.search-scope-toggle button + button {
  border-left: 1px solid #c7d3e4;
}

.search-scope-toggle button.active {
  background: #2563eb;
  color: #ffffff;
  font-weight: 700;
}

.scan-status,
.muted {
  margin: 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.55;
}

.article-list-actions {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.category3-batch-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 0 0 8px;
  color: #667085;
  font-size: 12px;
}

.article-batch-start-button,
.article-batch-category-start-button,
.article-batch-delete-button,
.article-batch-category-confirm-button,
.article-batch-cancel-button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 6px;
}

.article-batch-start-button {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid #d7a2a2;
  background: #fff;
  color: #a83232;
}

.article-batch-category-start-button {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid #9ec9b0;
  background: #f4fbf6;
  color: #167244;
}

.article-batch-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid #e4b4b4;
  border-radius: 7px;
  background: #fff7f7;
  color: #667085;
  font-size: 12px;
}

.article-batch-toolbar.category3-mode {
  border-color: #acd5bc;
  background: #f4fbf6;
}

.article-batch-select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #344054;
  font-weight: 700;
  white-space: nowrap;
}

.article-batch-select-all input,
.article-batch-checkbox input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #c43838;
}

.article-batch-delete-button {
  margin-left: auto;
  padding: 5px 9px;
  border: 1px solid #b83232;
  background: #b83232;
  color: #fff;
}

.article-batch-category-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: #344054;
  font-weight: 700;
  white-space: nowrap;
}

.article-batch-category-select select {
  min-width: 110px;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid #a8cdb5;
  border-radius: 5px;
  background: #fff;
  color: #1f5135;
}

.article-batch-category-confirm-button {
  padding: 5px 9px;
  border: 1px solid #16804a;
  background: #16804a;
  color: #fff;
}

.article-batch-cancel-button {
  width: 30px;
  padding: 0;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475467;
}

.article-list {
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.article-card-wrap {
  position: relative;
}

.article-batch-checkbox {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 4;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #d8a4a4;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.article-card-wrap[draggable="true"] {
  cursor: grab;
}

.article-card-wrap[draggable="true"]:active {
  cursor: grabbing;
}

.article-card-wrap.dragging {
  opacity: 0.45;
}

.article-card-wrap.dragging > button {
  border-style: dashed;
  border-color: #2563eb;
}

.article-order-controls {
  position: absolute;
  top: 8px;
  right: 6px;
  z-index: 2;
  display: grid;
  gap: 4px;
  opacity: 0.62;
  transition: opacity 120ms ease;
}

.article-card-wrap:hover .article-order-controls,
.article-order-controls:focus-within {
  opacity: 1;
}

.article-order-controls button {
  width: 27px;
  height: 27px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: #64748b;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.article-order-controls button:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.article-color-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.article-color-dot {
  width: 14px;
  height: 14px;
  min-width: 14px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #e2e8f0;
  box-shadow: none;
  cursor: pointer;
}

.article-color-dot.red {
  border-color: #f87171;
  background: #ef4444;
}

.article-color-dot.green {
  border-color: #34d399;
  background: #10b981;
}

.article-color-dot.yellow {
  border-color: #fbbf24;
  background: #f59e0b;
}

.article-color-dot.active {
  box-shadow: inset 0 0 0 2px #0f172a;
}

.reader-priority-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  box-sizing: border-box;
}

.reader-priority-controls .article-color-dot {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-width: 1px;
  border-color: #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.reader-priority-controls .article-color-dot.active {
  outline: 2px solid #0f172a;
  outline-offset: 1px;
  box-shadow: none;
}

.article-order-controls button.active.front {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.article-order-controls button.active.back {
  border-color: #64748b;
  background: #64748b;
  color: #ffffff;
}

.article-card {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 6px;
  min-height: 112px;
  padding: 11px 42px 34px 11px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.article-card-wrap.batch-selected > .article-card {
  border-color: #c43838;
  background: #fff5f5;
}

.article-card-wrap.priority-red > .article-card {
  border-color: #f87171;
  background: #fff1f2;
}

.article-card-wrap.priority-green > .article-card {
  border-color: #34d399;
  background: #ecfdf5;
}

.article-card-wrap.priority-yellow > .article-card {
  border-color: #fbbf24;
  background: #fffbeb;
}

.article-card.selected {
  border-color: #2563eb;
  background: #f0f5ff;
}

.article-card.opening {
  border-color: #2563eb;
  background: #f7fbff;
}

.article-card.opening::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #2563eb, transparent);
  transform-origin: left center;
  animation: article-switch-progress 900ms ease-in-out infinite;
}

.article-title {
  width: 100%;
  font-weight: 800;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.article-tags,
.article-excerpt,
.article-state {
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}

.article-tags {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-excerpt {
  width: 100%;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.article-state {
  width: 100%;
  margin-top: auto;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}

.article-card-meta {
  position: absolute;
  left: 11px;
  right: 42px;
  bottom: 10px;
  z-index: 3;
  width: auto;
}

.article-state-category {
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-state-metrics {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.article-click-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #475569;
  white-space: nowrap;
}

.article-progress {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef4ff;
  color: #1d4ed8;
  padding: 2px 7px;
  font-weight: 700;
  line-height: 1.2;
}

.article-progress.read {
  background: #e8f8f0;
  color: #087443;
}

.reader-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #eef2f7;
  overflow: hidden;
}

.reader-toolbar {
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #d7e0eb;
  background: #ffffff;
  padding: 0 13px;
}

.toolbar-icon-button {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.web-reader-shell.immersive-mode .reader-toolbar {
  height: 46px;
  border-bottom-color: #cfd8e6;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  z-index: 1;
}

.zoom-label,
.progress-label {
  min-width: 44px;
  text-align: center;
  color: #475467;
  font-size: 13px;
}

.article-download-toast {
  position: fixed;
  top: 72px;
  left: 50%;
  z-index: 120;
  max-width: min(460px, calc(100vw - 24px));
  transform: translateX(-50%);
  border: 1px solid #93b4f4;
  border-radius: 7px;
  padding: 9px 14px;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.article-pdf-download {
  min-height: 34px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #c7d3e4;
  border-radius: 7px;
  background: #ffffff;
  color: #132033;
  text-decoration: none;
  cursor: pointer;
}
.article-pdf-download:hover {
  background: #f5f8fc;
}
.article-pdf-download.loading svg {
  animation: mobile-reader-spin 900ms linear infinite;
}
.answer-toggle.active {
  color: #ffffff;
  border-color: #2563eb;
  background: #2563eb;
}

.progress-track {
  height: 8px;
  flex: 1;
  background: #e4ebf5;
  border-radius: 99px;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  background: #2563eb;
}

.reader-surface {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 18px;
  position: relative;
}

.pdf-reader-surface {
  padding: 0;
  background: #dfe6ef;
}

.pdf-mode {
  grid-template-rows: auto minmax(0, 1fr);
}

.pdf-summary {
  min-height: 38px;
  justify-content: flex-start;
}

.resource-summary {
  min-height: 38px;
  justify-content: flex-start;
}

.resources-mode {
  grid-template-rows: auto minmax(0, 1fr);
}

.resources-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  overflow: hidden;
  background: #eef2f7;
}

.resource-tree-pane,
.resource-main-pane {
  min-width: 0;
  min-height: 0;
}

.resource-tree-pane {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #d7e0eb;
  background: #f8fafc;
}

.resource-pane-header,
.resource-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid #d7e0eb;
  background: #ffffff;
}

.resource-pane-header h2,
.resource-main-header h2 {
  margin: 0;
  font-size: 18px;
}

.resource-pane-actions {
  display: flex;
  gap: 6px;
}

.resource-upload-status {
  margin: 0;
  padding: 7px 12px;
  border-bottom: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
}

.resource-pane-header p,
.resource-main-header p,
.resource-path-label {
  display: block;
  margin: 3px 0 0;
  color: #667085;
  font-size: 12px;
}

.resource-tree {
  min-height: 0;
  overflow: auto;
  padding: 8px;
}

.resource-tree-root,
.resource-tree-children {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.resource-tree-children {
  margin-left: 16px;
}

.resource-tree-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  border-radius: 6px;
}

.resource-tree-row.selected {
  background: #dbeafe;
  color: #1d4ed8;
}

.resource-tree-toggle,
.resource-tree-spacer {
  display: grid;
  width: 24px;
  height: 30px;
  place-items: center;
}

.resource-tree-toggle {
  border: 0;
  border-radius: 5px;
  color: #64748b;
  background: transparent;
}

.resource-tree-toggle:hover {
  background: #e2e8f0;
}

.resource-tree-item {
  display: flex;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 4px 7px 4px 0;
  border: 0;
  border-radius: 5px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.resource-tree-item:hover {
  color: #1d4ed8;
}

.resource-tree-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-main-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f7f9fc;
}

.resource-file-actions {
  display: flex;
  gap: 8px;
}

.resource-entry-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(166px, 1fr));
  align-content: start;
  gap: 10px;
  padding: 16px;
}

.resource-entry-card {
  display: grid;
  min-width: 0;
  min-height: 118px;
  align-content: start;
  gap: 9px;
  padding: 13px;
  border: 1px solid #d7e0eb;
  border-radius: 7px;
  color: #22314a;
  background: #ffffff;
  text-align: left;
}

.resource-entry-thumbnail {
  width: 56px;
  height: 56px;
  justify-self: start;
  object-fit: cover;
  border: 1px solid #d8e2ef;
  border-radius: 6px;
  background: #f8fafc;
}

.resource-entry-card:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.resource-entry-name,
.resource-entry-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-entry-name {
  font-weight: 800;
}

.resource-entry-meta {
  color: #667085;
  font-size: 12px;
}

.resource-preview {
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.resource-preview-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: #1d4ed8;
}

.resource-preview-meta div {
  min-width: 0;
}

.resource-preview-meta strong,
.resource-preview-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-preview-meta span {
  margin-top: 3px;
  color: #667085;
  font-size: 12px;
}

.resource-image-preview {
  display: block;
  width: min(100%, 1120px);
  max-height: calc(100dvh - 220px);
  margin: 0 auto;
  object-fit: contain;
  background: #ffffff;
}

.resource-pdf-preview {
  display: block;
  width: 100%;
  min-height: calc(100dvh - 220px);
  border: 1px solid #d7e0eb;
  background: #ffffff;
}

.resource-file-preview,
.resource-empty {
  display: grid;
  min-height: 260px;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 22px;
  color: #64748b;
  text-align: center;
}

.resource-empty {
  min-height: 0;
  flex: 1;
}

.resource-empty.compact {
  min-height: 180px;
}

.resource-file-preview p,
.resource-empty p {
  margin: 0;
}

.pdf-workspace {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(460px, 0.52fr) minmax(560px, 1fr) 260px;
  overflow: hidden;
  background: #eef2f7;
}

.pdf-workspace.pdf-reader-open {
  grid-template-columns: minmax(0, 1fr);
}

.pdf-workspace:has(.pdf-reader-surface .empty-reader) {
  grid-template-columns: minmax(0, 1fr) 0 0;
}

.pdf-workspace:has(.pdf-reader-surface .empty-reader) .pdf-reader-pane,
.pdf-workspace:has(.pdf-reader-surface .empty-reader) .pdf-memory-pane {
  padding: 0;
  border: 0;
  overflow: hidden;
}

.pdf-library-pane {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  overflow: hidden;
  background: #f7f9fc;
  border-right: 1px solid #d7e0eb;
}

.pdf-library-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(280px, auto);
  gap: 12px;
  align-items: end;
}

.pdf-library-toolbar h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.pdf-library-toolbar p {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.pdf-library-actions {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pdf-search-box {
  width: min(340px, 42vw);
}

.pdf-status-tabs {
  display: inline-flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.pdf-book-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 14px;
  align-content: start;
  padding: 2px 4px 18px 0;
}

.pdf-book-card {
  min-width: 0;
  min-height: 0;
  padding: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: grab;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.pdf-book-card:active {
  cursor: grabbing;
}

.pdf-book-card.dragging {
  opacity: 0.55;
  transform: scale(0.98);
}

.pdf-book-open-button {
  min-width: 0;
  min-height: 0;
  padding: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 8px;
  align-items: stretch;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.pdf-book-open-button:hover:not(:disabled) {
  background: transparent;
}

.pdf-book-card.selected .pdf-cover {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.pdf-book-card.opening .pdf-cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #2563eb, transparent);
  animation: article-switch-progress 900ms ease-in-out infinite;
}

.pdf-cover {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.pdf-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #f8fafc;
}

.pdf-cover::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 12px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.18), transparent);
  pointer-events: none;
  z-index: 1;
}

.pdf-book-title {
  min-height: 38px;
  color: #132033;
  font-weight: 800;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pdf-book-meta {
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-book-download,
.pdf-toolbar-download {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #c7d3e4;
  border-radius: 7px;
  background: #ffffff;
  color: #132033;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.pdf-book-actions {
  display: flex;
  gap: 6px;
}

.pdf-book-download {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

.pdf-book-delete {
  width: 36px;
  min-width: 36px;
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid #f1b6b6;
  border-radius: 7px;
  background: #fff;
  color: #bd2626;
}

.pdf-book-delete:hover:not(:disabled) {
  background: #fff1f1;
  border-color: #dc5555;
}

.pdf-book-download:hover,
.pdf-toolbar-download:hover {
  background: #f5f8fc;
}

.pdf-return-button {
  flex-shrink: 0;
}

.pdf-empty-library {
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #667085;
  text-align: center;
}

.pdf-empty-library h2 {
  margin: 0;
  color: #132033;
  font-size: 20px;
}

.pdf-empty-library p {
  margin: 0;
}

.pdf-reader-pane,
.pdf-memory-pane {
  min-width: 0;
}

.pdf-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #ffffff;
}

.pdf-card .article-excerpt {
  -webkit-line-clamp: 1;
}

.reader-surface.answer-split-open {
  display: grid;
  grid-template-columns: minmax(0, 62fr) minmax(340px, 38fr);
  gap: 12px;
  overflow: hidden;
}

.switch-progress {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 8px;
  height: 3px;
  border-radius: 99px;
  background: #dbe6f5;
  overflow: hidden;
  z-index: 4;
}

.switch-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
  animation: reader-switch-progress 900ms ease-in-out infinite;
}

@keyframes article-switch-progress {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes reader-switch-progress {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(250%);
  }
}

.web-reader-shell.article-pane-collapsed .reader-surface,
.web-reader-shell.memory-pane-collapsed .reader-surface {
  padding: 14px;
}

.web-reader-shell.immersive-mode .reader-surface {
  padding: 0;
  background: #dfe6ef;
}

.reader-frame-wrap {
  min-width: 0;
  min-height: 0;
}

.reader-frame-wrap iframe {
  width: 100%;
  height: calc(100vh - 160px);
  min-height: 420px;
  border: 1px solid #d7e0eb;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.web-reader-shell.article-pane-collapsed .reader-frame-wrap iframe,
.web-reader-shell.memory-pane-collapsed .reader-frame-wrap iframe {
  height: calc(100vh - 128px);
}

.web-reader-shell.immersive-mode .reader-frame-wrap iframe {
  height: calc(100vh - 46px);
  min-height: 0;
  border: 0;
  box-shadow: none;
}

.reader-surface.answer-split-open .reader-frame-wrap iframe,
.reader-surface.answer-split-open .answer-pane {
  height: 100%;
  min-height: 0;
}

.reader-surface.answer-split-open .reader-frame-wrap iframe {
  min-height: 0;
}

.answer-pane {
  min-width: 0;
  border: 1px solid #d7e0eb;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.answer-pane-header {
  height: 42px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #d7e0eb;
  padding: 0 10px 0 14px;
  background: #f8fbff;
}

.answer-pane-header strong {
  font-size: 15px;
}

.answer-pane-header button {
  min-height: 30px;
  padding: 5px 9px;
}

.answer-pane iframe {
  width: 100%;
  flex: 1;
  min-height: 0;
  border: 0;
  background: #ffffff;
}

.empty-reader {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  color: #667085;
}

.empty-reader h2 {
  margin: 0;
  color: #132033;
}

.empty-reader p {
  max-width: 520px;
  line-height: 1.7;
}

.memory-pane h2 {
  margin: 0;
  font-size: 18px;
}

.memory-content {
  display: grid;
  gap: 14px;
}

.memory-content h3 {
  margin: 0;
  line-height: 1.45;
  font-size: 16px;
}

.memory-title-form {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d7e0eb;
  border-radius: 8px;
  background: #fbfcfe;
}

.memory-title-form label {
  display: grid;
  gap: 6px;
}

.memory-title-form label span {
  color: #667085;
  font-size: 12px;
}

.memory-title-form input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid #c7d3e4;
  border-radius: 7px;
  padding: 0 9px;
  color: #132033;
  background: #fff;
  font: inherit;
  font-weight: 700;
}

.memory-title-form button {
  width: 100%;
  min-height: 36px;
  justify-content: center;
}

.memory-title-status {
  margin: 0;
  color: #2563eb;
  font-size: 12px;
}

.memory-actions {
  display: grid;
  gap: 8px;
}

.memory-delete-button {
  width: 100%;
  min-height: 36px;
  justify-content: center;
  border-color: #fecaca;
  background: #fff5f5;
  color: #b91c1c;
  font-weight: 800;
}

.memory-delete-button:hover {
  border-color: #fca5a5;
  background: #fee2e2;
}

.memory-category-form {
  display: grid;
  gap: 9px;
}

.memory-category-form label {
  display: grid;
  gap: 6px;
  border: 1px solid #d7e0eb;
  border-radius: 8px;
  padding: 9px;
  background: #fbfcfe;
}

.memory-category-form label span {
  color: #667085;
  font-size: 12px;
}

.memory-category-form input,
.memory-category-form select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid #c7d3e4;
  border-radius: 7px;
  padding: 0 8px;
  color: #132033;
  background: #ffffff;
  font: inherit;
  font-weight: 700;
}

.memory-custom-category-input {
  margin-top: 2px;
}

.memory-category-form > button {
  width: 100%;
  min-height: 36px;
}

.topic-category-field {
  display: grid;
  gap: 7px;
}

.topic-category-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 128px;
  overflow: auto;
  padding: 2px;
}

.topic-category-option {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid #c7d3e4;
  background: #f8fbff;
  color: #264463;
  font-weight: 700;
}

.topic-category-option.active {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

.category3-assignment-field {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.category3-assignment-list {
  display: grid;
  gap: 7px;
}

.category3-assignment-list label {
  display: grid;
  grid-template-columns: minmax(72px, 0.35fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #415873;
  font-size: 12px;
  font-weight: 700;
}

.category3-assignment-list input {
  min-width: 0;
  grid-column: 2;
}

.category3-assignment-options {
  grid-column: 2;
  max-height: 92px;
}

.category3-filter-row .filter-row-label.category3 {
  background: #7c3aed;
}

.filter-chip.category3.active {
  background: #7c3aed;
  border-color: #7c3aed;
}

.memory-category-status {
  margin: 0;
  padding: 8px 9px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
}

.memory-content dl {
  display: grid;
  gap: 9px;
  margin: 0;
}

.memory-content dl div {
  border: 1px solid #d7e0eb;
  border-radius: 8px;
  padding: 9px;
  background: #fbfcfe;
}

.memory-content dt {
  color: #667085;
  font-size: 12px;
  margin-bottom: 4px;
}

.memory-content dd {
  margin: 0;
  font-weight: 700;
}

.memory-content a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 700;
}

.notebook-summary {
  min-height: 42px;
}

.notebook-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 240px 330px minmax(520px, 1fr);
  overflow: hidden;
  background: #eef2f7;
}

.notebook-pane,
.note-list-pane,
.note-editor-pane {
  min-width: 0;
  min-height: 0;
  background: #ffffff;
  border-right: 1px solid #d7e0eb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.note-editor-pane {
  border-right: 0;
}

.notebook-pane > header,
.note-list-pane > header,
.note-editor-pane > header {
  min-height: 64px;
  padding: 12px 14px;
  border-bottom: 1px solid #d7e0eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notebook-pane h2,
.note-list-pane h2,
.note-editor-pane h2 {
  margin: 0;
  font-size: 17px;
}

.notebook-pane p,
.note-list-pane p,
.note-editor-pane p {
  margin: 2px 0 0;
  color: #667085;
  font-size: 12px;
}

.notebook-list,
.note-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.notebook-item,
.note-card {
  width: 100%;
  text-align: left;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px;
  background: #f8fbff;
}

.notebook-item.active,
.note-card.active {
  background: #edf4ff;
  border-color: #2563eb;
}

.notebook-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.note-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #d7e0eb;
}

select {
  min-height: 39px;
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  background: #ffffff;
  color: #132033;
  padding: 0 9px;
  font: inherit;
}

.note-card {
  display: grid;
  gap: 6px;
  min-height: 94px;
  align-items: start;
}

.note-card strong,
.note-card span,
.note-card small {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-card strong {
  font-size: 15px;
}

.note-card span {
  color: #475467;
  font-size: 13px;
  white-space: nowrap;
}

.note-card small {
  color: #1d4ed8;
  font-size: 12px;
}

.note-editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.danger-button {
  color: #b42318;
  border-color: #f4b8b1;
  background: #fff7f6;
}

.note-editor {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.note-editor label {
  display: grid;
  gap: 6px;
}

.note-editor label span {
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.note-editor input,
.note-editor textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  padding: 9px 10px;
  color: #132033;
  background: #ffffff;
  outline: none;
  font: inherit;
}

.note-editor textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.6;
}

.note-editor textarea.markdown-editor {
  min-height: 190px;
  font-family: "Cascadia Code", Consolas, "Microsoft YaHei UI", monospace;
}

.note-editor-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 10px;
}

.linked-article {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 8px;
  padding: 9px 10px;
  font-weight: 800;
  font-size: 13px;
}

.quick-note-panel {
  min-height: 48px;
  display: grid;
  grid-template-columns: 180px minmax(180px, 1fr) auto auto;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #d7e0eb;
  background: #fbfdff;
}

.quick-note-panel input {
  min-height: 39px;
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  padding: 0 10px;
}

.attachment-section {
  border-top: 1px solid #d7e0eb;
  padding-top: 12px;
}

.attachment-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.upload-button {
  min-height: 34px;
  border: 1px solid #c7d3e4;
  background: #ffffff;
  border-radius: 7px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.upload-button.disabled {
  color: #98a2b3;
  cursor: not-allowed;
}

.upload-button input {
  display: none;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
}

.attachment-grid figure {
  margin: 0;
  border: 1px solid #d7e0eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fbfcfe;
}

.attachment-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #e4ebf5;
}

.attachment-grid figcaption {
  padding: 7px 8px 0;
  color: #475467;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-grid button {
  margin: 8px;
  min-height: 30px;
  width: calc(100% - 16px);
}

.notebook-workspace {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: #edf1f6;
}

.notebook-topbar {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid #d7e0eb;
  background: #ffffff;
}

.notebook-tabs {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.notebook-tab,
.new-notebook-button {
  flex: 0 0 auto;
  min-height: 36px;
  border-radius: 8px;
  background: #eef6ff;
  color: #173b68;
  font-weight: 800;
}

.notebook-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.new-notebook-button {
  background: #ffffff;
}

.new-notebook-form {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.new-notebook-form input {
  width: 170px;
  min-height: 36px;
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  padding: 0 10px;
  color: #132033;
  font: inherit;
  outline: none;
}

.new-notebook-form button {
  min-height: 36px;
  border-radius: 8px;
  background: #ffffff;
}

.new-notebook-form button[type="submit"] {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  font-weight: 800;
}

.notebook-save-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.notebook-save-actions span {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #667085;
  font-size: 13px;
  font-weight: 800;
}

.word-editor-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 12px;
  overflow: hidden;
}

.word-toolbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px;
  border: 1px solid #d7e0eb;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #fbfdff;
}

.word-toolbar button {
  width: 34px;
  min-height: 34px;
  justify-content: center;
  padding: 0;
  border-radius: 7px;
  background: #ffffff;
}

.formula-toolbar {
  position: relative;
}

.word-toolbar .formula-toolbar > button {
  width: auto;
  min-width: 48px;
  padding: 0 8px;
  font-family: "Cambria Math", "Times New Roman", serif;
  font-weight: 800;
}

.word-toolbar .formula-toolbar > button.active {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
}

.formula-palette {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: min(520px, 84vw);
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
}

.formula-palette section {
  display: grid;
  gap: 7px;
}

.formula-palette strong {
  color: #132033;
  font-size: 12px;
}

.formula-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.formula-editor-row input {
  min-width: 0;
  min-height: 34px;
  border: 1px solid #c7d3e4;
  border-radius: 7px;
  padding: 0 9px;
  color: #132033;
  font-family: "Cambria Math", "Times New Roman", serif;
  outline: none;
}

.formula-editor-row input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.word-toolbar .formula-editor-row button {
  width: auto;
  min-width: 72px;
  padding: 0 10px;
  border-color: #2563eb;
  color: #ffffff;
  background: #2563eb;
  font-weight: 800;
}

.formula-symbol-grid,
.formula-template-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.word-toolbar .formula-symbol-grid button,
.word-toolbar .formula-template-grid button {
  width: auto;
  min-width: 34px;
  min-height: 32px;
  padding: 0 9px;
  font-size: 14px;
}

.word-toolbar .formula-symbol-grid button {
  font-family: "Cambria Math", "Times New Roman", serif;
  font-size: 17px;
}

.note-formula-rendered.selected {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
  border-radius: 6px;
  background: #eff6ff;
}

.word-editor-surface {
  min-height: 0;
  overflow: auto;
  border: 1px solid #d7e0eb;
  border-radius: 0 0 8px 8px;
  background: #ffffff;
  padding: 28px 34px 64px;
  color: #111827;
  font-size: 16px;
  line-height: 1.75;
  outline: none;
}

.word-editor-surface:empty::before {
  content: attr(data-placeholder);
  color: #98a2b3;
}

.word-editor-surface h1,
.word-editor-surface h2,
.word-editor-surface h3 {
  margin: 18px 0 10px;
  line-height: 1.35;
}

.word-editor-surface p {
  margin: 0 0 12px;
}

.word-editor-surface ul,
.word-editor-surface ol {
  margin: 8px 0 14px 24px;
  padding: 0;
}

.word-editor-surface .note-formula,
.note-readonly-body .note-formula,
.word-editor-surface math,
.note-readonly-body math {
  display: inline-block;
  max-width: 100%;
  margin: 4px 4px 8px 0;
  padding: 2px 4px;
  overflow-x: auto;
  color: #0f172a;
  font-family: "Cambria Math", "Times New Roman", serif;
  line-height: 1.45;
  vertical-align: middle;
}

.word-editor-surface .note-formula-text,
.note-readonly-body .note-formula-text {
  white-space: pre-wrap;
  font-family: "Cambria Math", "Times New Roman", serif;
}

.word-editor-surface .note-formula-image,
.note-readonly-body .note-formula-image {
  display: inline-block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.note-readonly-view {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 56px;
  background: #ffffff;
  color: #111827;
}

.note-readonly-view h3 {
  margin: 0 0 16px;
  color: #0f172a;
  font-size: 20px;
  line-height: 1.35;
}

.note-readonly-body {
  font-size: 16px;
  line-height: 1.75;
}

.note-readonly-body p {
  margin: 0 0 12px;
}

.note-readonly-body h1,
.note-readonly-body h2,
.note-readonly-body h3 {
  margin: 18px 0 10px;
  line-height: 1.35;
}

.note-readonly-body ul,
.note-readonly-body ol {
  margin: 8px 0 14px 24px;
  padding: 0;
}

.note-readonly-body img {
  max-width: 100%;
  height: auto;
}

.note-readonly-body figure {
  max-width: 100%;
  margin: 12px 0;
}

.empty-notebook-state {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  min-height: 100%;
  color: #667085;
  text-align: center;
}

@media (min-width: 761px) {
  body {
    min-width: 1180px;
  }

  .filter-summary {
    display: grid;
  }

  .filter-panel {
    display: none;
    max-height: 210px;
    overflow: auto;
    border-bottom: 1px solid #d7e0eb;
  }

  .web-reader-shell.mobile-filters-open .filter-panel {
    display: grid;
  }
}

@media (max-width: 760px) {
  :root {
    background: #ffffff;
  }

  body {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  button {
    min-height: 38px;
    padding: 8px 10px;
  }

  .web-reader-shell,
  .web-reader-shell.immersive-mode {
    width: 100vw;
    height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr);
    background: #ffffff;
  }

  .web-reader-shell.immersive-mode .top-panel {
    display: block;
  }

  .web-reader-shell.mobile-reading {
    grid-template-rows: minmax(0, 1fr);
  }

  .web-reader-shell.mobile-reading .top-panel {
    display: none;
  }

  .top-panel {
    position: relative;
    z-index: 4;
  }

  .hero-strip {
    min-height: 46px;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 8px;
    padding: 6px 10px;
  }

  .reader-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .brand-block {
    min-width: 0;
    gap: 9px;
  }

  .brand-block h1 {
    font-size: 15px;
    margin-bottom: 1px;
  }

  .brand-block p {
    font-size: 11px;
  }

  .hero-metrics {
    display: none;
  }

  .scan-button {
    min-width: 0;
    min-height: 36px;
    padding: 7px 10px;
    box-shadow: none;
  }

  .add-button {
    min-width: 0;
    min-height: 36px;
    padding: 7px 10px;
  }

  .add-button svg,
  .scan-button svg {
    flex: 0 0 auto;
  }

  .modal-backdrop {
    align-items: start;
    padding: 58px 10px 10px;
  }

  .import-dialog {
    padding: 14px;
    gap: 12px;
  }

  .import-dialog-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .mode-switch {
    grid-template-columns: repeat(2, minmax(42px, 1fr));
  }

  .mode-switch button {
    min-height: 34px;
    padding: 0 7px;
    font-size: 12px;
  }

  .filter-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    border-bottom: 1px solid #d7e0eb;
    background: #ffffff;
  }

  .filter-summary span {
    min-width: 0;
    color: #475467;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .filter-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 78dvh;
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid #d7e0eb;
    box-shadow: 0 -18px 36px rgba(15, 23, 42, 0.18);
    overflow: auto;
    transform: translateY(105%);
    transition: transform 180ms ease;
    z-index: 10;
  }

  .web-reader-shell.mobile-filters-open .filter-panel {
    transform: translateY(0);
  }

  .mobile-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
  }

  .filter-row {
    gap: 7px;
  }

  .filter-chip,
  .filter-row-label {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 14px;
  }

  .workspace,
  .web-reader-shell.article-pane-collapsed .workspace,
  .web-reader-shell.memory-pane-collapsed .workspace,
  .web-reader-shell.article-pane-collapsed.memory-pane-collapsed .workspace,
  .web-reader-shell.immersive-mode .workspace {
    grid-template-columns: minmax(0, 1fr);
    background: #ffffff;
  }

  .notebook-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .notebook-topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .notebook-save-actions {
    justify-content: space-between;
  }

  .quick-note-panel {
    grid-template-columns: 1fr;
  }

  .article-pane {
    grid-column: 1;
    grid-row: 1;
    border-right: 0;
    padding: 10px;
    gap: 8px;
  }

  .reader-pane {
    grid-column: 1;
    grid-row: 1;
    background: #ffffff;
    display: none;
  }

  .memory-pane {
    display: none;
  }

  .web-reader-shell.mobile-reading .article-pane {
    display: none;
  }

  .web-reader-shell.mobile-reading .reader-pane {
    display: flex;
  }

  .web-reader-shell.pdf-mode .pdf-workspace.pdf-reader-open .pdf-reader-pane {
    display: flex;
  }

  .search-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .search-box,
  .search-scope-toggle button {
    min-height: 42px;
  }

  .article-list {
    gap: 7px;
    padding-right: 0;
  }

  .article-card {
    min-height: 104px;
    padding: 10px 40px 10px 10px;
    gap: 6px;
  }

  .article-title {
    -webkit-line-clamp: 2;
  }

  .article-tags {
    line-height: 1.35;
  }

  .article-excerpt {
    display: none;
  }

  .article-state {
    align-self: end;
    gap: 6px;
    min-height: 22px;
  }

  .article-state-category {
    flex: 0 1 auto;
    display: block;
  }

  .article-progress {
    padding: 2px 6px;
  }

  .reader-toolbar {
    height: 44px;
    gap: 6px;
    padding: 0 8px;
    overflow-x: auto;
  }

  .mobile-back-button {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .toolbar-icon-button,
  .reader-nav-button,
  .zoom-button,
  .zoom-label {
    display: none;
  }

  .progress-label {
    min-width: 38px;
    font-size: 12px;
  }

  .read-toggle,
  .reader-action,
  .answer-toggle {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .progress-track {
    min-width: 54px;
    flex: 1 0 54px;
  }

  .reader-surface,
  .web-reader-shell.article-pane-collapsed .reader-surface,
  .web-reader-shell.memory-pane-collapsed .reader-surface,
  .web-reader-shell.immersive-mode .reader-surface {
    padding: 0;
    background: #ffffff;
  }

  .reader-surface.answer-split-open {
    display: block;
    position: relative;
    overflow: hidden;
  }

  .reader-frame-wrap iframe,
  .web-reader-shell.article-pane-collapsed .reader-frame-wrap iframe,
  .web-reader-shell.memory-pane-collapsed .reader-frame-wrap iframe,
  .web-reader-shell.immersive-mode .reader-frame-wrap iframe {
    height: calc(100dvh - 44px);
    min-height: 0;
    border: 0;
    box-shadow: none;
    transform: none !important;
  }

  .answer-pane {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(92vw, 430px);
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: -18px 0 32px rgba(15, 23, 42, 0.18);
    z-index: 3;
  }

  .answer-pane iframe {
    transform: none !important;
  }

  .empty-reader {
    display: none;
  }
}

/* Notebook workbench order guard: keep this after legacy notebook/mobile rules. */
.notebook-workbench,
.web-reader-shell:has(.notebook-workbench) .notebook-workbench {
  height: 100%;
  display: grid;
  grid-template-columns: var(--notebook-nav-width, 140px) 8px var(--note-list-width, 180px) 8px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.notebook-workbench.nav-collapsed,
.web-reader-shell:has(.notebook-workbench) .notebook-workbench.nav-collapsed {
  grid-template-columns: 40px 0 var(--note-list-width, 180px) 8px minmax(0, 1fr);
}

.notebook-workbench.notes-collapsed,
.web-reader-shell:has(.notebook-workbench) .notebook-workbench.notes-collapsed {
  grid-template-columns: var(--notebook-nav-width, 140px) 8px 40px 0 minmax(0, 1fr);
}

.notebook-workbench.nav-collapsed.notes-collapsed,
.web-reader-shell:has(.notebook-workbench) .notebook-workbench.nav-collapsed.notes-collapsed {
  grid-template-columns: 40px 0 40px 0 minmax(0, 1fr);
}

.web-reader-shell:has(.notebook-workbench) .workspace,
.web-reader-shell:has(.notebook-workbench).article-pane-collapsed .workspace,
.web-reader-shell:has(.notebook-workbench).memory-pane-collapsed .workspace,
.web-reader-shell:has(.notebook-workbench).article-pane-collapsed.memory-pane-collapsed .workspace,
.web-reader-shell:has(.notebook-workbench).immersive-mode .workspace {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 760px) {
  .notebook-workbench,
  .web-reader-shell:has(.notebook-workbench) .notebook-workbench,
  .web-reader-shell:has(.notebook-workbench) .notebook-workbench.nav-collapsed,
  .web-reader-shell:has(.notebook-workbench) .notebook-workbench.notes-collapsed,
  .web-reader-shell:has(.notebook-workbench) .notebook-workbench.nav-collapsed.notes-collapsed,
  .notebook-workbench.nav-collapsed,
  .notebook-workbench.notes-collapsed,
  .notebook-workbench.nav-collapsed.notes-collapsed {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .notebook-column-resizer {
    display: none;
  }

  .notebook-nav-pane,
  .notebook-workbench .note-list-pane {
    min-height: 66px;
    max-height: 118px;
    border-right: 0;
    border-bottom: 1px solid #d7e0eb;
  }

  .notebook-workbench .notebook-list,
  .notebook-workbench .note-list {
    display: flex;
    overflow-x: auto;
  }

  .notebook-workbench.mobile-read-only .note-editor-pane {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .notebook-workbench.mobile-read-only .note-readonly-view {
    padding: 14px 16px 44px;
  }

  .notebook-workbench.mobile-read-only .note-readonly-view h3 {
    font-size: 18px;
  }

  .notebook-workbench.mobile-read-only .note-readonly-body {
    font-size: 15px;
  }
}

/* Mobile reading layout: keep this as the final override block. */
@media (max-width: 760px) {
  html,
  body,
  #root {
    height: 100%;
    overflow: hidden;
  }

  .web-reader-shell,
  .web-reader-shell.immersive-mode,
  .web-reader-shell:has(.notebook-workbench) {
    width: 100vw;
    height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .web-reader-shell.pdf-mode:has(.pdf-workspace.pdf-reader-open) {
    grid-template-rows: minmax(0, 1fr);
  }

  .web-reader-shell.pdf-mode:has(.pdf-workspace.pdf-reader-open) .top-panel {
    display: none;
  }

  .hero-strip {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand add"
      "mode mode";
    gap: 6px 8px;
    padding: 6px 8px;
  }

  .brand-block {
    grid-area: brand;
    gap: 8px;
  }

  .reader-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .reader-icon svg {
    width: 18px;
    height: 18px;
  }

  .brand-block h1 {
    font-size: 14px;
    line-height: 1.1;
  }

  .brand-block p {
    display: none;
  }

  .mode-switch {
    grid-area: mode;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mode-switch button {
    min-height: 32px;
    min-width: 0;
    padding: 0 2px;
    font-size: 12px;
    white-space: nowrap;
  }

  .add-button {
    grid-area: add;
    min-width: 0;
    min-height: 32px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .add-button svg {
    width: 14px;
    height: 14px;
  }

  .filter-summary {
    min-height: 38px;
    padding: 5px 8px;
  }

  .filter-summary button {
    min-height: 32px;
    padding: 5px 8px;
  }

  .filter-panel {
    max-height: 82dvh;
    padding: 10px;
  }

  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .filter-chip,
  .filter-row-label {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 9px;
    font-size: 13px;
  }

  .workspace,
  .web-reader-shell.article-pane-collapsed .workspace,
  .web-reader-shell.memory-pane-collapsed .workspace,
  .web-reader-shell.article-pane-collapsed.memory-pane-collapsed .workspace,
  .web-reader-shell.immersive-mode .workspace,
  .web-reader-shell:has(.notebook-workbench) .workspace {
    min-height: 0;
    height: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .article-pane-resizer {
    display: none;
  }

  .article-pane {
    height: 100%;
    padding: 8px;
  }

  .search-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .search-scope-toggle {
    min-width: 92px;
  }

  .search-box,
  .search-scope-toggle button {
    min-height: 38px;
  }

  .scan-status {
    font-size: 12px;
  }

  .article-list {
    min-height: 0;
    overflow: auto;
    gap: 6px;
    padding-bottom: 16px;
  }

  .article-card {
    min-height: 88px;
    padding: 9px 40px 9px 10px;
    gap: 5px;
  }

  .article-card h2 {
    font-size: 15px;
    line-height: 1.28;
  }

  .article-tags {
    font-size: 12px;
  }

  .article-state-category {
    display: none;
  }

  .article-state {
    align-self: stretch;
  }

  .article-progress {
    margin-left: auto;
  }

  .reader-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 44px;
    min-height: 44px;
  }

  .reader-surface,
  .reader-frame-wrap,
  .reader-frame-wrap iframe {
    min-height: 0;
    height: calc(100dvh - 44px);
  }

  .pdf-workspace,
  .pdf-workspace.pdf-reader-open {
    height: 100%;
    grid-template-columns: minmax(0, 1fr);
    background: #f7f9fc;
  }

  .resources-workspace {
    height: 100%;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(150px, 34dvh) minmax(0, 1fr);
  }

  .resource-tree-pane {
    border-right: 0;
    border-bottom: 1px solid #d7e0eb;
  }

  .resource-pane-header,
  .resource-main-header {
    padding: 10px;
  }

  .resource-pane-header h2,
  .resource-main-header h2 {
    font-size: 16px;
  }

  .resource-tree {
    padding: 6px 8px;
  }

  .resource-tree-root {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .resource-tree-children {
    grid-column: 1 / -1;
    margin-left: 14px;
  }

  .resource-entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .resource-entry-card {
    min-height: 104px;
    padding: 10px;
  }

  .resource-preview {
    padding: 10px;
  }

  .resource-pdf-preview {
    min-height: calc(100dvh - 230px);
  }

  .resource-file-actions .read-toggle {
    min-height: 32px;
    padding: 5px 7px;
    font-size: 12px;
  }

  .pdf-library-pane {
    height: 100%;
    padding: 10px;
    gap: 10px;
    border-right: 0;
  }

  .pdf-library-toolbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
  }

  .pdf-library-toolbar h2 {
    margin-bottom: 2px;
    font-size: 16px;
  }

  .pdf-library-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: stretch;
  }

  .pdf-search-box {
    width: 100%;
  }

  .pdf-status-tabs {
    overflow-x: auto;
  }

  .pdf-book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: max-content;
    gap: 12px;
    padding: 0 2px 22px;
  }

  .pdf-book-card {
    grid-template-rows: auto auto;
    height: max-content;
    align-self: start;
  }

  .pdf-book-open-button {
    gap: 6px;
  }

  .pdf-cover {
    width: 100%;
    min-height: 170px;
    border-radius: 7px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  }

  .pdf-cover img {
    min-height: 170px;
  }

  .pdf-book-title {
    min-height: 35px;
    font-size: 13px;
    line-height: 1.32;
  }

  .pdf-book-meta {
    font-size: 11px;
  }

  .pdf-book-download {
    min-height: 32px;
    font-size: 12px;
  }

  .pdf-book-delete {
    min-height: 32px;
  }

  .pdf-workspace.pdf-reader-open .pdf-reader-pane {
    display: flex;
    grid-column: 1;
  }

  .pdf-reader-pane .reader-toolbar {
    padding: 0 8px;
  }

  .pdf-reader-surface,
  .pdf-frame {
    min-height: 0;
    height: calc(100dvh - 44px);
  }

  .pdf-return-button,
  .pdf-toolbar-download {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .pdf-memory-pane {
    display: none;
  }

  .notebook-workbench,
  .web-reader-shell:has(.notebook-workbench) .notebook-workbench,
  .web-reader-shell:has(.notebook-workbench) .notebook-workbench.nav-collapsed,
  .web-reader-shell:has(.notebook-workbench) .notebook-workbench.notes-collapsed,
  .web-reader-shell:has(.notebook-workbench) .notebook-workbench.nav-collapsed.notes-collapsed,
  .notebook-workbench.nav-collapsed,
  .notebook-workbench.notes-collapsed,
  .notebook-workbench.nav-collapsed.notes-collapsed {
    height: 100%;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .notebook-nav-pane,
  .notebook-workbench .note-list-pane {
    min-height: 52px;
    max-height: 96px;
    border-right: 0;
    border-bottom: 1px solid #d7e0eb;
  }

  .notebook-nav-pane > header,
  .notebook-workbench .note-list-pane > header {
    display: none;
  }

  .notebook-workbench .notebook-list,
  .notebook-workbench .note-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 6px 8px;
  }

  .notebook-workbench .notebook-item,
  .notebook-workbench .note-card {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 8px 10px;
  }

  .notebook-workbench .notebook-item {
    min-width: 92px;
    max-width: 150px;
  }

  .notebook-workbench .note-card {
    width: 178px;
  }

  .notebook-workbench .note-card span,
  .notebook-workbench .note-card small {
    display: none;
  }

  .notebook-workbench.nav-collapsed .notebook-nav-pane,
  .web-reader-shell:has(.notebook-workbench) .notebook-workbench.nav-collapsed .notebook-nav-pane,
  .notebook-workbench.notes-collapsed .note-list-pane,
  .web-reader-shell:has(.notebook-workbench) .notebook-workbench.notes-collapsed .note-list-pane {
    min-height: 36px;
    max-height: 36px;
  }

  .notebook-workbench.nav-collapsed.notes-collapsed,
  .web-reader-shell:has(.notebook-workbench) .notebook-workbench.nav-collapsed.notes-collapsed {
    grid-template-rows: 36px 36px minmax(0, 1fr);
  }

  .notebook-workbench.nav-collapsed .notebook-list,
  .web-reader-shell:has(.notebook-workbench) .notebook-workbench.nav-collapsed .notebook-list,
  .notebook-workbench.notes-collapsed .note-list,
  .web-reader-shell:has(.notebook-workbench) .notebook-workbench.notes-collapsed .note-list {
    display: none;
  }

  .notebook-workbench .note-editor-pane > header {
    min-height: 42px;
    padding: 8px 10px;
  }

  .notebook-workbench .note-editor-pane > header p {
    display: none;
  }

  .notebook-workbench.mobile-read-only .note-readonly-view {
    padding: 12px 14px 34px;
    overflow: auto;
  }

  .notebook-workbench.mobile-read-only .note-readonly-view h3 {
    font-size: 17px;
  }

  .notebook-workbench.mobile-read-only .note-readonly-body {
    font-size: 16px;
    line-height: 1.72;
  }
}

@media (max-width: 380px) {
  .pdf-book-grid {
    gap: 10px;
  }

  .pdf-library-pane {
    padding: 8px;
  }

  .article-card h2,
  .pdf-book-title {
    font-size: 12px;
  }
}

/* Folder-style PDF library. The library keeps the existing drag ordering while
   presenting documents as compact file rows instead of delete-heavy cards. */
.pdf-folder-list {
  min-height: 0;
  flex: 1 1 0;
  height: auto;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 2px 4px 18px 0;
  overscroll-behavior-y: contain;
}

.pdf-folder {
  min-height: 0;
  flex: 0 0 auto;
  border: 1px solid #d8e1ed;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.pdf-folder-header {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid #e8eef5;
  background: #f7f9fc;
}

.pdf-folder-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #24415f;
}

.pdf-folder-heading svg {
  color: #d48a16;
}

.pdf-folder-heading h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}

.pdf-folder-heading > span {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 10px;
  background: #e8eef7;
  color: #5b6b80;
  font-size: 11px;
  text-align: center;
}

.pdf-folder-items {
  display: flex;
  flex-direction: column;
}

.pdf-file-row {
  min-width: 0;
  min-height: 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 12px;
  border-bottom: 1px solid #edf1f6;
  cursor: grab;
  transition: background 0.16s ease, opacity 0.16s ease;
}

.pdf-file-row:last-child {
  border-bottom: 0;
}

.pdf-file-row:hover,
.pdf-file-row.selected {
  background: #f5f8fc;
}

.pdf-file-row:active {
  cursor: grabbing;
}

.pdf-file-row.dragging {
  opacity: 0.55;
}

.pdf-file-open-button {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) minmax(72px, 0.35fr) minmax(110px, auto);
  align-items: center;
  gap: 10px;
  padding: 5px 4px;
  border: 0;
  background: transparent;
  color: #132033;
  text-align: left;
  font: inherit;
}

.pdf-file-icon {
  width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd8e8;
  border-radius: 5px;
  background: #f7faff;
  color: #d83b3b;
}

.pdf-file-name,
.pdf-file-category,
.pdf-file-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-file-name {
  font-weight: 700;
}

.pdf-file-category,
.pdf-file-meta {
  color: #667085;
  font-size: 12px;
}

.pdf-file-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pdf-file-move {
  max-width: 118px;
  height: 32px;
  padding: 0 24px 0 8px;
  border: 1px solid #c7d3e4;
  border-radius: 6px;
  background: #fff;
  color: #34516f;
  font: inherit;
  font-size: 12px;
}

.pdf-file-move:focus-visible,
.pdf-file-download:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.pdf-file-download {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #c7d3e4;
  border-radius: 6px;
  background: #fff;
  color: #34516f;
  text-decoration: none;
}

.pdf-file-download:hover {
  background: #edf4fc;
}

.pdf-file-row.opening .pdf-file-icon {
  border-color: #2563eb;
  color: #2563eb;
}

.pdf-library-browser {
  min-height: 0;
  flex: 1 1 0;
  height: auto;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.pdf-folder-sidebar {
  min-width: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid #d8e1ed;
  border-radius: 8px;
  background: #fff;
}

.pdf-folder-sidebar-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 2px;
  align-items: stretch;
}

.pdf-folder-sidebar-item > button:first-child {
  border-radius: 6px;
}

.pdf-folder-delete {
  width: 30px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #9a5c67;
}

.pdf-folder-delete:hover {
  background: #fff1f2;
  color: #c0263d;
}
.pdf-folder-sidebar button {
  min-width: 0;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 9px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #42556e;
  text-align: left;
  font: inherit;
}

.pdf-folder-sidebar button:hover,
.pdf-folder-sidebar button.active {
  background: #edf4fc;
  color: #1d4ed8;
}

.pdf-folder-sidebar button svg {
  color: #d48a16;
}

.pdf-folder-sidebar button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-folder-sidebar button strong {
  color: #7a889a;
  font-size: 11px;
}

.pdf-file-open-button {
  grid-template-columns: 30px 76px minmax(0, 1fr) minmax(72px, 0.35fr) minmax(110px, auto);
}

.pdf-file-thumbnail {
  width: 68px;
  height: 86px;
  display: block;
  overflow: hidden;
  border: 1px solid #cbd8e8;
  border-radius: 4px;
  background: #f7faff;
}

.pdf-file-thumbnail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.pdf-folder-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.34);
}

.pdf-folder-dialog {
  width: min(360px, 100%);
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid #d8e1ed;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
}

.pdf-folder-dialog h2 {
  margin: 0;
  color: #132033;
  font-size: 18px;
}

.pdf-folder-dialog input {
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid #c7d3e4;
  border-radius: 6px;
  font: inherit;
}

.pdf-folder-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 760px) {
  .pdf-library-browser {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .pdf-folder-sidebar {
    max-height: 132px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .pdf-folder-sidebar-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 2px;
  align-items: stretch;
}

.pdf-folder-sidebar-item > button:first-child {
  border-radius: 6px;
}

.pdf-folder-delete {
  width: 30px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #9a5c67;
}

.pdf-folder-delete:hover {
  background: #fff1f2;
  color: #c0263d;
}
.pdf-folder-sidebar button {
    min-width: 118px;
  }

  .pdf-file-open-button {
    grid-template-columns: 28px 58px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .pdf-file-thumbnail {
    width: 54px;
    height: 70px;
  }

  .pdf-file-category {
    display: none;
  }

  .pdf-file-name {
    grid-column: 3 / 5;
  }

  .pdf-file-meta {
    grid-column: 3;
  }
}

@media (max-width: 760px) {
  .pdf-folder-list {
    gap: 10px;
    padding-right: 0;
  }

  .pdf-folder-header {
    min-height: 38px;
    padding: 0 10px;
  }

  .pdf-file-actions {
    gap: 4px;
  }

  .pdf-file-move {
    width: 32px;
    max-width: 32px;
    padding: 0;
    color: transparent;
  }
  .pdf-file-row {
    min-height: 54px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .pdf-file-open-button {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .pdf-file-category {
    display: none;
  }

  .pdf-file-meta {
    grid-column: 2;
    grid-row: 2;
    font-size: 11px;
  }

  .pdf-file-name {
    grid-column: 2 / 4;
  }
}


/* Mobile read-only experience: final overrides. */
.mobile-reader-title,
.mobile-note-back {
  display: none;
}

@media (max-width: 760px) {
  body {
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
  }

  .web-reader-shell.mobile-viewport .hero-strip {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brand"
      "mode";
  }

  .web-reader-shell.mobile-viewport .brand-block {
    min-height: 32px;
  }

  .web-reader-shell.mobile-viewport .sort-toggle,
  .web-reader-shell.mobile-viewport .article-order-controls {
    display: none !important;
  }

  .web-reader-shell.mobile-filters-open .top-panel::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9;
    background: rgba(15, 23, 42, 0.34);
    pointer-events: none;
  }

  .filter-panel {
    border-radius: 12px 12px 0 0;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
    touch-action: pan-y;
  }

  .filter-panel button {
    pointer-events: auto;
    touch-action: manipulation;
  }

  .mobile-filter-head {
    position: sticky;
    top: -10px;
    z-index: 1;
    min-height: 44px;
    padding: 8px 0 6px;
    background: #fff;
  }

  .article-pane {
    padding: 8px 8px calc(12px + env(safe-area-inset-bottom));
  }

  .article-list {
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .article-card {
    min-height: 120px;
    padding: 11px;
    border-color: #d6dfeb;
    border-radius: 7px;
    background: #fff;
  }

  .article-card.selected {
    border-color: #2f67ea;
    background: #f4f7ff;
  }

  .article-card h2,
  .article-title {
    font-size: 16px;
    line-height: 1.38;
    -webkit-line-clamp: 2;
  }

  .article-excerpt {
    display: -webkit-box;
    color: #475467;
    font-size: 13px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .article-tags {
    color: #667085;
    font-size: 12px;
  }

  .article-state {
    min-height: 24px;
    align-items: center;
  }

  .article-progress {
    font-size: 12px;
  }

  .web-reader-shell.mobile-reading .reader-toolbar {
    position: relative;
    display: flex;
    gap: 6px;
    height: 48px;
    min-height: 48px;
    padding: 4px 8px 6px;
    overflow: hidden;
    border-bottom: 1px solid #e1e7ef;
    background: rgba(255, 255, 255, 0.98);
  }

  .mobile-back-button {
    min-width: 66px;
    min-height: 38px;
    padding: 7px 8px;
  }

  .mobile-reader-title {
    display: block;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    color: #172033;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .web-reader-shell.mobile-reading .reader-toolbar .read-toggle,
  .web-reader-shell.mobile-reading .reader-priority-controls,
  .web-reader-shell.mobile-reading .progress-label {
    display: none;
  }

  .web-reader-shell.mobile-reading .reader-toolbar .reader-action {
    width: 40px;
    min-width: 40px;
    min-height: 38px;
    padding: 0;
    gap: 0;
    overflow: hidden;
    color: transparent;
    font-size: 0;
  }

  .web-reader-shell.mobile-reading .reader-toolbar .reader-action svg {
    color: #344054;
  }

  .web-reader-shell.mobile-reading .reader-toolbar .article-pdf-download {
    display: inline-flex;
    width: 40px;
    min-width: 40px;
    min-height: 38px;
    flex: 0 0 40px;
    padding: 0;
  }

  .web-reader-shell.mobile-reading .answer-toggle {
    min-width: 44px;
    min-height: 38px;
    padding: 6px 8px;
  }

  .web-reader-shell.mobile-reading .progress-track {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    min-width: 0;
    height: 3px;
    flex: none;
    border-radius: 0;
  }

  .reader-surface,
  .reader-frame-wrap,
  .reader-frame-wrap iframe {
    height: calc(100dvh - 48px);
  }

  .reader-frame-wrap iframe {
    width: 100%;
    background: #fff;
    overscroll-behavior: contain;
  }

  .answer-pane {
    width: 100vw;
    box-shadow: none;
  }

  .pdf-book-grid {
    align-items: start;
  }

  .pdf-cover {
    aspect-ratio: 3 / 4;
    min-height: 0;
  }

  .pdf-cover img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
  }

  .pdf-book-download {
    min-height: 38px;
  }

  .pdf-book-delete {
    min-height: 38px;
  }

  .pdf-reader-pane .reader-toolbar {
    height: 46px;
    min-height: 46px;
    gap: 6px;
    padding: 4px 8px;
    overflow-x: auto;
  }

  .pdf-reader-surface {
    height: calc(100dvh - 46px);
    padding: 0;
    overflow: hidden;
    background: #e9edf3;
  }

  .mobile-pdf-reader {
    height: 100%;
    display: grid;
    grid-template-rows: 46px minmax(0, 1fr);
    overflow: hidden;
    background: #e9edf3;
  }

  .mobile-pdf-pagebar {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 4px 6px;
    border-bottom: 1px solid #d5dde8;
    background: #fff;
  }

  .mobile-pdf-pagebar button {
    width: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
  }

  .mobile-pdf-page-count {
    min-width: 64px;
    color: #344054;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    text-align: center;
  }

  .mobile-pdf-pagebar-spacer {
    min-width: 4px;
    flex: 1 1 auto;
  }

  .mobile-pdf-outline-layer {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    justify-content: flex-start;
    background: rgba(15, 23, 42, 0.42);
  }

  .mobile-pdf-outline {
    width: min(88vw, 360px);
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    background: #fff;
    box-shadow: 12px 0 28px rgba(15, 23, 42, 0.22);
  }

  .mobile-pdf-outline > header {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px 8px 14px;
    border-bottom: 1px solid #d8e1ec;
  }

  .mobile-pdf-outline > header > div {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .mobile-pdf-outline > header strong {
    color: #172033;
    font-size: 17px;
  }

  .mobile-pdf-outline > header span {
    color: #667085;
    font-size: 12px;
  }

  .mobile-pdf-outline > header button {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .mobile-pdf-page-jump {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #e4e9f0;
  }

  .mobile-pdf-page-jump input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    box-sizing: border-box;
    border: 1px solid #b9c8dc;
    border-radius: 7px;
    padding: 8px 11px;
    font-size: 16px;
  }

  .mobile-pdf-page-jump button {
    min-height: 42px;
    padding: 7px 10px;
    background: #2563eb;
    color: #fff;
  }

  .mobile-pdf-outline-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-pdf-outline-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .mobile-pdf-outline-list li > button {
    width: 100%;
    min-height: 48px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    border: 0;
    border-bottom: 1px solid #edf0f5;
    border-radius: 0;
    padding-top: 8px;
    padding-right: 12px;
    padding-bottom: 8px;
    background: #fff;
    text-align: left;
  }

  .mobile-pdf-outline-list li > button:disabled {
    opacity: 0.72;
  }

  .mobile-pdf-outline-list li > button span {
    min-width: 0;
    color: #25344d;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  .mobile-pdf-outline-list li > button small {
    color: #667085;
    font-size: 11px;
    white-space: nowrap;
  }

  .mobile-pdf-outline-empty {
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px;
    color: #667085;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
  }

  .mobile-pdf-page-host {
    position: relative;
    min-height: 0;
    overflow: auto;
    padding: 10px;
    text-align: center;
    overscroll-behavior: contain;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-pdf-page-host canvas {
    display: block;
    max-width: none;
    margin: 0 auto 18px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.16);
  }

  .mobile-pdf-loading,
  .mobile-pdf-error {
    position: sticky;
    top: 10px;
    z-index: 1;
    width: fit-content;
    max-width: calc(100% - 20px);
    margin: 18px auto;
    padding: 10px 14px;
    border: 1px solid #cad5e3;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.96);
    color: #344054;
    font-size: 14px;
  }

  .mobile-pdf-loading {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-pdf-error {
    color: #b42318;
  }

  .spin {
    animation: mobile-reader-spin 900ms linear infinite;
  }

  .web-reader-shell:has(.notebook-workbench.mobile-note-reading) {
    grid-template-rows: minmax(0, 1fr);
  }

  .web-reader-shell:has(.notebook-workbench.mobile-note-reading) .top-panel {
    display: none;
  }

  .notebook-workbench.mobile-read-only {
    min-height: 0;
    height: 100%;
    background: #fff;
  }

  .notebook-workbench.mobile-read-only:not(.nav-collapsed) {
    grid-template-rows: minmax(0, 1fr);
  }

  .notebook-workbench.mobile-read-only:not(.nav-collapsed) .note-list-pane,
  .notebook-workbench.mobile-read-only:not(.nav-collapsed) .note-editor-pane {
    display: none;
  }

  .notebook-workbench.mobile-read-only:not(.nav-collapsed) .notebook-nav-pane {
    display: flex;
    min-height: 0;
    max-height: none;
    border-bottom: 0;
  }

  .notebook-workbench.mobile-read-only.nav-collapsed:not(.notes-collapsed) {
    grid-template-rows: 44px minmax(0, 1fr);
  }

  .notebook-workbench.mobile-read-only.nav-collapsed:not(.notes-collapsed) .note-editor-pane {
    display: none;
  }

  .notebook-workbench.mobile-read-only.nav-collapsed:not(.notes-collapsed) .notebook-nav-pane {
    min-height: 44px;
    max-height: 44px;
  }

  .notebook-workbench.mobile-read-only.nav-collapsed:not(.notes-collapsed) .note-list-pane {
    display: flex;
    min-height: 0;
    max-height: none;
    border-bottom: 0;
  }

  .notebook-workbench.mobile-read-only.mobile-note-reading {
    display: grid;
    min-height: 0;
    height: 100%;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }

  .notebook-workbench.mobile-read-only.mobile-note-reading .notebook-nav-pane,
  .notebook-workbench.mobile-read-only.mobile-note-reading .note-list-pane,
  .notebook-workbench.mobile-read-only.mobile-note-reading .notebook-column-resizer {
    display: none !important;
  }

  .notebook-workbench.mobile-read-only.mobile-note-reading .note-editor-pane {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100%;
    height: 100%;
  }

  .notebook-workbench.mobile-read-only .notebook-nav-pane > header,
  .notebook-workbench.mobile-read-only .note-list-pane > header {
    display: flex;
    min-height: 52px;
    padding: 9px 12px;
  }

  .notebook-workbench.mobile-read-only .notebook-list,
  .notebook-workbench.mobile-read-only .note-list {
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    padding: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .notebook-workbench.mobile-read-only .notebook-row,
  .notebook-workbench.mobile-read-only .note-row {
    width: 100%;
    flex: 0 0 auto;
  }

  .notebook-workbench.mobile-read-only .notebook-item,
  .notebook-workbench.mobile-read-only .note-card {
    width: 100%;
    max-width: none;
    min-height: 52px;
    padding: 11px 12px;
    text-align: left;
  }

  .notebook-workbench.mobile-read-only .note-card {
    min-height: 92px;
  }

  .notebook-workbench.mobile-read-only .note-card span,
  .notebook-workbench.mobile-read-only .note-card small {
    display: block;
  }

  .notebook-workbench.mobile-read-only .pane-collapsed-button {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
    gap: 8px;
    padding: 6px 12px;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #175cd3;
    font-weight: 700;
  }

  .notebook-workbench.mobile-read-only .note-editor-pane {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .notebook-workbench.mobile-read-only .note-editor-pane > header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    min-height: 50px;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.98);
  }

  .notebook-workbench.mobile-read-only .note-editor-pane > header > div {
    min-width: 0;
    flex: 1 1 auto;
  }

  .notebook-workbench.mobile-read-only .note-editor-pane > header h2 {
    overflow: hidden;
    font-size: 15px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-note-back {
    display: inline-flex;
    min-width: 88px;
    min-height: 38px;
    padding: 7px 8px;
  }

  .notebook-workbench.mobile-read-only .note-readonly-view {
    display: block;
    height: 100%;
    min-height: 0;
    padding: 14px 15px calc(46px + env(safe-area-inset-bottom));
    overflow: auto;
    overscroll-behavior: contain;
  }

  .notebook-workbench.mobile-read-only .note-readonly-view > h3 {
    margin: 0 0 14px;
    font-size: 21px;
    line-height: 1.38;
  }

  .notebook-workbench.mobile-read-only .note-readonly-body {
    color: #172033;
    font-size: 17px;
    line-height: 1.78;
    overflow-wrap: anywhere;
  }

  .notebook-workbench.mobile-read-only .note-readonly-body img,
  .notebook-workbench.mobile-read-only .note-readonly-body video,
  .notebook-workbench.mobile-read-only .note-readonly-body canvas,
  .notebook-workbench.mobile-read-only .note-readonly-body svg {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
  }

  .notebook-workbench.mobile-read-only .note-readonly-body table {
    display: block;
    width: max-content;
    min-width: 100%;
    max-width: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .notebook-workbench.mobile-read-only .note-inline-image {
    max-width: 100% !important;
    margin: 10px auto !important;
  }
}

@keyframes mobile-reader-spin {
  to { transform: rotate(360deg); }
}


.admin-shell{min-height:100dvh;background:#f4f7fb;padding:32px;display:flex;justify-content:center;box-sizing:border-box;overflow-y:auto;-webkit-overflow-scrolling:touch}.admin-card{width:min(460px,100%);background:#fff;border:1px solid #d5deec;border-radius:10px;padding:28px;box-shadow:0 12px 32px rgba(26,55,95,.08);max-height:none}.admin-wide{width:min(1100px,100%)}.admin-card h1{margin:0 0 8px;color:#10233f;font-size:24px}.admin-card p{color:#63728a}.admin-card label,.license-form label{display:flex;flex-direction:column;gap:7px;margin:14px 0;color:#44536a}.admin-card input,.license-form input{border:1px solid #c7d5e8;border-radius:7px;padding:10px 12px;font-size:15px}.admin-header{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:1px solid #e3e9f2;padding-bottom:18px}.admin-header a{color:#2563eb}.license-form{display:grid;grid-template-columns:1.3fr .7fr 1.3fr auto;gap:14px;align-items:end;margin:20px 0}.license-form label{margin:0}.license-form .primary-button{height:40px;white-space:nowrap}.created-license{background:#eaf8f1;border:1px solid #a9dfc3;padding:12px;border-radius:7px;color:#12633c;margin:12px 0}.created-license button,.license-row button{margin-left:8px;border:1px solid #bfd0e5;background:#fff;border-radius:5px;padding:5px 9px;cursor:pointer}.license-table{border:1px solid #dbe4f0;border-radius:8px;overflow:hidden}.license-row{display:grid;grid-template-columns:1.1fr 1.2fr 1.4fr .6fr 1.3fr;gap:10px;padding:11px 12px;border-top:1px solid #e8eef6;align-items:center;color:#33445b;font-size:14px}.license-head{border-top:0;background:#f4f7fb;font-weight:600;color:#182c49}.auth-dialog small{color:#6d7d94}@media(max-width:700px){.admin-shell{padding:16px;align-items:flex-start}.admin-card{padding:20px;max-height:none}.license-form{grid-template-columns:1fr 1fr}.license-form label:nth-child(3){grid-column:1/-1}.license-form .primary-button{grid-column:1/-1}.admin-header{gap:12px}.license-table{overflow:auto}.license-row{min-width:720px}.admin-section{padding:16px 0}.email-settings-form{grid-template-columns:1fr}.email-settings-form .email-enabled,.email-settings-actions{grid-column:1}.email-settings-actions{flex-direction:column}.email-log-row{min-width:760px}}
.admin-inline-button{margin-top:4px;border:1px solid #bfd0e5;background:#fff;border-radius:5px;padding:5px 9px;cursor:pointer}.license-row small{display:block;color:#71819a;font-size:12px;margin-top:4px}.online-state,.offline-state{display:inline-block!important;margin-top:6px!important;width:max-content;padding:2px 7px;border-radius:10px}.online-state{background:#dff7e8;color:#16834a}.offline-state{background:#edf1f6;color:#75849a}.license-actions{display:flex;flex-wrap:wrap;gap:5px}.license-actions button{margin-left:0}.license-actions input{width:70px;border:1px solid #bfd0e5;border-radius:5px;padding:5px}.license-actions input[type=datetime-local]{width:180px}@media(max-width:900px){.license-row{min-width:1050px}}

.admin-mode-link{color:#fff;font-size:13px;text-decoration:underline;opacity:.9;margin-left:8px;white-space:nowrap}.admin-mode-link:hover{opacity:1}

.category3-inline-add{display:flex;gap:6px;align-items:center;width:100%;margin-top:6px}.category3-inline-add input{min-width:0;flex:1;border:1px solid #c8d6e8;border-radius:6px;padding:7px 9px;font-size:14px}.category3-inline-add button{border:1px solid #2f67df;background:#2f67df;color:#fff;border-radius:6px;padding:7px 12px;white-space:nowrap;cursor:pointer}@media(max-width:720px){.category3-inline-add{flex-basis:100%}.category3-inline-add input{font-size:16px}}


.admin-section{padding:22px 0;border-bottom:1px solid #e3e9f2}.admin-section:last-child{border-bottom:0}.admin-section h2{margin:0 0 8px;color:#172b49;font-size:19px}.admin-section-note{margin:0 0 16px}.admin-notice{padding:10px 12px;border:1px solid #9bc2f8;border-radius:7px;background:#eff6ff;color:#1d4ed8}.email-settings-form{display:grid;grid-template-columns:1fr 120px 1fr;gap:14px}.email-settings-form label{margin:0}.email-settings-form .email-enabled{grid-column:1/-1;display:flex;flex-direction:row;align-items:center}.email-settings-form .email-enabled input{width:18px;height:18px;margin:0}.email-settings-actions{grid-column:1/-1;display:flex;gap:10px}.admin-section-header{display:flex;align-items:center;justify-content:space-between}.email-log-table{border:1px solid #dbe4f0;border-radius:8px;overflow:auto}.email-log-row{min-width:850px;display:grid;grid-template-columns:160px minmax(220px,1fr) 180px 80px minmax(180px,1fr);gap:10px;padding:10px 12px;border-top:1px solid #e8eef6;align-items:center;font-size:13px}.email-log-head{border-top:0;background:#f4f7fb;font-weight:700}.email-log-row span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.email-log-status.sent{color:#087443}.email-log-status.failed{color:#c62828}.email-log-status.sending{color:#b45309}.email-log-empty{padding:12px;margin:0!important}@media(max-width:760px){.email-settings-form{grid-template-columns:1fr}.email-settings-form .email-enabled,.email-settings-actions{grid-column:1}.email-settings-actions{flex-direction:column}.admin-section{padding:18px 0}}


@media (max-width: 760px) {
  html.admin-page,
  html.admin-page body,
  html.admin-page #root {
    height: auto !important;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  html.admin-page body {
    overscroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
  }

  html.admin-page .admin-shell {
    min-height: 100dvh;
    height: auto;
    overflow: visible;
    align-items: flex-start;
  }
}

.batch-email-form{display:grid;grid-template-columns:1fr 1fr;gap:14px;align-items:end}.batch-email-form label{display:flex;flex-direction:column;gap:7px;margin:0;color:#44536a}.batch-email-form select,.batch-email-form input{border:1px solid #c7d5e8;border-radius:7px;padding:10px 12px;font-size:15px;background:#fff}.batch-email-actions{grid-column:1/-1;display:flex;gap:10px;flex-wrap:wrap}.batch-email-actions button{min-height:40px}@media(max-width:700px){.batch-email-form{grid-template-columns:1fr}.batch-email-actions{grid-column:1;flex-direction:column}.batch-email-actions button{width:100%}}
/* Admin workspace refresh */
html.admin-page .admin-shell{background:#eef3f8;padding:24px;align-items:flex-start;justify-content:center}
html.admin-page .admin-card.admin-wide{width:min(1480px,100%);padding:0;background:transparent;border:0;box-shadow:none}
html.admin-page .admin-header{background:#fff;border:1px solid #d7e1ee;border-radius:12px;padding:22px 26px;box-shadow:0 5px 18px rgba(33,62,95,.06);align-items:center}
html.admin-page .admin-header h1{font-size:25px;letter-spacing:0}
html.admin-page .admin-header p{margin:6px 0 0;font-size:14px}
html.admin-page .admin-header a{border:1px solid #c7d6e8;border-radius:7px;padding:9px 13px;text-decoration:none;background:#f8fbff;white-space:nowrap}
html.admin-page .admin-dashboard{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:16px;align-items:start;margin-top:16px}
html.admin-page .admin-section{min-width:0;margin:0;padding:22px;background:#fff;border:1px solid #d7e1ee;border-radius:12px;box-shadow:0 5px 18px rgba(33,62,95,.045)}
html.admin-page .admin-section h2{font-size:18px;line-height:1.3;margin:0 0 7px;color:#142b49}
html.admin-page .admin-section-note{font-size:13px;line-height:1.55;margin:0 0 16px}
html.admin-page .admin-license-section{grid-column:1/-1}
html.admin-page .admin-email-settings-section{grid-column:1}
html.admin-page .admin-sender-section{grid-column:2}
html.admin-page .admin-batch-section{grid-column:1}
html.admin-page .admin-log-section{grid-column:2}
html.admin-page .license-form{grid-template-columns:minmax(180px,1.1fr) 120px minmax(220px,1.35fr) auto;gap:12px;margin:18px 0}
html.admin-page .license-form label,html.admin-page .email-settings-form label,html.admin-page .sender-pool-form label,html.admin-page .batch-email-form label{font-size:13px;font-weight:600;color:#52647b}
html.admin-page .admin-card input,html.admin-page .admin-card select,html.admin-page .license-form input,html.admin-page .email-settings-form input,html.admin-page .sender-pool-form input,html.admin-page .sender-pool-form select,html.admin-page .batch-email-form input,html.admin-page .batch-email-form select{min-height:42px;box-sizing:border-box;border:1px solid #c9d7e8;border-radius:7px;background:#fff;color:#1b304c;padding:9px 11px;font-size:14px;outline:none}
html.admin-page .admin-card input:focus,html.admin-page .admin-card select:focus{border-color:#4d82ea;box-shadow:0 0 0 3px rgba(77,130,234,.14)}
html.admin-page .license-table,html.admin-page .email-log-table{border-color:#d7e1ee;background:#fff}
html.admin-page .license-row{grid-template-columns:1.05fr 1fr 1.15fr .65fr 1.5fr;padding:13px 14px}
html.admin-page .license-head{background:#f4f7fb;color:#304967;font-size:12px;text-transform:none}
html.admin-page .license-actions{gap:6px}
html.admin-page .license-actions button,html.admin-page .sender-pool-row button,html.admin-page .admin-section-header button{border:1px solid #c8d6e7;background:#fff;color:#2a4b70;border-radius:6px;padding:7px 10px;font-size:12px;cursor:pointer}
html.admin-page .license-actions button:hover,html.admin-page .sender-pool-row button:hover,html.admin-page .admin-section-header button:hover{border-color:#4d82ea;color:#2563eb;background:#f5f9ff}
html.admin-page .license-actions button:last-child,html.admin-page .sender-pool-row button:last-child{color:#b42318;border-color:#efc3c0}
html.admin-page .primary-button{min-height:42px;border-radius:7px;font-weight:650}
html.admin-page .email-settings-form{grid-template-columns:minmax(0,1fr) 100px;gap:12px}
html.admin-page .email-settings-form .email-enabled,html.admin-page .email-settings-actions{grid-column:1/-1}
html.admin-page .email-settings-form .email-enabled{padding:9px 11px;border:1px solid #d8e5f2;border-radius:7px;background:#f7fbff}
html.admin-page .email-settings-actions{align-items:center}
html.admin-page .sender-pool-form{display:grid;grid-template-columns:110px minmax(0,1fr);gap:10px 12px;align-items:end}
html.admin-page .sender-pool-form label:nth-child(3),html.admin-page .sender-pool-form label:nth-child(4),html.admin-page .sender-pool-form label:nth-child(5),html.admin-page .sender-pool-form button{grid-column:1/-1}
html.admin-page .sender-pool-list{display:grid;gap:9px;margin-top:16px}
html.admin-page .sender-pool-row{display:flex;gap:12px;justify-content:space-between;align-items:center;padding:12px 13px;border:1px solid #d8e4f0;border-radius:8px;background:#f8fbff}
html.admin-page .sender-pool-row.disabled{background:#fafafa;opacity:.7}
html.admin-page .sender-pool-row>div:first-child{min-width:0;display:grid;gap:3px}
html.admin-page .sender-pool-row strong{color:#183554;font-size:14px}
html.admin-page .sender-pool-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#315474;font-size:13px}
html.admin-page .sender-pool-row small{color:#74869c;font-size:12px}
html.admin-page .sender-pool-row>div:last-child{display:flex;gap:6px;flex:none}
html.admin-page .batch-email-form{grid-template-columns:1fr;gap:12px}
html.admin-page .batch-email-actions{gap:8px}
html.admin-page .batch-email-actions button{flex:1}
html.admin-page .email-log-row{min-width:0;grid-template-columns:116px minmax(130px,1fr) minmax(130px,1fr) 58px minmax(90px,1fr);padding:10px 11px;gap:8px;font-size:12px}
html.admin-page .admin-notice{font-size:13px;line-height:1.45}
@media(max-width:1050px){html.admin-page .admin-dashboard{grid-template-columns:1fr}html.admin-page .admin-license-section,html.admin-page .admin-email-settings-section,html.admin-page .admin-sender-section,html.admin-page .admin-batch-section,html.admin-page .admin-log-section{grid-column:1}}
@media(max-width:700px){html.admin-page .admin-shell{padding:10px;background:#eef3f8}html.admin-page .admin-header{padding:16px;align-items:flex-start}html.admin-page .admin-header h1{font-size:20px}html.admin-page .admin-header a{font-size:12px;padding:7px 9px}html.admin-page .admin-dashboard{gap:10px;margin-top:10px}html.admin-page .admin-section{padding:16px;border-radius:10px}html.admin-page .license-form{grid-template-columns:1fr;gap:9px}html.admin-page .license-form label:nth-child(3),html.admin-page .license-form .primary-button{grid-column:auto}html.admin-page .license-table{border:0;overflow:visible;background:transparent}html.admin-page .license-head{display:none}html.admin-page .license-row{min-width:0;display:grid;grid-template-columns:1fr 1fr;gap:9px;padding:13px 0;border:1px solid #d7e1ee;border-radius:8px;background:#fbfdff;margin-top:9px;font-size:13px}html.admin-page .license-row>span{padding:0 11px}html.admin-page .license-row>span:nth-child(3),html.admin-page .license-row>span:nth-child(4),html.admin-page .license-row>span:nth-child(5){grid-column:1/-1}html.admin-page .license-actions{padding:0 11px;display:grid;grid-template-columns:1fr 1fr;gap:7px}html.admin-page .license-actions select,html.admin-page .license-actions input,html.admin-page .license-actions button{width:100%;margin:0;min-height:38px}html.admin-page .license-actions input[type=datetime-local]{width:100%}html.admin-page .email-settings-form{grid-template-columns:1fr}html.admin-page .email-settings-form .email-enabled,html.admin-page .email-settings-actions{grid-column:1}html.admin-page .email-settings-actions{display:grid;grid-template-columns:1fr}html.admin-page .sender-pool-form{grid-template-columns:1fr}html.admin-page .sender-pool-form label:nth-child(3),html.admin-page .sender-pool-form label:nth-child(4),html.admin-page .sender-pool-form label:nth-child(5),html.admin-page .sender-pool-form button{grid-column:auto}html.admin-page .sender-pool-row{align-items:flex-start;flex-direction:column}html.admin-page .sender-pool-row>div:last-child{width:100%}html.admin-page .sender-pool-row button{flex:1}html.admin-page .batch-email-actions{display:grid;grid-template-columns:1fr}html.admin-page .email-log-table{border:0;overflow:visible;background:transparent}html.admin-page .email-log-row{min-width:0;display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:11px;border:1px solid #d7e1ee;border-radius:8px;background:#fbfdff;margin-top:8px}html.admin-page .email-log-head{display:none}html.admin-page .email-log-row span{white-space:normal;overflow:visible;text-overflow:clip}html.admin-page .email-log-row span:nth-child(2),html.admin-page .email-log-row span:nth-child(5){grid-column:1/-1}}
/* Unified email settings */
html.admin-page .admin-email-section{grid-column:1/-1}
html.admin-page .admin-email-title{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
html.admin-page .admin-email-badge{flex:none;border:1px solid #b9dfca;border-radius:999px;background:#effaf3;color:#147642;padding:6px 10px;font-size:12px;white-space:nowrap}
html.admin-page .email-global-form{display:grid;grid-template-columns:minmax(260px,1fr) minmax(300px,1.2fr) auto;gap:12px;align-items:end;padding:14px;background:#f7fbff;border:1px solid #d9e6f3;border-radius:9px}
html.admin-page .email-global-form label{margin:0}
html.admin-page .email-global-form .email-enabled{display:flex;flex-direction:row;align-items:center;gap:8px;min-height:42px}
html.admin-page .email-global-form .email-enabled input{width:18px;min-height:18px}
html.admin-page .email-global-form .email-settings-actions{grid-column:auto;display:flex;gap:8px}
html.admin-page .email-sender-divider{display:flex;justify-content:space-between;align-items:baseline;border-bottom:1px solid #e0e8f1;margin:20px 0 14px;padding-bottom:9px}
html.admin-page .email-sender-divider h3{margin:0;color:#173553;font-size:15px}
html.admin-page .email-sender-divider span{color:#71839a;font-size:12px}
html.admin-page .admin-email-section .sender-pool-form{grid-template-columns:110px 1fr 1.3fr 1fr 1fr auto}
html.admin-page .admin-email-section .sender-pool-form label:nth-child(3),html.admin-page .admin-email-section .sender-pool-form label:nth-child(4),html.admin-page .admin-email-section .sender-pool-form label:nth-child(5),html.admin-page .admin-email-section .sender-pool-form button{grid-column:auto}
html.admin-page .admin-email-section .sender-pool-form button{min-height:42px;white-space:nowrap}
html.admin-page .admin-email-section .sender-pool-list{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:1050px){html.admin-page .admin-email-section .sender-pool-form{grid-template-columns:1fr 1fr}html.admin-page .admin-email-section .sender-pool-form label:nth-child(3),html.admin-page .admin-email-section .sender-pool-form label:nth-child(4),html.admin-page .admin-email-section .sender-pool-form label:nth-child(5),html.admin-page .admin-email-section .sender-pool-form button{grid-column:1/-1}}
@media(max-width:700px){html.admin-page .admin-email-title{gap:8px}html.admin-page .admin-email-badge{font-size:11px;padding:5px 8px}html.admin-page .email-global-form{grid-template-columns:1fr;padding:12px}html.admin-page .email-global-form .email-settings-actions{grid-column:1;display:grid;grid-template-columns:1fr}html.admin-page .admin-email-section .sender-pool-form{grid-template-columns:1fr}html.admin-page .admin-email-section .sender-pool-form label:nth-child(3),html.admin-page .admin-email-section .sender-pool-form label:nth-child(4),html.admin-page .admin-email-section .sender-pool-form label:nth-child(5),html.admin-page .admin-email-section .sender-pool-form button{grid-column:auto}html.admin-page .admin-email-section .sender-pool-list{grid-template-columns:1fr}}

/* PDF library scrolling: keep the document list independently scrollable. */
.web-reader-shell.pdf-mode .pdf-library-pane {
  min-height: 0;
}

.web-reader-shell.pdf-mode .pdf-library-browser {
  min-height: 0;
  height: auto;
}

.web-reader-shell.pdf-mode .pdf-folder-list {
  min-height: 120px;
  height: auto;
  max-height: calc(100dvh - 250px);
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.web-reader-shell.pdf-mode .pdf-folder-items {
  min-height: 0;
}

/* Desktop PDF list gets a definite scroll viewport. */
@media (min-width: 761px) {
  .web-reader-shell.pdf-mode .pdf-library-browser { position: relative; }
  .web-reader-shell.pdf-mode .pdf-folder-list {
    position: absolute;
    inset: 0 0 0 204px;
    width: auto;
    max-height: none;
    min-height: 0;
    height: auto;
  }
}

/*test*/
/*grid*/
﻿/* PDF folder-first bookshelf */
.pdf-grid-browser{display:block;overflow:auto;min-height:0;padding:24px}.pdf-grid-toolbar{align-items:flex-start;gap:18px}.pdf-grid-title{display:flex;align-items:center;gap:10px;min-width:0}.pdf-grid-title h2{margin:0}.pdf-grid-title p{margin:4px 0 0}.pdf-grid-back{width:36px;height:36px;display:grid;place-items:center;border:1px solid var(--line,#d9dee8);background:var(--surface,#fff);color:inherit;border-radius:8px;cursor:pointer}.pdf-grid-actions{flex-wrap:wrap;justify-content:flex-end}.pdf-selection-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.pdf-toolbar-move{min-height:36px;max-width:170px}.pdf-danger-action{color:#b42318}.pdf-folder-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:18px;align-content:start}.pdf-folder-tile-wrap{position:relative;min-width:0}.pdf-folder-tile{width:100%;min-height:170px;padding:22px 14px 18px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;border:1px solid #dfe4ec;border-radius:10px;background:#fff;color:#243047;cursor:pointer;box-shadow:0 2px 8px rgba(24,39,75,.05);transition:border-color .15s,box-shadow .15s,transform .15s}.pdf-folder-tile:hover,.pdf-folder-tile:focus-visible{border-color:#7b8cff;box-shadow:0 8px 20px rgba(34,52,110,.12);transform:translateY(-2px);outline:none}.pdf-folder-tile svg{color:#d79a25;fill:#f8d67a}.pdf-folder-tile strong{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px}.pdf-folder-tile span{color:#718096;font-size:12px}.pdf-folder-tile-delete{position:absolute;top:8px;right:8px;width:30px;height:30px;display:grid;place-items:center;border:0;background:transparent;color:#8b95a7;cursor:pointer;border-radius:6px}.pdf-folder-tile-delete:hover{color:#b42318;background:#fff1f0}.pdf-cover-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:18px;align-content:start}.pdf-cover-card{min-width:0;border:1px solid #dfe4ec;border-radius:10px;background:#fff;padding:10px;cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .15s}.pdf-cover-card:hover{border-color:#9aa7bd;box-shadow:0 8px 18px rgba(24,39,75,.1);transform:translateY(-2px)}.pdf-cover-card.selected{border-color:#4b63d3;box-shadow:0 0 0 2px rgba(75,99,211,.16)}.pdf-cover-open{width:100%;padding:0;display:flex;flex-direction:column;align-items:stretch;gap:8px;border:0;background:transparent;color:inherit;text-align:left;cursor:pointer}.pdf-cover-thumbnail{display:block;aspect-ratio:3/4;overflow:hidden;border-radius:6px;background:#eef1f6}.pdf-cover-thumbnail img{width:100%;height:100%;object-fit:cover;display:block}.pdf-cover-name{min-height:38px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;line-height:1.35;font-size:13px}.pdf-cover-meta{color:#718096;font-size:11px}@media(max-width:760px){.pdf-grid-toolbar{align-items:stretch;flex-direction:column}.pdf-grid-actions{justify-content:flex-start;gap:8px}.pdf-grid-browser{padding:14px}.pdf-folder-grid,.pdf-cover-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.pdf-folder-tile{min-height:132px;padding:14px 8px}.pdf-folder-tile svg{width:42px;height:42px}.pdf-selection-actions{width:100%}.pdf-selection-actions .read-toggle,.pdf-toolbar-move{flex:1 1 auto;min-width:0}.pdf-cover-card{padding:8px}}
﻿/* PDF folder-first bookshelf */
.pdf-grid-browser{display:block;overflow:auto;min-height:0;padding:24px}.pdf-grid-toolbar{align-items:flex-start;gap:18px}.pdf-grid-title{display:flex;align-items:center;gap:10px;min-width:0}.pdf-grid-title h2{margin:0}.pdf-grid-title p{margin:4px 0 0}.pdf-grid-back{width:36px;height:36px;display:grid;place-items:center;border:1px solid var(--line,#d9dee8);background:var(--surface,#fff);color:inherit;border-radius:8px;cursor:pointer}.pdf-grid-actions{flex-wrap:wrap;justify-content:flex-end}.pdf-selection-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.pdf-toolbar-move{min-height:36px;max-width:170px}.pdf-danger-action{color:#b42318}.pdf-folder-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:18px;align-content:start}.pdf-folder-tile-wrap{position:relative;min-width:0}.pdf-folder-tile{width:100%;min-height:170px;padding:22px 14px 18px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;border:1px solid #dfe4ec;border-radius:10px;background:#fff;color:#243047;cursor:pointer;box-shadow:0 2px 8px rgba(24,39,75,.05);transition:border-color .15s,box-shadow .15s,transform .15s}.pdf-folder-tile:hover,.pdf-folder-tile:focus-visible{border-color:#7b8cff;box-shadow:0 8px 20px rgba(34,52,110,.12);transform:translateY(-2px);outline:none}.pdf-folder-tile svg{color:#d79a25;fill:#f8d67a}.pdf-folder-tile strong{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px}.pdf-folder-tile span{color:#718096;font-size:12px}.pdf-folder-tile-delete{position:absolute;top:8px;right:8px;width:30px;height:30px;display:grid;place-items:center;border:0;background:transparent;color:#8b95a7;cursor:pointer;border-radius:6px}.pdf-folder-tile-delete:hover{color:#b42318;background:#fff1f0}.pdf-cover-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:18px;align-content:start}.pdf-cover-card{min-width:0;border:1px solid #dfe4ec;border-radius:10px;background:#fff;padding:10px;cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .15s}.pdf-cover-card:hover{border-color:#9aa7bd;box-shadow:0 8px 18px rgba(24,39,75,.1);transform:translateY(-2px)}.pdf-cover-card.selected{border-color:#4b63d3;box-shadow:0 0 0 2px rgba(75,99,211,.16)}.pdf-cover-open{width:100%;padding:0;display:flex;flex-direction:column;align-items:stretch;gap:8px;border:0;background:transparent;color:inherit;text-align:left;cursor:pointer}.pdf-cover-thumbnail{display:block;aspect-ratio:3/4;overflow:hidden;border-radius:6px;background:#eef1f6}.pdf-cover-thumbnail img{width:100%;height:100%;object-fit:cover;display:block}.pdf-cover-name{min-height:38px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;line-height:1.35;font-size:13px}.pdf-cover-meta{color:#718096;font-size:11px}@media(max-width:760px){.pdf-grid-toolbar{align-items:stretch;flex-direction:column}.pdf-grid-actions{justify-content:flex-start;gap:8px}.pdf-grid-browser{padding:14px}.pdf-folder-grid,.pdf-cover-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.pdf-folder-tile{min-height:132px;padding:14px 8px}.pdf-folder-tile svg{width:42px;height:42px}.pdf-selection-actions{width:100%}.pdf-selection-actions .read-toggle,.pdf-toolbar-move{flex:1 1 auto;min-width:0}.pdf-cover-card{padding:8px}}
﻿/* Two-column PDF shelf: folders stay visible while the current folder shows covers. */
.pdf-two-column-library { display:grid; grid-template-columns:220px minmax(0,1fr); min-height:0; height:100%; }
.pdf-folder-sidebar-fixed { min-width:0; overflow:auto; border-right:1px solid #dbe2ec; padding:14px 10px; background:#f7f9fc; }
.pdf-sidebar-heading { display:flex; align-items:center; gap:8px; padding:4px 8px 14px; color:#243047; }
.pdf-folder-sidebar-fixed > button:not(.pdf-sidebar-new-folder), .pdf-folder-sidebar-fixed .pdf-folder-sidebar-item > button:first-child { width:100%; min-height:38px; display:flex; align-items:center; gap:8px; border:0; background:transparent; border-radius:7px; padding:8px; color:#536176; text-align:left; cursor:pointer; }
.pdf-folder-sidebar-fixed > button:not(.pdf-sidebar-new-folder):hover, .pdf-folder-sidebar-fixed .pdf-folder-sidebar-item > button:first-child:hover, .pdf-folder-sidebar-fixed > button.active, .pdf-folder-sidebar-fixed .pdf-folder-sidebar-item > button:first-child.active { background:#e7edff; color:#2744b8; }
.pdf-folder-sidebar-fixed button span { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pdf-folder-sidebar-fixed button strong { font-size:12px; color:#8490a4; }
.pdf-folder-sidebar-fixed .pdf-folder-sidebar-item { display:flex; align-items:center; gap:2px; }
.pdf-folder-sidebar-fixed .pdf-folder-sidebar-item > button:first-child { flex:1; }
.pdf-folder-sidebar-fixed .pdf-folder-delete { width:30px; height:30px; flex:0 0 30px; }
.pdf-sidebar-new-folder { width:100%; margin-top:14px; display:flex; align-items:center; justify-content:center; gap:6px; min-height:36px; border:1px dashed #aab6c9; border-radius:7px; background:#fff; color:#536176; cursor:pointer; }
.pdf-library-main { min-width:0; min-height:0; display:flex; flex-direction:column; }
.pdf-two-column-toolbar { flex:0 0 auto; }
.pdf-two-column-browser { flex:1 1 auto; min-height:0; overflow:auto; }
.pdf-reader-fullscreen { position:absolute; inset:0; z-index:30; display:flex; flex-direction:column; background:#eef2f7; }
.pdf-reader-fullscreen .pdf-reader-surface { flex:1 1 auto; min-height:0; }
.pdf-reader-fullscreen .pdf-reader-surface iframe { width:100%; height:100%; border:0; display:block; }
@media (max-width:760px) { .pdf-two-column-library { grid-template-columns:132px minmax(0,1fr); } .pdf-folder-sidebar-fixed { padding:10px 6px; } .pdf-sidebar-heading { padding:4px 5px 10px; font-size:13px; } .pdf-folder-sidebar-fixed > button:not(.pdf-sidebar-new-folder), .pdf-folder-sidebar-fixed .pdf-folder-sidebar-item > button:first-child { padding:7px 5px; gap:5px; font-size:12px; } .pdf-folder-sidebar-fixed svg { width:15px; height:15px; flex:0 0 15px; } .pdf-two-column-toolbar { padding:10px; } .pdf-two-column-toolbar .pdf-grid-actions { flex-wrap:wrap; } .pdf-two-column-browser { padding:10px; } }
