
:root{--bg:#f6f8f4;--card:#fff;--text:#17251d;--muted:#627066;--green:#1f6b45;--line:#dfe8e1;--soft:#eef6ef;--shadow:0 12px 30px rgba(25,64,42,.09);--reader:780px;--fs:19px}html[data-theme="dark"]{--bg:#101713;--card:#17211b;--text:#edf5ef;--muted:#acbbb0;--green:#78c997;--line:#29372e;--soft:#1d2b22;--shadow:0 12px 30px rgba(0,0,0,.28)}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font-family:"Noto Sans Devanagari","Nirmala UI",Mangal,system-ui,sans-serif;line-height:1.8}a{color:inherit}.wrap{width:min(1180px,92vw);margin:auto}.topbar{position:sticky;top:0;z-index:50;background:var(--card);border-bottom:1px solid var(--line)}.topbar .wrap{display:flex;align-items:center;gap:10px;min-height:62px}.brand{font-weight:800;color:var(--green);text-decoration:none}.spacer{flex:1}.iconBtn,.pill{border:1px solid var(--line);background:var(--card);color:var(--text);border-radius:999px;padding:9px 13px;cursor:pointer;text-decoration:none;font-weight:700}.primary{background:var(--green);color:#fff;border-color:var(--green)}.hero{padding:48px 0 34px}.heroGrid{display:grid;grid-template-columns:minmax(230px,360px) 1fr;gap:44px;align-items:center}.cover{width:100%;aspect-ratio:2/3;object-fit:cover;border-radius:18px;box-shadow:var(--shadow);border:1px solid var(--line)}.eyebrow{color:var(--green);font-weight:800}h1{font-size:clamp(2.6rem,7vw,5.4rem);line-height:1.03;margin:.2em 0;color:var(--green)}.subtitle{font-size:clamp(1.05rem,2.4vw,1.4rem);max-width:760px;color:var(--muted)}.tagline{font-size:1.13rem;font-weight:800;margin-top:18px}.heroActions,.badges{display:flex;gap:9px;flex-wrap:wrap;margin-top:22px}.badge{background:var(--soft);border:1px solid var(--line);padding:6px 10px;border-radius:999px}.section{padding:28px 0}.sectionTitle{font-size:clamp(1.6rem,4vw,2.3rem);margin:0 0 8px}.sectionIntro{color:var(--muted)}.bookIntro{max-width:900px}.bookIntro blockquote,.article blockquote{margin:1.5em 0;padding:14px 18px;border-left:4px solid var(--green);background:var(--soft);border-radius:12px;font-weight:700}.part{background:var(--card);border:1px solid var(--line);border-radius:20px;margin:16px 0;box-shadow:var(--shadow);overflow:hidden}.part h3{margin:0;padding:18px 20px;background:var(--soft)}.chapterList{list-style:none;margin:0;padding:0}.chapterList li+li{border-top:1px solid var(--line)}.chapterList a{display:flex;gap:12px;padding:15px 20px;text-decoration:none}.chapterList a:hover{background:var(--soft)}.chNo{min-width:44px;color:var(--green);font-weight:800}.readerWrap{width:min(var(--reader),92vw);margin:auto}.readerHead{padding:46px 0 18px}.readerPart{color:var(--green);font-weight:800}.readerTitle{font-size:clamp(2rem,5vw,3.45rem);line-height:1.18;margin:.25em 0}.readerMeta{color:var(--muted)}.readerTools{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0}.article{background:var(--card);border:1px solid var(--line);border-radius:24px;padding:clamp(22px,5vw,48px);box-shadow:var(--shadow);font-size:var(--fs)}.article h2{font-size:1.55em;color:var(--green);line-height:1.35;margin-top:2em}.article h3{font-size:1.2em;line-height:1.35;margin-top:2em}.article img{display:block;max-width:100%;height:auto;margin:26px auto;border-radius:16px;border:1px solid var(--line)}.lead{font-size:1.12em;color:var(--muted)}.note{background:var(--soft);border:1px solid var(--line);border-radius:14px;padding:14px 16px}.navRow{display:grid;grid-template-columns:1fr auto 1fr;gap:10px;align-items:center;margin:22px 0 44px}.navRow .next{text-align:right}.footer{border-top:1px solid var(--line);padding:32px 0 50px;color:var(--muted)}.small{font-size:.92rem}@media(max-width:760px){.heroGrid{grid-template-columns:1fr}.cover{max-width:290px;margin:auto}.heroText{text-align:center}.heroActions,.badges{justify-content:center}.navRow{grid-template-columns:1fr 1fr}.navRow .toc{grid-column:1/-1;grid-row:1;text-align:center}.navRow .prev{grid-column:1}.navRow .next{grid-column:2}}@media print{.topbar,.readerTools,.navRow,.footer{display:none!important}body{background:#fff}.article{box-shadow:none;border:none;padding:0}}

/* Reader action buttons: Share / Contents / Print-PDF */
.readerTools > :nth-child(1){background:#1f6b45;color:#fff;border-color:#1f6b45;}
.readerTools > :nth-child(1):hover{background:#185738;border-color:#185738;}
.readerTools > :nth-child(2){background:#2563eb;color:#fff;border-color:#2563eb;}
.readerTools > :nth-child(2):hover{background:#1d4ed8;border-color:#1d4ed8;}
.readerTools > :nth-child(3){background:#d97706;color:#fff;border-color:#d97706;}
.readerTools > :nth-child(3):hover{background:#b45309;border-color:#b45309;}
html[data-theme="dark"] .readerTools > :nth-child(1),
html[data-theme="dark"] .readerTools > :nth-child(2),
html[data-theme="dark"] .readerTools > :nth-child(3){color:#fff;}

/* Top reader controls: A− / A+ / Light-Dark */
.topbar .wrap > [data-font-minus]{
  background:#6d28d9;
  color:#fff;
  border-color:#6d28d9;
}
.topbar .wrap > [data-font-minus]:hover{
  background:#5b21b6;
  border-color:#5b21b6;
}

.topbar .wrap > [data-font-plus]{
  background:#0891b2;
  color:#fff;
  border-color:#0891b2;
}
.topbar .wrap > [data-font-plus]:hover{
  background:#0e7490;
  border-color:#0e7490;
}

.topbar .wrap > [data-theme-toggle]{
  background:#374151;
  color:#fff;
  border-color:#374151;
}
.topbar .wrap > [data-theme-toggle]:hover{
  background:#1f2937;
  border-color:#1f2937;
}

/* Keep the three controls clearly visible in dark mode too */
html[data-theme="dark"] .topbar .wrap > [data-font-minus],
html[data-theme="dark"] .topbar .wrap > [data-font-plus],
html[data-theme="dark"] .topbar .wrap > [data-theme-toggle]{
  color:#fff;
}

/* Slightly stronger visual grouping on mobile */
@media(max-width:760px){
  .topbar .wrap > [data-font-minus],
  .topbar .wrap > [data-font-plus],
  .topbar .wrap > [data-theme-toggle]{
    min-width:54px;
    text-align:center;
  }
}


/* =========================================================
   V4 reader layout — wider figures, tighter padding
   ========================================================= */
:root{--reader:1120px;}

.readerWrap{width:min(var(--reader),98vw);}
.article{
  padding:clamp(10px,1.8vw,20px);
}

/* Main-site home button */
.homeBtn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:#edf7ff;
  border-color:#cfe8fb;
  color:#075985;
  white-space:nowrap;
}
.homeBtn:hover{background:#dff0ff;border-color:#b8dcf7;color:#0c4a6e;}
.homeIcon{font-size:1.15em;line-height:1;}
html[data-theme="dark"] .homeBtn{
  background:#193040;
  border-color:#315268;
  color:#d9f0ff;
}

@media(max-width:760px){
  .readerWrap{width:100%;}
  .article{
    padding:6px;
    border-radius:14px;
  }
  .readerHead{padding:28px 10px 12px;}
  .topbar .wrap{width:calc(100% - 12px);gap:6px;min-height:58px;}
  .topbar .iconBtn{padding:8px 10px;}
  .homeText{display:none;}
  .homeBtn{min-width:42px;justify-content:center;}
}


/* =========================================================
   Useful Resources — permanent book integration
   ========================================================= */
.resourceBtn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:#eef8ef;
  border-color:#cfe6d4;
  color:#1f6b45;
  white-space:nowrap;
}
.resourceBtn:hover{background:#e2f3e5;border-color:#b9d9c1;color:#185738;}
.resourceIcon{font-size:1.05em;line-height:1;font-weight:900;}
html[data-theme="dark"] .resourceBtn{
  background:#1c3325;
  border-color:#355c43;
  color:#d9f5e2;
}
.resourceAction{margin:1rem 0 1.35rem!important;}
.resourceLink{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  border:1px solid #b9d9c1;
  background:#eef8ef;
  color:#185738;
  border-radius:999px;
  padding:.55rem .9rem;
  text-decoration:none;
  font-weight:800;
}
.resourceLink:hover{background:#e2f3e5;}
.resourceCallout{
  margin:1.25rem 0 1.55rem;
  padding:1rem 1.05rem;
  border:1px solid #cfe6d4;
  border-left:5px solid var(--green);
  border-radius:14px;
  background:var(--soft);
  color:var(--text);
}
.resourceCallout .resourceLink{margin-left:.35rem;}
@media(max-width:760px){
  .resourceText{display:none;}
  .resourceBtn{min-width:42px;justify-content:center;padding:8px 10px;}
  .resourceCallout .resourceLink{margin:.65rem 0 0;}
}


/* =========================================================
   Reader UI compact toolbar patch — mobile single row
   ========================================================= */
.topbar .wrap{flex-wrap:nowrap;}
.brand{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;}
.brandBack{font-size:1.05rem;line-height:1;}
.langGlobe{font-size:1rem;line-height:1;}

/* Neutral reader action buttons */
.readerTools{gap:8px;}
.readerTools .readerToolBtn,
.readerTools > :nth-child(1),
.readerTools > :nth-child(2),
.readerTools > :nth-child(3){
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  background:var(--card);
  color:var(--text);
  border:1px solid var(--line);
  box-shadow:0 2px 8px rgba(25,64,42,.04);
  padding:8px 12px;
}
.readerTools .readerToolBtn:hover,
.readerTools > :nth-child(1):hover,
.readerTools > :nth-child(2):hover,
.readerTools > :nth-child(3):hover{
  background:var(--soft);
  color:var(--green);
  border-color:color-mix(in srgb, var(--green) 28%, var(--line));
}
.readerToolIcon{width:17px;height:17px;flex:0 0 17px;fill:currentColor;display:block;}
html[data-theme="dark"] .readerTools .readerToolBtn{color:var(--text);background:var(--card);}

@media(max-width:760px){
  .topbar .wrap{
    width:100%;
    max-width:none;
    min-height:52px;
    padding:5px 7px;
    gap:4px;
    flex-wrap:nowrap;
    overflow:visible;
  }
  .topbar .brand,
  .topbar .iconBtn{
    flex:0 0 auto;
    min-width:0;
    min-height:38px;
    height:38px;
    padding:6px 8px;
    border-radius:999px;
    font-size:.88rem;
    line-height:1;
  }
  .topbar .brand{
    width:36px;
    justify-content:center;
    padding:0;
  }
  .brandText,
  .homeText,
  .resourceText,
  .bookLangText{display:none!important;}
  .homeBtn,.resourceBtn,.bookLangBtn{
    width:38px;
    min-width:38px!important;
    justify-content:center;
    padding:0!important;
  }
  .topbar .spacer{flex:1 1 auto;min-width:2px;}
  .topbar .wrap > [data-font-minus],
  .topbar .wrap > [data-font-plus]{
    width:42px;
    min-width:42px;
    padding:0!important;
    text-align:center;
    justify-content:center;
  }
  .topbar .wrap > [data-theme-toggle]{
    width:44px;
    min-width:44px;
    padding:0!important;
    text-align:center;
  }
  .readerTools{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:7px;
    margin:14px 0 8px;
  }
  .readerTools .readerToolBtn,
  .readerTools > :nth-child(1),
  .readerTools > :nth-child(2),
  .readerTools > :nth-child(3){
    width:100%;
    min-width:0;
    padding:8px 7px;
    font-size:.82rem;
    white-space:nowrap;
  }
  .readerToolIcon{width:16px;height:16px;flex-basis:16px;}
}

@media(max-width:380px){
  .topbar .wrap{gap:3px;padding-left:4px;padding-right:4px;}
  .topbar .brand{width:32px;}
  .homeBtn,.resourceBtn,.bookLangBtn{width:34px;min-width:34px!important;}
  .topbar .wrap > [data-font-minus],
  .topbar .wrap > [data-font-plus]{width:38px;min-width:38px;}
  .topbar .wrap > [data-theme-toggle]{width:40px;min-width:40px;font-size:.78rem;}
}


/* =========================================================
   FINAL compact mobile controls — icon-only topbar, tiny inline action icons
   ========================================================= */
.topToolIcon{width:18px;height:18px;fill:currentColor;display:block;}
@media(max-width:760px){
  .topbar .wrap{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:3px!important;min-height:46px!important;padding:5px 6px!important;width:100%!important;max-width:none!important;overflow:hidden!important;}
  .topbar .spacer{display:none!important;}
  .topbar .topIconControl{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important;padding:0!important;margin:0!important;border-radius:9px!important;line-height:1!important;flex:0 0 34px!important;}
  .topbar .brandText,.topbar .homeText,.topbar .resourceText,.topbar .bookLangText{display:none!important;}
  .topbar .topToolIcon{width:17px!important;height:17px!important;max-width:17px!important;max-height:17px!important;flex:0 0 17px!important;}
  .topbar .fontControl{font-size:.77rem!important;font-weight:800!important;letter-spacing:-.04em!important;}
  .readerTools{display:flex!important;align-items:center!important;gap:6px!important;flex-wrap:wrap!important;margin:12px 0 8px!important;}
  .readerTools .readerToolBtn{width:auto!important;min-width:0!important;height:34px!important;min-height:34px!important;padding:5px 9px!important;border-radius:9px!important;gap:5px!important;font-size:.82rem!important;line-height:1!important;white-space:nowrap!important;background:var(--card)!important;color:var(--text)!important;border:1px solid var(--line)!important;box-shadow:none!important;}
  .readerTools .readerToolIcon{width:14px!important;height:14px!important;max-width:14px!important;max-height:14px!important;flex:0 0 14px!important;}
}
@media(max-width:360px){
  .topbar .wrap{gap:2px!important;padding-left:4px!important;padding-right:4px!important;}
  .topbar .topIconControl{width:32px!important;min-width:32px!important;height:32px!important;min-height:32px!important;flex-basis:32px!important;}
  .readerTools{gap:5px!important;}
  .readerTools .readerToolBtn{padding:5px 7px!important;font-size:.78rem!important;}
  .readerTools .readerToolIcon{width:13px!important;height:13px!important;max-width:13px!important;max-height:13px!important;flex-basis:13px!important;}
}
