/* All rules are local to the granthalaya. Existing app palettes stay intact. */
#app #granthLibrary{background:#f7f1e7;color:#382e29;--gl-maroon:#713043;--gl-ink:#382e29;--gl-muted:#68594e;--gl-border:#d9c8b2}
#app #granthLibraryRoot{padding:20px 18px 112px;line-height:1.7;overflow-wrap:anywhere}
#app #granthLibraryRoot *{box-sizing:border-box}
#app #granthLibraryRoot :is(h1,h2,h3,p){margin:0}
#app #granthLibraryRoot :is(button,a,input){font:inherit;touch-action:manipulation}
#app #granthLibraryRoot button{cursor:pointer;width:auto;min-width:0;max-width:100%}
#app #granthLibraryRoot :is(button,a,input):focus-visible{outline:3px solid #98572b;outline-offset:3px}
#app #granthLibraryRoot :is(.gl-topline,.gl-section-heading){display:flex;align-items:center;justify-content:space-between;gap:12px}
#app #granthLibraryRoot .gl-topline{margin-bottom:16px;font-size:.74rem;color:#68594e}
#app #granthLibraryRoot .gl-back{background:#fffaf1;color:#713043;border:1px solid #cbb79c;border-radius:11px;min-height:44px;padding:7px 13px;font-size:.82rem;font-weight:700;flex-shrink:0}
#app #granthLibraryRoot .gl-hero{background:#713043;color:#fff4dc;padding:22px 20px 16px;border-radius:22px;display:block;position:relative;box-shadow:0 8px 18px #71304312;text-align:left}
#app #granthLibraryRoot .gl-hero>div:first-child{padding-right:68px;min-width:0}
#app #granthLibraryRoot .gl-hero small{color:#f0d7ae;letter-spacing:.04em;font-size:.77rem}
#app #granthLibraryRoot .gl-hero h1{color:#fff4dc;font-size:1.7rem;line-height:1.5;margin:5px 0 9px;font-weight:700}
#app #granthLibraryRoot .gl-hero p{color:#f4e4cc;font-size:.88rem;line-height:1.85}
#app #granthLibraryRoot .gl-hero-art{position:absolute;right:20px;top:45px;display:grid;place-items:center;width:58px;height:76px;border:1px solid #bf966b;border-radius:30px 30px 12px 12px;color:#e9c88d;background:#64283b}
#app #granthLibraryRoot .gl-hero-meta{display:flex;gap:8px;flex-wrap:wrap;border-top:1px solid #9a6269;margin-top:16px;padding-top:12px;font-size:.71rem;color:#f4e4cc;width:100%}
#app #granthLibraryRoot .gl-hero-meta>span{display:block;flex:0 0 auto;width:auto;max-width:100%}
#app #granthLibraryRoot .gl-hero-meta span+span:before{content:'•';margin-right:8px;color:#d9b47b}
#app #granthLibraryRoot .gl-reading{padding:17px 16px;background:#e9eee4;border:1px solid #bbc9b1;border-radius:18px;margin:18px 0 0}
#app #granthLibraryRoot .gl-kicker{color:#37604d;font-size:.72rem;font-weight:700}
#app #granthLibraryRoot .gl-reading h2{color:#254a3a;font-size:1.04rem;margin:3px 0}
#app #granthLibraryRoot .gl-reading p{color:#52614f;font-size:.75rem}
#app #granthLibraryRoot .gl-primary{background:#315642;color:#fff8e8;border:1px solid #315642;border-radius:11px;padding:9px 13px;min-height:44px;font-weight:700;font-size:.81rem;margin-top:12px}
#app #granthLibraryRoot .gl-recent{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;text-align:left;background:#fff9ef;color:#382e29;border:1px solid #d9c8b2;border-radius:16px;padding:14px;margin:12px 0 0}
#app #granthLibraryRoot .gl-recent span>small{display:block;color:#68594e;font-size:.7rem}
#app #granthLibraryRoot .gl-recent b{display:block;color:#713043;font-size:.85rem}
#app #granthLibraryRoot .gl-recent span>span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:#68594e;font-size:.75rem}
#app #granthLibraryRoot .gl-recent em{font-size:.7rem;font-style:normal;flex:0 0 65px;color:#713043}
#app #granthLibraryRoot .gl-search{display:block;margin:22px 0 12px}
#app #granthLibraryRoot .gl-search>span{display:block;color:#382e29;font-size:.82rem;font-weight:700;margin-bottom:7px}
#app #granthLibraryRoot .gl-search input{display:block;width:100%;max-width:100%;min-width:0;min-height:48px;padding:11px 13px;border:1px solid #b8a58d;border-radius:13px;background:#fffaf2;color:#382e29;font-size:.9rem;box-shadow:none}
#app #granthLibraryRoot .gl-search input::placeholder{color:#766557;opacity:1}
#app #granthLibraryRoot .gl-filters{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:22px}
#app #granthLibraryRoot .gl-filters button{border:1px solid #cbb79c;background:#fffaf2;color:#59483a;border-radius:20px;min-height:44px;padding:8px 12px;font-size:.74rem;white-space:normal}
#app #granthLibraryRoot .gl-filters button[aria-pressed=true]{background:#713043;color:#fff6e6;border-color:#713043}
#app #granthLibraryRoot .gl-section-heading{margin:18px 0 13px}
#app #granthLibraryRoot .gl-section-heading h2{font-size:1.1rem;color:#713043;line-height:1.5}
#app #granthLibraryRoot .gl-section-heading>span{color:#68594e;font-size:.72rem;flex-shrink:0}
#app #granthLibraryRoot .gl-book-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px 12px;align-items:stretch}
#app #granthLibraryRoot .gl-book{position:relative;min-width:0;border-radius:17px;background:#fffaf2;border:1px solid #d9c8b2;box-shadow:0 4px 12px #513d2110;overflow:hidden}
#app #granthLibraryRoot .gl-book-open{display:block;width:100%;height:100%;border:0;border-radius:16px;background:#fffaf2;color:#382e29;padding:10px;text-align:left;white-space:normal}
#app #granthLibraryRoot .gl-cover{position:relative;min-height:192px;padding:19px 12px 14px 16px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;border-radius:5px 11px 11px 5px;gap:9px;color:#fff2ce;background:#713043;box-shadow:inset 6px 0 #0002,inset 9px 0 #ffffff13;isolation:isolate}
#app #granthLibraryRoot .gl-cover:before{content:'';position:absolute;inset:10px 7px 9px 13px;border:1px solid #ddbb784d;border-radius:3px;z-index:-1}
#app #granthLibraryRoot .gl-cover small{color:#f1dfbb;font-size:.58rem;padding:0 10px}
#app #granthLibraryRoot .gl-cover strong{display:block;color:#fff2ce;font-size:1.16rem;line-height:1.55;font-weight:700;width:100%}
#app #granthLibraryRoot .gl-cover>span{font-size:.57rem;color:#f1dfbb}
#app #granthLibraryRoot .gl-cover svg{width:35px;height:30px;color:#e6c387}
#app #granthLibraryRoot .gl-teal{background:#28564f}
#app #granthLibraryRoot .gl-ochre{background:#775226}
#app #granthLibraryRoot .gl-indigo{background:#474568}
#app #granthLibraryRoot .gl-book-copy{display:block;padding:10px 2px 3px}
#app #granthLibraryRoot .gl-book-copy>small{display:block;color:#68594e;font-size:.62rem}
#app #granthLibraryRoot .gl-book-copy h3{font-size:.97rem;color:#713043;margin:3px 0 5px;line-height:1.5}
#app #granthLibraryRoot .gl-book-copy>span{display:block;color:#68594e;font-size:.69rem;line-height:1.7;min-height:38px}
#app #granthLibraryRoot .gl-book-copy>b{display:flex;flex-direction:column;color:#574631;font-weight:600;font-size:.66rem;margin-top:8px;line-height:1.75;padding-right:46px}
#app #granthLibraryRoot .gl-book-copy em{color:#713043;font-style:normal;font-weight:700;margin-top:3px}
#app #granthLibraryRoot .gl-favorite{position:absolute;right:12px;bottom:14px;display:grid;place-items:center;width:44px;height:44px;min-height:44px;padding:0;background:#fff5df;color:#713043;border:1px solid #cbb79c;border-radius:50%;font-family:serif;font-size:1.5rem;line-height:1;box-shadow:0 2px 5px #0001}
#app #granthLibraryRoot .gl-favorite[aria-pressed=true]{background:#713043;color:#fff5df;border-color:#efdab9}
#app #granthLibraryRoot .gl-note{color:#68594e;font-size:.72rem;line-height:1.9;margin-top:20px}
#app #granthLibraryRoot .gl-empty{grid-column:1/-1;border:1px dashed #cbb79c;background:#fffaf2;border-radius:16px;padding:22px 15px;text-align:center}
#app #granthLibraryRoot .gl-empty h3{font-size:1rem;color:#713043}
#app #granthLibraryRoot .gl-empty p{font-size:.8rem;color:#68594e;margin:8px 0 14px}
#app #granthLibraryRoot .gl-secondary{border:1px solid #b8a58d;background:#fffaf2;color:#713043;border-radius:11px;padding:9px 14px;min-height:44px;font-size:.8rem;font-weight:700}
#app #granthLibraryRoot .gl-book-heading{display:grid;grid-template-columns:100px minmax(0,1fr);gap:16px;align-items:center;padding:17px;border:1px solid #d9c8b2;background:#fff8ec;border-radius:20px}
#app #granthLibraryRoot .gl-cover-large{min-height:154px;padding:18px 9px 12px;gap:8px}
#app #granthLibraryRoot .gl-cover-large small{font-size:.46rem}
#app #granthLibraryRoot .gl-cover-large strong{font-size:.85rem}
#app #granthLibraryRoot .gl-cover-large>span{font-size:.43rem}
#app #granthLibraryRoot .gl-cover-large svg{width:28px;height:25px}
#app #granthLibraryRoot .gl-book-heading>div:not(.gl-cover)>small{font-size:.69rem;color:#68594e}
#app #granthLibraryRoot .gl-book-heading h1{font-size:1.3rem;line-height:1.55;color:#713043;margin:6px 0}
#app #granthLibraryRoot .gl-book-heading p{font-size:.75rem;color:#68594e}
#app #granthLibraryRoot .gl-book-heading>div:not(.gl-cover)>span{display:inline-block;font-size:.68rem;color:#574631;margin-top:9px;border-top:1px solid #dbc6a6;padding-top:7px}
#app #granthLibraryRoot .gl-description{margin:16px 0 10px;font-size:.83rem;color:#59483a;line-height:1.9}
#app #granthLibraryRoot .gl-progress-link{display:block;text-align:left;border:1px solid #bbc9b1;background:#e9eee4;color:#254a3a;border-radius:12px;padding:10px 12px;width:100%;font-size:.78rem;font-weight:700;min-height:44px}
#app #granthLibraryRoot .gl-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:20px}
#app #granthLibraryRoot .gl-groups button{display:flex;align-items:flex-start;flex-direction:column;justify-content:center;gap:5px;text-align:left;min-height:90px;width:100%;min-width:0;padding:12px;border:1px solid #cbb79c;border-radius:14px;background:#fffaf2;color:#59483a;white-space:normal}
#app #granthLibraryRoot .gl-groups b{font-size:.85rem;color:inherit;line-height:1.6}
#app #granthLibraryRoot .gl-groups small{font-size:.65rem;color:inherit;line-height:1.8}
#app #granthLibraryRoot .gl-groups button[aria-pressed=true]{background:#713043;color:#fff5df;border-color:#713043}
#app #granthLibraryRoot .gl-availability{font-size:.7rem;color:#68594e;margin-top:12px;line-height:1.9}
#app #granthLibraryRoot .gl-part-list{display:grid;gap:11px}
#app #granthLibraryRoot .gl-part{display:grid;grid-template-columns:44px minmax(0,1fr);gap:12px;padding:15px 12px;background:#fffaf2;border:1px solid #d9c8b2;border-radius:15px}
#app #granthLibraryRoot .gl-part-number{display:flex;flex-direction:column;align-items:center;justify-content:center;align-self:start;background:#efe4d2;color:#713043;border-radius:10px;padding:8px 3px;min-height:61px}
#app #granthLibraryRoot .gl-part-number small{font-size:.58rem;color:#59483a}
#app #granthLibraryRoot .gl-part-number b{font-size:1.13rem;line-height:1.5;color:#713043}
#app #granthLibraryRoot .gl-part h3{font-size:.92rem;color:#382e29;line-height:1.8;font-weight:600}
#app #granthLibraryRoot .gl-read{display:inline-flex;align-items:center;justify-content:space-between;gap:18px;min-height:44px;background:#713043;color:#fff5df;border:1px solid #713043;border-radius:10px;text-decoration:none;font-size:.77rem;font-weight:700;padding:8px 13px;margin-top:11px}
#app #granthLibraryRoot .gl-pagination{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:18px}
#app #granthLibraryRoot .gl-pagination>span{font-size:.73rem;color:#68594e}
#app #granthLibraryRoot .gl-pagination button:disabled{opacity:1!important;background:#eee5d8!important;color:#786b60!important;border-color:#d1c3b0!important;cursor:default}
#app #granthLibraryRoot .gl-pagination button:disabled *{color:inherit!important}
@media(max-width:350px){#app #granthLibraryRoot{padding:16px 12px 110px}#app #granthLibraryRoot .gl-book-grid{gap:12px 9px}#app #granthLibraryRoot .gl-cover{min-height:186px;padding-left:12px;padding-right:8px}#app #granthLibraryRoot .gl-cover strong{font-size:1.03rem}#app #granthLibraryRoot .gl-book-open{padding:8px}#app #granthLibraryRoot .gl-book-heading{grid-template-columns:85px minmax(0,1fr);gap:12px;padding:13px}#app #granthLibraryRoot .gl-book-heading h1{font-size:1.15rem}}
/* Give the reading controls room above the app navigation and AI shortcut. */
body:has(#granthLibrary.active) .floating-ai{bottom:88px;max-width:132px;font-size:.76rem;padding:9px 12px}
@media(prefers-reduced-motion:reduce){#app #granthLibraryRoot *{scroll-behavior:auto;transition:none;animation:none}}

/* Book shelves inside every collection. Scoped to the library only. */
#app #granthLibraryRoot .gl-volume-grid,
#app #granthLibraryRoot .gl-part-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 14px;align-items:stretch;margin-top:16px}
#app #granthLibraryRoot .gl-volume-card{display:flex;flex-direction:column;align-items:stretch;position:relative;min-width:0;width:100%;height:100%;padding:10px;background:#fffaf2;color:#382e29;border:1px solid #d9c8b2;border-radius:18px;box-shadow:0 5px 14px #513d2110;text-decoration:none;text-align:left;white-space:normal;transition:transform .18s,box-shadow .18s;overflow:visible;line-height:1.65}
#app #granthLibraryRoot .gl-volume-card:hover{box-shadow:0 9px 20px #513d2124;transform:translateY(-2px);text-decoration:none}
#app #granthLibraryRoot .gl-volume-card:active{transform:translateY(1px)}
#app #granthLibraryRoot .gl-volume-cover{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:204px;padding:20px 13px 18px 19px;background:#713043;color:#fff2ce;text-align:center;border-radius:5px 13px 13px 5px;box-shadow:inset 5px 0 #0003,inset 9px 0 #ffffff12,2px 3px 0 #ddcdb5,4px 5px 0 #eee3ce;isolation:isolate}
#app #granthLibraryRoot .gl-volume-cover:before{content:'';position:absolute;inset:10px 8px 10px 15px;border:1px solid #e5c58c7a;border-radius:3px 6px 6px 3px;z-index:-1}
#app #granthLibraryRoot .gl-volume-cover.gl-teal{background:#28564f}
#app #granthLibraryRoot .gl-volume-cover.gl-ochre{background:#775226}
#app #granthLibraryRoot .gl-volume-cover.gl-indigo{background:#474568}
#app #granthLibraryRoot .gl-volume-brand{font-size:.65rem;color:#f3dfb7;line-height:1.6}
#app #granthLibraryRoot .gl-volume-ornament{font-size:.8rem;color:#e6c387;line-height:1}
#app #granthLibraryRoot .gl-volume-cover>svg{width:34px;height:29px}
#app #granthLibraryRoot .gl-volume-cover>strong{color:#fff2ce;font-size:1.18rem;line-height:1.5;font-weight:700}
#app #granthLibraryRoot .gl-volume-cover>small{color:#f3dfb7;font-size:.78rem;line-height:1.7}
#app #granthLibraryRoot .gl-volume-cover>.gl-volume-number{font-size:2.25rem;line-height:1.15;letter-spacing:.02em;font-variant-numeric:tabular-nums}
#app #granthLibraryRoot .gl-volume-rule{display:block;width:34px;height:1px;background:#dfbb76;margin:2px 0}
#app #granthLibraryRoot .gl-volume-note{font-size:.62rem;color:#f3dfb7;line-height:1.6}
#app #granthLibraryRoot .gl-volume-copy{display:flex;flex-direction:column;flex:1;gap:5px;padding:14px 3px 3px;min-width:0}
#app #granthLibraryRoot .gl-volume-copy>b{color:#713043;font-size:1rem;font-weight:700;line-height:1.6}
#app #granthLibraryRoot .gl-volume-copy>span{color:#68594e;font-size:.72rem;line-height:1.7}
#app #granthLibraryRoot .gl-volume-copy>small{color:#68594e;font-size:.67rem;font-weight:700}
#app #granthLibraryRoot .gl-volume-copy>h3{color:#382e29;font-size:.89rem;line-height:1.75;font-weight:700;margin:0 0 8px}
#app #granthLibraryRoot .gl-volume-copy>em{display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;margin-top:auto;padding:8px 6px;border:1px solid #dbc198;border-radius:11px;background:#f1e4cb;color:#642739;font-size:.74rem;font-style:normal;font-weight:700;text-align:center;line-height:1.5}
#app #granthLibraryRoot .gl-volume-copy>em svg{width:19px;height:17px;flex:0 0 auto}
#app #granthLibraryRoot .gl-volume-copy>em svg path{stroke:currentColor}
#app #granthLibraryRoot .gl-selected-volume{display:flex;align-items:center;gap:12px;margin:20px 0 0;padding:13px;border:1px solid #d9c8b2;background:#efe5d4;border-radius:15px}
#app #granthLibraryRoot .gl-selected-volume>span{display:grid;place-items:center;background:#713043;width:43px;min-height:51px;border-radius:4px 8px 8px 4px;flex-shrink:0}
#app #granthLibraryRoot .gl-selected-volume svg{width:29px;height:25px}
#app #granthLibraryRoot .gl-selected-volume>div{flex:1;min-width:0}
#app #granthLibraryRoot .gl-selected-volume small{font-size:.67rem;color:#68594e}
#app #granthLibraryRoot .gl-selected-volume h2{font-size:1.05rem;color:#713043}
#app #granthLibraryRoot .gl-selected-volume button{font-size:.75rem;padding:8px 11px}
@media(min-width:650px){#app #granthLibraryRoot .gl-volume-grid,#app #granthLibraryRoot .gl-part-list{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:1000px){#app #granthLibraryRoot .gl-volume-grid,#app #granthLibraryRoot .gl-part-list{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:350px){#app #granthLibraryRoot .gl-volume-grid,#app #granthLibraryRoot .gl-part-list{gap:14px 10px}#app #granthLibraryRoot .gl-volume-card{padding:8px}#app #granthLibraryRoot .gl-volume-cover{min-height:192px;padding:18px 9px 16px 16px}#app #granthLibraryRoot .gl-volume-cover>strong{font-size:1.05rem}#app #granthLibraryRoot .gl-volume-copy>h3{font-size:.82rem}#app #granthLibraryRoot .gl-volume-copy>em{font-size:.68rem}}
@media(prefers-reduced-motion:reduce){#app #granthLibraryRoot .gl-volume-card{transition:none;transform:none}}
