
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:#f6f0e4;color:#30261e;font-family:"Microsoft Himalaya","Noto Serif Tibetan","Kailasa",serif;line-height:2.05;font-size:18px}
body.dark{background:#171513;color:#eee8df}body.dark .card,body.dark .reader,body.dark .panel,body.dark .item{background:#24211e;color:#eee8df;border-color:#4c4339}
.w{width:min(1180px,92%);margin:auto}header{background:#861d1d;color:#fff;border-bottom:5px solid #c89b3c}.top{padding:22px 0 16px}.brand{display:flex;align-items:center;gap:18px}.logo{width:72px;height:72px;object-fit:contain}.brand h1{font-size:clamp(2rem,4vw,3.25rem);margin:0;line-height:1.35}
nav{display:flex;flex-wrap:wrap;gap:9px;margin-top:17px}.btn,button{font:inherit;border:0;border-radius:9px;padding:7px 14px;text-decoration:none;cursor:pointer}.btn{background:#9c2828;color:#fff}.gold{background:#aa7926!important;color:#fff}.soft{background:#eee2cf!important;color:#5c1717!important}
.hero{height:min(37vw,430px);min-height:250px;background:url("hero.png") center/cover no-repeat;position:relative}.hero:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(0,0,0,.24),transparent 65%)}.hero h2{position:absolute;z-index:1;left:4%;bottom:10%;color:#fff;text-shadow:0 2px 7px #000;font-size:clamp(2rem,4vw,3.4rem);margin:0}
section{margin:30px 0}.panel,.card,.reader,.item{background:#fffdf8;border:1px solid #decfb5;border-radius:16px;padding:20px}.notice{border-left:5px solid #b98428}.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}.grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.card h2,.card h3,.item h3{color:#741818;margin-top:0}.subnav{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 20px}.subnav a{background:#efe2cf;color:#721b1b;padding:6px 12px;border-radius:8px;text-decoration:none}
.vol{cursor:pointer;min-height:120px}.toc{display:none;margin-top:12px}.vol.open .toc{display:block}.toc a{display:block;border-top:1px solid #eadfce;padding:7px 0;color:#741818;text-decoration:none}
.readerTools{position:sticky;top:8px;z-index:3;display:flex;flex-wrap:wrap;gap:7px;background:#efe3d0;padding:8px;border-radius:10px;margin-bottom:12px}.reader{white-space:pre-wrap;font-size:1.22rem;min-height:260px}.speaker{display:grid;grid-template-columns:150px 1fr;gap:20px;align-items:center}.speakerPic{width:150px;height:150px;border-radius:14px;background:#eee1cf;display:grid;place-items:center;font-size:4rem}.audioRow{display:grid;grid-template-columns:1.2fr 1fr auto;gap:12px;align-items:center;border-top:1px solid #eadfce;padding:11px 0}.placeholder{height:170px;border-radius:12px;background:linear-gradient(135deg,#ead9bf,#f8f1e6);display:grid;place-items:center;color:#8c765e;font-size:1.2rem}
.search{width:100%;padding:12px 15px;border:1px solid #cdbb9d;border-radius:10px;font:inherit}.foot{background:#29221d;color:#eee0ca;padding:28px 0;margin-top:40px}
@media(max-width:850px){.grid4{grid-template-columns:repeat(2,1fr)}.grid3{grid-template-columns:1fr}.speaker{grid-template-columns:1fr}.audioRow{grid-template-columns:1fr}.brand h1{font-size:2.2rem}}
@media(max-width:520px){body{font-size:17px}.grid4{grid-template-columns:1fr}.logo{width:58px;height:58px}.hero{height:250px}}

/* Keep card action/download buttons on one row when space allows. */
.card p:has(> a.btn), .category-note p:has(> a.btn){display:inline; margin:0;}
.card a.btn, .category-note a.btn{display:inline-block; margin-top:6px; margin-right:4px;}

/* Hide redundant hierarchy labels already repeated by the page title. */
.breadcrumb-line{display:none!important}

/* Keep reading controls compact so they leave more room for the text. */
.readerTools,.reader-tools{
  display:flex!important;
  width:fit-content;
  max-width:100%;
  align-items:center;
  gap:4px!important;
  padding:5px 6px!important;
  border-radius:8px!important;
  margin:6px 0 8px!important;
}
.readerTools .btn,.readerTools button,
.reader-tools .btn,.reader-tools button{
  min-height:0!important;
  margin:0!important;
  padding:4px 8px!important;
  border-radius:7px!important;
  font-size:15px!important;
  line-height:1.25!important;
}
@media(max-width:520px){
  .readerTools,.reader-tools{gap:3px!important;padding:4px!important}
  .readerTools .btn,.readerTools button,
  .reader-tools .btn,.reader-tools button{padding:3px 7px!important;font-size:14px!important}
}

/* Pull TOC book titles and volume labels closer to the panel's top edge. */
body.toc-page main section > .panel:first-of-type{padding-top:10px!important}
body.toc-page main section > .panel:first-of-type > h2:first-child{
  margin-top:0!important;
  margin-bottom:2px!important;
  line-height:1.45!important;
}
body.toc-page main section > .panel:first-of-type > h2:first-child + h2,
body.toc-page main section > .panel:first-of-type > h2:first-child + h3{
  margin-top:0!important;
  margin-bottom:8px!important;
  line-height:1.35!important;
}header nav .btn{
  padding:4px 9px !important;
  border-radius:7px !important;
  min-width:auto !important;
  min-height:auto !important;
  line-height:1.2 !important;
}

header nav{
  gap:6px !important;
}
/* Make lower content buttons smaller, like the top menu buttons */
.volume-actions .btn,
.card .btn,
.category-note .btn {
  display: inline-block !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 7px 14px !important;
  border-radius: 9px !important;
  font-size: 18px !important;
  line-height: 1.35 !important;
}
.category-grid a{
  padding:4px 9px !important;
  border-radius:7px !important;
  min-width:auto !important;
  min-height:auto !important;
  line-height:1.2 !important;
}

.category-grid{
  gap:6px !important;
}
.volume-row .volume-actions .btn{
  padding:4px 9px !important;
  border-radius:7px !important;
  min-width:0 !important;
  min-height:0 !important;
  height:auto !important;
  line-height:1.2 !important;
}

.volume-row .volume-actions{
  gap:6px !important;
}
/* Improve reading comfort on desktop and mobile */
.reader {
  line-height: 1.75 !important;
}

h1, h2, h3, h4 {
  line-height: 1.45;
}

@media (max-width: 520px) {
  body {
    line-height: 1.7;
  }

  .reader {
    line-height: 1.7 !important;
  }

  h1, h2, h3, h4 {
    line-height: 1.4;
  }
}


/* Site-wide: remove paper-like decoration from reading/content areas.
   Keep the existing typography, text colors, controls, and page structure. */
.reader,
.reader-panel,
#bookContent,
#bookContent .reader,
#bookContent .reader div,
.tungshak-reader,
.book-page,
.page-frame {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.reader::before,
.reader::after,
.reader-panel::before,
.reader-panel::after,
#bookContent::before,
#bookContent::after,
#bookContent .reader::before,
#bookContent .reader::after,
.book-page::before,
.book-page::after,
.page-frame::before,
.page-frame::after {
  content: none !important;
  display: none !important;
  background: none !important;
  background-image: none !important;
}

/* Give Tibetan reading text the available width on phones. */
@media (max-width: 700px) {
  .reader,
  .reader-panel,
  #bookContent,
  #bookContent .reader,
  .tungshak-reader,
  .book-page,
  .page-frame {
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

/* ---- bigger front buttons; menu row fills the text width ---- */
header nav{gap:10px!important}
header nav a.btn,header nav .btn{font-size:21px!important;padding:9px 16px!important;border-radius:11px!important;line-height:1.3!important;flex:1 1 auto;text-align:center}
.card .btn{font-size:21px!important;padding:9px 22px!important;border-radius:11px!important}
.subnav a{font-size:19px;padding:8px 16px}
@media(max-width:520px){header nav{gap:7px!important}header nav a.btn,header nav .btn{font-size:18px!important;padding:8px 10px!important}.card .btn{font-size:18px!important}}
/* larger buttons everywhere (menu, reading toolbar) */
header nav{gap:12px!important}
header nav a.btn,header nav .btn{font-size:26px!important;padding:12px 18px!important;border-radius:12px!important}
.card .btn{font-size:23px!important;padding:11px 24px!important}
.subnav a{font-size:21px;padding:9px 18px}
.readerTools .btn,.readerTools button,.reader-tools .btn,.reader-tools button{font-size:18px!important;padding:7px 12px!important;border-radius:9px!important}
.readerTools,.reader-tools{gap:7px!important;padding:8px 9px!important}
@media(max-width:520px){header nav{gap:7px!important}header nav a.btn,header nav .btn{font-size:20px!important;padding:9px 10px!important}.card .btn{font-size:19px!important}.readerTools .btn,.readerTools button,.reader-tools .btn,.reader-tools button{font-size:16px!important;padding:6px 9px!important}.readerTools,.reader-tools{gap:5px!important;padding:6px!important}}
/* menu: big text, small tight box */
header nav{gap:8px!important}
header nav a.btn,header nav .btn{font-size:26px!important;padding:5px 9px!important;border-radius:7px!important;line-height:1.5!important;flex:0 0 auto!important}
@media(max-width:520px){header nav{gap:6px!important}header nav a.btn,header nav .btn{font-size:21px!important;padding:4px 7px!important}}
/* final: tight boxes, text stays large, all same height */
header nav{align-items:center!important;gap:7px!important}
header nav a.btn,header nav .btn{display:inline-block!important;font-size:26px!important;line-height:1.25!important;padding:3px 8px!important;border-radius:6px!important;flex:0 0 auto!important;height:auto!important;min-height:0!important}
@media(max-width:520px){header nav a.btn,header nav .btn{font-size:21px!important;padding:3px 6px!important}}
.about-text p{font-size:24px;line-height:1.6;margin:0 0 10px}
/* lower buttons: same size as the top menu buttons */
.category-grid{gap:7px!important}
.category-grid a,.subnav a,.card .btn,.category-note .btn,.volume-actions .btn,.volume-row .volume-actions .btn,.toc-actions .btn,.panel .btn{font-size:26px!important;line-height:1.25!important;padding:3px 8px!important;border-radius:6px!important;min-width:0!important;min-height:0!important;height:auto!important;width:auto!important;display:inline-block!important}
.volume-actions{gap:7px!important}
@media(max-width:520px){.category-grid a,.subnav a,.card .btn,.category-note .btn,.volume-actions .btn,.volume-row .volume-actions .btn,.toc-actions .btn,.panel .btn{font-size:21px!important;padding:3px 6px!important}}
/* text-heavy pages: no frame box around the text (easier on phones) */
.panel.about-text,body.dark .panel.about-text,body.reading-page .panel,body.dark.reading-page .panel,.panel:has(.book-reader),.panel:has(.history-reader),body.dark .panel:has(.book-reader),body.dark .panel:has(.history-reader){background:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding-left:0!important;padding-right:0!important}
/* cards: no frame box, tight line spacing */
.card,body.dark .card{background:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding:6px 8px!important}
.card h2,.card h3{margin:0 0 4px!important;line-height:1.25!important}
.card p{margin:0 0 8px!important;line-height:1.35!important}
.panel:has(.audioRow),.panel:has(.namthar-cover),.panel:has(> .card > img),body.dark .panel:has(.audioRow),body.dark .panel:has(> .card > img){background:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;padding-left:0!important;padding-right:0!important}
/* book titles on volume/collection pages: large for phones */
main .volume-list .volume-row h3{font-size:30px!important;line-height:1.35!important;margin:.2em 0 .3em!important}
@media(max-width:700px){main .volume-list .volume-row h3{font-size:27px!important}}
/* tighter line spacing for list / table-of-contents titles (wrapped lines) */
html body main .sec-list .volume-row h3,html body main .volume-list .volume-row h3{line-height:1.35!important}
html body .tr a{line-height:1.35!important;padding:5px 0!important}
html body .grp-items a,html body details.grp summary{line-height:1.35!important}
