
:root{
  --bg:#f3f6f8;
  --surface:#ffffff;
  --surface-soft:#f8fafb;
  --ink:#14202b;
  --muted:#66737f;
  --line:#dce3e8;
  --teal:#087f8c;
  --teal-dark:#075d66;
  --green:#19734a;
  --green-bg:#e7f6ed;
  --red:#a43a3a;
  --red-bg:#fdecec;
  --shadow:0 14px 34px rgba(20,32,43,.07);
  --radius:20px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  line-height:1.55;
}
a{text-decoration:none;color:inherit}
button,input,select{font:inherit}
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(16px);
  border-bottom:1px solid var(--line);
}
.topbar-inner{
  width:min(1220px,calc(100% - 36px));
  min-height:72px;
  margin:auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
}
.brand{font-weight:850;letter-spacing:-.025em;white-space:nowrap}
.brand span{
  margin-right:8px;
  padding:6px 9px;
  border-radius:8px;
  background:var(--ink);
  color:#fff;
  font-size:.75rem;
}
.topbar nav{display:flex;gap:5px;flex-wrap:wrap}
.topbar nav a{
  padding:9px 11px;
  border-radius:9px;
  color:var(--muted);
  font-size:.92rem;
  font-weight:650;
}
.topbar nav a:hover{background:#eef2f4;color:var(--ink)}
.shell{width:min(1220px,calc(100% - 36px));margin:auto}
.hero{
  margin:34px 0 22px;
  padding:42px;
  border-radius:26px;
  background:linear-gradient(135deg,#13222e,#2f4a5c);
  color:#fff;
  box-shadow:var(--shadow);
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:32px;
}
.hero.compact{padding:34px}
.hero h1{
  margin:7px 0 10px;
  max-width:880px;
  font-size:clamp(2.15rem,4.8vw,4.25rem);
  line-height:1.04;
  letter-spacing:-.055em;
}
.hero p{max-width:760px;margin:0;opacity:.8;font-size:1.04rem}
.eyebrow{
  color:var(--muted);
  font-size:.74rem;
  font-weight:850;
  letter-spacing:.13em;
  text-transform:uppercase;
}
.hero .eyebrow{color:#bdd0d9}
.hero-stat{
  min-width:145px;
  padding:20px;
  border-radius:18px;
  background:rgba(255,255,255,.11);
  display:flex;
  flex-direction:column;
}
.hero-stat strong{font-size:3rem;line-height:1}
.hero-stat span{margin-top:7px;font-size:.82rem}
.track-grid,.module-grid,.subject-grid{
  display:grid;
  gap:18px;
}
.track-grid{grid-template-columns:repeat(3,1fr)}
.module-grid{grid-template-columns:repeat(3,1fr)}
.subject-grid{grid-template-columns:repeat(3,1fr);margin-bottom:34px}
.track-card,.module-card,.subject-card{
  position:relative;
  min-height:235px;
  padding:26px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--surface);
  box-shadow:var(--shadow);
  transition:transform .18s ease,border-color .18s ease;
}
.track-card:hover,.module-card:hover,.subject-card:hover{
  transform:translateY(-3px);
  border-color:#adc5c9;
}
.track-prelims{border-top:5px solid #2563eb}
.track-mains{border-top:5px solid #7c3aed}
.track-optional{border-top:5px solid var(--teal)}
.track-card h2,.module-card h2,.subject-card h2{
  margin:9px 0;
  font-size:1.55rem;
  letter-spacing:-.035em;
}
.track-card p,.module-card p,.subject-card p{color:var(--muted)}
.open-link{
  position:absolute;
  left:26px;
  bottom:22px;
  color:var(--teal-dark);
  font-weight:800;
}
.module-card.featured{background:linear-gradient(145deg,#fff,#eef8f8);border-color:#badfe1}
.module-index{font-size:.8rem;font-weight:850;color:var(--muted)}
.subject-count{
  display:inline-flex;
  min-width:52px;
  height:52px;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  background:#e7f5f6;
  color:var(--teal-dark);
  font-weight:850;
}
.filter-panel{
  position:sticky;
  top:88px;
  z-index:20;
  margin:18px 0 24px;
  padding:22px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,.97);
  box-shadow:var(--shadow);
}
.filter-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:16px;
}
.filter-header h2{margin:3px 0 0;font-size:1.35rem}
.filter-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}
.filter-grid label{
  display:flex;
  flex-direction:column;
  gap:6px;
  color:var(--muted);
  font-size:.78rem;
  font-weight:750;
}
.filter-grid select,.filter-grid input{
  width:100%;
  min-height:45px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  color:var(--ink);
}
.filter-status{margin-top:13px;color:var(--muted);font-size:.86rem}
.button-light{
  border:1px solid var(--line);
  border-radius:9px;
  padding:9px 12px;
  background:#eef2f4;
  color:var(--ink);
  cursor:pointer;
}
.question-list{display:grid;gap:18px}
.question-card{
  padding:28px;
  border:1px solid var(--line);
  border-radius:20px;
  background:var(--surface);
  box-shadow:var(--shadow);
}
.question-topline{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.question-number{font-weight:850}
.question-tags{display:flex;gap:7px;flex-wrap:wrap}
.question-tags span{
  padding:4px 8px;
  border-radius:999px;
  background:#eef2f4;
  color:var(--muted);
  font-size:.75rem;
  font-weight:750;
}
.syllabus-path{
  margin:13px 0;
  color:var(--teal-dark);
  font-size:.84rem;
  font-weight:700;
}
.syllabus-path b{padding:0 5px;color:#94a2ac}
.question-card h2{
  margin:10px 0 20px;
  font-size:1.2rem;
  line-height:1.55;
  letter-spacing:-.015em;
}
.answer-options{display:grid;gap:10px}
.answer-option{
  width:100%;
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface-soft);
  color:var(--ink);
  text-align:left;
  cursor:pointer;
  transition:border-color .15s,background .15s;
}
.answer-option:hover:not(:disabled){border-color:#9eb9bd;background:#f1f8f8}
.answer-option:disabled{cursor:default;opacity:1}
.option-letter{
  flex:0 0 30px;
  height:30px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#e6ecef;
  font-weight:850;
}
.correct-answer{
  border-color:#70b28d!important;
  background:var(--green-bg)!important;
  color:#175e3d;
}
.correct-answer .option-letter{background:var(--green);color:#fff}
.wrong-answer{
  border-color:#d17e7e!important;
  background:var(--red-bg)!important;
  color:#812e2e;
}
.wrong-answer .option-letter{background:var(--red);color:#fff}
.question-actions{
  min-height:44px;
  margin-top:16px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.answer-result{
  margin-right:auto;
  font-weight:850;
}
.result-correct{color:var(--green)}
.result-wrong{color:var(--red)}
.explanation-toggle,.mistake-link{
  border:0;
  border-radius:9px;
  padding:9px 12px;
  cursor:pointer;
}
.explanation-toggle{background:#e4f1f2;color:var(--teal-dark);font-weight:800}
.mistake-link{background:#eef1f3;color:var(--ink)}
.explanation-dropdown{
  margin-top:14px;
  padding:18px;
  border-left:4px solid var(--teal);
  border-radius:10px;
  background:#f0f6f7;
}
.explanation-dropdown p{margin-bottom:0;white-space:pre-line}
.correct-answer-line{color:var(--green)}
.empty-state{
  padding:38px;
  border:1px dashed #bfcbd2;
  border-radius:18px;
  background:#fff;
  color:var(--muted);
  text-align:center;
}
footer{
  margin-top:48px;
  padding:34px;
  border-top:1px solid var(--line);
  background:#fff;
  color:var(--muted);
  text-align:center;
  font-size:.85rem;
}
.muted{color:var(--muted)}
@media(max-width:900px){
  .topbar-inner{align-items:flex-start;flex-direction:column;padding:13px 0}
  .topbar nav{width:100%;overflow:auto;flex-wrap:nowrap}
  .hero{align-items:flex-start;flex-direction:column;padding:28px}
  .track-grid,.module-grid,.subject-grid{grid-template-columns:1fr}
  .filter-panel{position:static}
  .filter-grid{grid-template-columns:1fr}
  .question-card{padding:20px}
  .question-topline{align-items:flex-start;flex-direction:column}
}

.filter-panel{
  scroll-margin-top:96px;
}
.filter-panel.collapsed{
  padding:14px 18px;
}
.filter-panel.collapsed .filter-header{
  margin-bottom:0;
}
.filter-panel.collapsed .filter-title-group h2{
  display:none;
}
.filter-panel.collapsed .eyebrow{
  display:none;
}
.filter-title-group{
  min-width:0;
}
.filter-summary{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:.84rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:760px;
}
.filter-header-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.filter-body[hidden]{
  display:none!important;
}
.question-list{
  position:relative;
  z-index:1;
}
@media(max-width:900px){
  .filter-header{
    align-items:flex-start;
    flex-direction:column;
  }
  .filter-header-actions{
    width:100%;
  }
  .filter-header-actions button{
    flex:1;
  }
  .filter-summary{
    max-width:100%;
    white-space:normal;
  }
}

.filter-panel[hidden]{display:none!important}
.filter-panel{
  position:relative;
  top:auto;
  z-index:20;
  margin:18px 0 24px;
}
.filter-fab{
  position:fixed;
  right:24px;
  bottom:24px;
  z-index:60;
  width:52px;
  height:52px;
  border:0;
  border-radius:50%;
  background:var(--teal);
  color:#fff;
  box-shadow:0 12px 28px rgba(8,127,140,.28);
  cursor:pointer;
  display:grid;
  place-items:center;
}
.filter-fab:hover{background:var(--teal-dark)}
.filter-fab-icon{
  font-size:1.2rem;
  line-height:1;
}
.filter-fab-dot{
  position:absolute;
  top:5px;
  right:5px;
  width:10px;
  height:10px;
  border-radius:50%;
  background:#f59e0b;
  border:2px solid #fff;
}
.filters-open .filter-fab{
  opacity:.3;
  pointer-events:none;
}
@media(max-width:900px){
  .filter-fab{
    right:16px;
    bottom:16px;
    width:48px;
    height:48px;
  }
}

.book-grid{display:grid;grid-template-columns:minmax(0,640px)}.book-card{display:grid;grid-template-columns:90px 1fr;min-height:280px;border:1px solid var(--line);border-radius:20px;background:#fff;box-shadow:var(--shadow);overflow:hidden;position:relative}.book-spine{display:grid;place-items:center;background:linear-gradient(180deg,#6b2f22,#3f1b15);color:#f7e5c7;writing-mode:vertical-rl;transform:rotate(180deg);letter-spacing:.12em;font-weight:850}.book-card-body{padding:34px;position:relative}.reader-layout,.chapter-shell{display:grid;grid-template-columns:320px minmax(0,1fr);gap:24px;align-items:start}.toc-sticky{position:sticky;top:92px;max-height:calc(100vh - 112px);overflow:auto;padding:20px;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:var(--shadow)}.toc-sticky input{width:100%;padding:11px;border:1px solid var(--line);border-radius:9px;margin-bottom:14px}#tocTree details{border-bottom:1px solid var(--line);padding:8px 0}#tocTree summary{cursor:pointer;font-weight:800}#tocTree a,.chapter-outline a{display:flex;gap:9px;padding:8px 6px;color:var(--muted);font-size:.86rem}.reader-card,.unit-card{padding:26px;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:var(--shadow);margin-bottom:18px}.unit-card{display:grid;grid-template-columns:64px 1fr;gap:18px}.unit-number{width:54px;height:54px;border-radius:15px;background:#e7f5f6;color:var(--teal-dark);display:grid;place-items:center;font-weight:850}.chapter-links{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.chapter-links a{padding:12px;border:1px solid var(--line);border-radius:10px;background:#f8fafb}.chapter-links span{display:block;color:var(--muted);font-size:.75rem}.annotation-toolbar{position:sticky;top:82px;z-index:35;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 14px;margin-bottom:12px;border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.97);box-shadow:var(--shadow)}.tool-group{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.tool{border:1px solid var(--line);background:#eef2f4;color:var(--ink);padding:8px 10px;border-radius:8px;cursor:pointer}.tool.active{background:var(--teal);color:#fff}.danger-light{background:#fdecec;color:var(--red)}.book-page{position:relative;padding:54px 60px;min-height:900px;border:1px solid #d8d1c5;border-radius:8px;background:#fffdf7;box-shadow:0 18px 45px rgba(38,30,22,.09);overflow:hidden}.chapter-heading{padding-bottom:24px;margin-bottom:28px;border-bottom:2px solid #d8cbb6}.chapter-heading h1{font-family:Georgia,serif;font-size:2.5rem}.book-content{position:relative;z-index:2;font-family:Georgia,'Times New Roman',serif;font-size:1.05rem;line-height:1.82;color:#2f2b26}.book-content h3{margin:2.2rem 0 .7rem;font-size:1.55rem}.book-content p{text-align:justify}.book-content blockquote{margin:1.5rem 0;padding:16px 20px;border-left:4px solid #aa7c4f;background:#f8f1e7}.saved-highlight{background:rgba(255,220,55,.62)}#annotationCanvas{position:absolute;inset:0;z-index:8;pointer-events:none}.chapter-pagination{display:flex;justify-content:space-between;gap:16px;margin:18px 0 34px}.chapter-pagination a{max-width:48%;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:#fff}@media(max-width:950px){.reader-layout,.chapter-shell{grid-template-columns:1fr}.toc-sticky{position:relative;top:auto;max-height:none}.chapter-links{grid-template-columns:1fr}.book-page{padding:34px 24px}}

.reader-app{position:relative}.reader-main{width:min(900px,100%);margin:auto}.reader-fab,.topic-fab{position:fixed;z-index:80;width:48px;height:48px;border:0;border-radius:50%;background:var(--teal);color:#fff;box-shadow:0 10px 24px rgba(0,0,0,.18);cursor:pointer}.reader-fab{right:22px;bottom:22px}.topic-fab{left:22px;bottom:22px}
.reader-controls-modal{position:fixed;right:20px;bottom:82px;z-index:90;width:min(390px,calc(100vw - 32px));max-height:calc(100vh - 120px);overflow:auto;padding:18px;border:1px solid var(--line);border-radius:16px;background:#fff;box-shadow:0 20px 55px rgba(15,30,40,.22)}.controls-head,.drawer-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.controls-head button,.drawer-head button{border:0;background:transparent;font-size:1.1rem;cursor:pointer}.control-section{padding:12px 0;border-top:1px solid var(--line)}.control-section>span{display:block;margin-bottom:8px;font-size:.76rem;font-weight:850;text-transform:uppercase;color:var(--muted)}.segmented{display:flex;gap:6px;flex-wrap:wrap}.segmented button,.control-actions button{border:1px solid var(--line);border-radius:8px;padding:8px 10px;background:#eef2f4;cursor:pointer}.control-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.color-row{display:flex;gap:10px}.color-dot{width:30px;height:30px;border:2px solid transparent;border-radius:50%;cursor:pointer}.color-dot.active{border-color:#18242e;box-shadow:0 0 0 2px #fff inset}.color-dot.yellow{background:#ffe45c}.color-dot.green{background:#9bea9b}.color-dot.blue{background:#9bd2ff}.color-dot.pink{background:#ffadd2}
.topic-drawer{position:fixed;left:18px;top:82px;bottom:18px;z-index:85;width:min(340px,calc(100vw - 36px));overflow:auto;padding:18px;border:1px solid var(--line);border-radius:16px;background:#fff;box-shadow:0 20px 55px rgba(15,30,40,.22)}.topic-drawer>a{display:block;padding:9px 7px;border-bottom:1px solid #edf0f2;color:var(--muted)}
.book-page.theme-white{background:#fff;color:#202020}.book-page.theme-light{background:#f7f9fb;color:#1c2832}.book-page.theme-warm{background:#fffdf7;color:#2f2b26}.study-layer{position:relative;z-index:3;margin-top:36px;padding-top:26px;border-top:3px solid var(--teal)}.study-layer header h2{margin:5px 0 18px}.focus-block{margin:18px 0;padding:18px;border-radius:12px;background:rgba(8,127,140,.07)}.focus-block h3{margin-top:0}.year-chips{display:flex;gap:6px;flex-wrap:wrap}.year-chips span{padding:3px 8px;border-radius:999px;background:#fff;color:var(--teal-dark);font-weight:850}.pyq-note{margin:10px 0;padding:12px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.75)}.pyq-note summary{cursor:pointer;font-weight:750}.pyq-note summary span{margin-right:8px;color:var(--teal)}
.saved-highlight.hl-yellow{background:rgba(255,228,92,.68)}.saved-highlight.hl-green{background:rgba(155,234,155,.68)}.saved-highlight.hl-blue{background:rgba(155,210,255,.68)}.saved-highlight.hl-pink{background:rgba(255,173,210,.68)}
.reader-fullscreen .topbar,.reader-fullscreen footer{display:none}.reader-fullscreen .reader-main{width:min(980px,100%);padding:18px}.reader-fullscreen .book-page{min-height:100vh;border-radius:0;box-shadow:none}.reader-fullscreen .reader-fab,.reader-fullscreen .topic-fab{display:block}
@media(max-width:700px){.reader-fab{right:14px;bottom:14px}.topic-fab{left:14px;bottom:14px}.book-page{padding:28px 20px}.reader-controls-modal{right:16px;bottom:74px}}

.reader-v2{--reader-bg:#efe9df;--page-bg:#fffaf0;--page-ink:#2d2924;min-height:100vh;margin-left:calc(50% - 50vw);margin-right:calc(50% - 50vw);padding:30px max(22px,calc((100vw - 980px)/2));background:var(--reader-bg)}
.reader-v2[data-theme=white]{--reader-bg:#fff;--page-bg:#fff;--page-ink:#19232c}.reader-v2[data-theme=light]{--reader-bg:#eef3f6;--page-bg:#f9fbfc;--page-ink:#1e2a33}
.reading-stage{width:min(900px,100%);margin:auto}.book-page-v2{position:relative;min-height:100vh;padding:64px clamp(28px,7vw,86px);border:1px solid rgba(120,110,95,.18);border-radius:22px;background:var(--page-bg);color:var(--page-ink);box-shadow:0 20px 60px rgba(30,38,45,.09);overflow:hidden}
.chapter-heading-v2{position:relative;z-index:2;padding-bottom:28px;margin-bottom:34px;border-bottom:1px solid rgba(120,110,95,.22)}.chapter-context{margin-bottom:9px;color:var(--teal-dark);font-weight:800}.chapter-heading-v2 h1{font-family:Georgia,serif;font-size:clamp(2.25rem,5vw,4rem);line-height:1.08;margin:8px 0}
.book-content-v2{position:relative;z-index:2;font-family:Georgia,serif;font-size:1.08rem;line-height:1.88}.book-content-v2 h3{margin:2.5rem 0 .75rem;font-size:1.65rem}.book-content-v2 h4{margin:2rem 0 .65rem;font-size:1.3rem}.book-content-v2 p{text-align:justify;margin:0 0 1.25rem}
.reader-fab{position:fixed;z-index:100;bottom:22px;width:52px;height:52px;border:0;border-radius:50%;background:var(--teal);color:#fff;box-shadow:0 14px 34px rgba(8,127,140,.28);cursor:pointer}.reader-fab-left{left:22px}.reader-fab-right{right:22px}
.reader-drawer{position:fixed;z-index:120;top:0;bottom:0;width:min(430px,92vw);padding:22px;background:#fff;box-shadow:0 0 55px rgba(18,29,38,.2);overflow:hidden}.reader-drawer[hidden]{display:none!important}.nav-drawer{left:0}.controls-drawer{right:0}
.drawer-header{display:flex;justify-content:space-between;gap:18px;padding-bottom:16px;border-bottom:1px solid var(--line)}.drawer-header h2{margin:5px 0}.drawer-header button{border:0;background:#eef2f4;border-radius:9px;padding:8px 10px}.drawer-scroll{height:calc(100vh - 125px);overflow:auto;padding:12px 2px 30px}.contents-link{display:block;margin:14px 0;padding:11px;background:#eaf5f6;color:var(--teal-dark);font-weight:800;border-radius:9px}.drawer-scroll details{border-bottom:1px solid var(--line);padding:8px 0}.drawer-scroll summary{cursor:pointer;font-weight:850;padding:8px 2px}.drawer-chapter>a{display:block;padding:9px;color:var(--muted)}.drawer-chapter.current>a{background:#eaf5f6;color:var(--teal-dark);font-weight:800}.drawer-topics{display:grid;padding-left:18px}.drawer-topics a{padding:6px 8px;color:var(--muted);font-size:.84rem;border-left:2px solid var(--line)}
.control-section{padding:18px 0;border-bottom:1px solid var(--line)}.control-row{display:flex;gap:8px;flex-wrap:wrap}.control-row button,.wide-control{border:1px solid var(--line);border-radius:9px;padding:9px 11px;background:#eef2f4}.wide-control{width:100%;margin-top:9px}.switch-row{display:flex;justify-content:space-between;padding:10px 0}.color-row{display:flex;gap:10px;margin:12px 0}.color-dot{width:28px;height:28px;border-radius:50%;border:3px solid transparent}.color-dot.active{border-color:var(--ink)}.yellow{background:#f5d742}.green{background:#8bd3a8}.blue{background:#93c5fd}.pink{background:#f9a8d4}
.study-layer{position:relative;z-index:3;margin-bottom:34px;padding:22px;border-radius:16px;background:rgba(8,127,140,.07);border:1px solid rgba(8,127,140,.2)}.study-layer[hidden]{display:none!important}.study-layer-header{display:flex;justify-content:space-between;margin-bottom:15px}.highlight-block{padding:14px 0;border-top:1px solid rgba(8,127,140,.14)}.year-chips{display:flex;gap:7px;flex-wrap:wrap}.year-chips span{padding:5px 8px;border-radius:999px;background:#fff;color:var(--teal-dark);font-weight:850}.pyq-item{padding:11px 0;border-top:1px solid rgba(8,127,140,.14)}
.saved-highlight.highlight-yellow{background:rgba(245,215,66,.62)}.saved-highlight.highlight-green{background:rgba(139,211,168,.62)}.saved-highlight.highlight-blue{background:rgba(147,197,253,.62)}.saved-highlight.highlight-pink{background:rgba(249,168,212,.62)}
.chapter-pagination-v2{display:flex;justify-content:space-between;gap:16px;margin:20px 0 40px}.chapter-pagination-v2 a{max-width:48%;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:var(--page-bg);color:var(--teal-dark);font-weight:750}
body.reader-fullscreen{overflow-y:auto!important;height:auto!important}body.reader-fullscreen .topbar,body.reader-fullscreen footer{display:none!important}body.reader-fullscreen .shell{width:100%;max-width:none}body.reader-fullscreen .reader-v2{min-height:100vh;padding-top:0}body.reader-fullscreen .book-page-v2{border-radius:0;min-height:100vh;box-shadow:none}
html[data-reader-theme=white] body{background:#fff}html[data-reader-theme=light] body{background:#eef3f6}html[data-reader-theme=warm] body{background:#efe9df}
@media(max-width:760px){.reader-v2{padding:12px}.book-page-v2{padding:38px 22px}.chapter-pagination-v2{flex-direction:column}.chapter-pagination-v2 a{max-width:100%}}

/* Section-based Notes Reader V3 */
.reader-v3{
  --reader-bg:#fff;
  --page-bg:#fff;
  --page-ink:#17212b;
  min-height:100vh;
  margin-left:calc(50% - 50vw);
  margin-right:calc(50% - 50vw);
  padding:28px max(20px,calc((100vw - 1040px)/2));
  background:var(--reader-bg);
  color:var(--page-ink);
}
.reader-v3[data-theme="white"]{--reader-bg:#fff;--page-bg:#fff;--page-ink:#17212b}
.reader-v3[data-theme="light"]{--reader-bg:#eef3f6;--page-bg:#f8fafb;--page-ink:#1a2731}
.reader-v3[data-theme="warm"]{--reader-bg:#eee8dd;--page-bg:#fffaf0;--page-ink:#2c2822}
.reading-stage-v3{width:min(1000px,100%);margin:auto}
.book-page-v3{
  position:relative;
  min-height:100vh;
  padding:56px clamp(24px,6vw,76px);
  border:1px solid rgba(110,120,128,.2);
  border-radius:22px;
  background:var(--page-bg);
  color:var(--page-ink);
  box-shadow:0 18px 52px rgba(23,33,43,.08);
  overflow:hidden;
}
.chapter-heading-v3{
  position:relative;
  z-index:2;
  margin-bottom:38px;
  padding-bottom:28px;
  border-bottom:1px solid rgba(110,120,128,.22);
}
.chapter-heading-v3 h1{
  margin:8px 0 0;
  font-family:Georgia,serif;
  font-size:clamp(2.2rem,5vw,4rem);
  line-height:1.08;
  letter-spacing:-.04em;
}
.reader-section{
  position:relative;
  z-index:2;
  padding:34px 0;
  border-top:1px solid rgba(110,120,128,.2);
  scroll-margin-top:28px;
}
.reader-section:first-of-type{border-top:0;padding-top:0}
.reader-section-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:22px;
}
.section-index{
  display:block;
  margin-bottom:4px;
  color:var(--teal-dark);
  font-size:.72rem;
  font-weight:850;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.reader-section-header h2{
  margin:0;
  font-family:Georgia,serif;
  font-size:clamp(1.55rem,3vw,2.15rem);
  line-height:1.2;
}
.revised-button{
  flex:0 0 auto;
  padding:8px 11px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#eef2f4;
  color:var(--muted);
  cursor:pointer;
}
.revised-button.revised{background:#e3f5ea;color:#1b6b44;border-color:#9bcbb1}
.section-source{
  font-family:Georgia,"Times New Roman",serif;
  font-size:1.07rem;
  line-height:1.86;
}
.section-source p{margin:0 0 1.2rem;text-align:justify}
.section-source ul,.section-source ol{padding-left:1.4rem}
.section-source blockquote{
  margin:1.5rem 0;
  padding:16px 19px;
  border-left:4px solid var(--teal);
  background:rgba(8,127,140,.06);
}
.section-study-card{
  margin-top:28px;
  padding:22px;
  border-radius:16px;
  border:1px solid rgba(8,127,140,.2);
  background:rgba(8,127,140,.055);
}
.section-study-card[hidden]{display:none!important}
.section-study-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:13px;
}
.layer-kicker{
  color:var(--teal-dark);
  font-size:.72rem;
  font-weight:850;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.section-study-heading h3{margin:4px 0 0;font-size:1.25rem}
.section-study-heading>span,.inference-label{color:var(--muted);font-size:.75rem}
.study-part{
  padding:15px 0;
  border-top:1px solid rgba(8,127,140,.13);
}
.study-part h4{margin:0 0 9px;font-size:1rem}
.study-part ul{margin:0;padding-left:1.2rem}
.study-part li+li{margin-top:7px}
.expected-part{border-left:3px solid #d39a21;padding-left:15px}
.memory-tags,.year-chips{display:flex;gap:7px;flex-wrap:wrap}
.memory-tags span,.year-chips span{
  padding:5px 8px;
  border-radius:999px;
  background:#fff;
  border:1px solid rgba(8,127,140,.16);
  color:var(--teal-dark);
  font-size:.78rem;
  font-weight:750;
}
.section-pyq-list{display:grid;gap:16px}
.exam-pyq{
  padding:20px;
  border:1px solid rgba(8,127,140,.16);
  border-radius:13px;
  background:var(--page-bg);
}
.exam-pyq-meta{display:flex;gap:8px;align-items:center;color:var(--muted);font-size:.78rem}
.exam-year{
  padding:4px 8px;
  border-radius:999px;
  background:#e5f3f4;
  color:var(--teal-dark);
  font-weight:850;
}
.exam-pyq h4{margin:12px 0 15px;font-size:1.05rem;line-height:1.55}
.exam-options{
  display:grid;
  gap:8px;
  margin:0;
  padding:0;
  list-style:none;
}
.exam-options li{
  display:flex;
  gap:10px;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:rgba(238,242,244,.55);
}
.exam-options li>span{
  flex:0 0 27px;
  width:27px;height:27px;
  display:grid;place-items:center;
  border-radius:50%;
  background:#e4eaed;
  font-weight:850;
}
.exam-options li p{margin:1px 0 0}
.answer-explanation{margin-top:14px}
.answer-explanation summary{
  cursor:pointer;
  padding:10px 12px;
  border-radius:9px;
  background:#e3f2f3;
  color:var(--teal-dark);
  font-weight:800;
}
.answer-box{
  padding:15px;
  border-left:4px solid var(--teal);
  background:rgba(8,127,140,.045);
}
.source-explanation{white-space:pre-line;line-height:1.65}
.explanation-note{color:var(--muted);font-size:.78rem}
.no-direct-pyq{
  padding:16px;
  border-radius:11px;
  background:rgba(238,242,244,.65);
  color:var(--muted);
}
.no-direct-pyq p{margin-bottom:0}
.control-note{color:var(--muted);font-size:.78rem}
.theme-controls button.active{background:var(--teal);color:#fff}
.empty-layer-notice{
  position:relative;
  z-index:2;
  padding:20px;
  border:1px dashed #aebbc4;
  border-radius:13px;
  color:var(--muted);
  text-align:center;
}
.empty-layer-notice[hidden]{display:none!important}
.chapter-pagination-v3{
  display:flex;
  justify-content:space-between;
  gap:16px;
  margin:20px 0 42px;
}
.chapter-pagination-v3 a{
  max-width:48%;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--page-bg);
  color:var(--teal-dark);
  font-weight:750;
}
body.reader-fullscreen{
  height:auto!important;
  min-height:100%!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
}
body.reader-fullscreen .reader-v3{
  min-height:100vh;
  padding-top:0;
  padding-bottom:0;
}
body.reader-fullscreen .book-page-v3{
  min-height:100vh;
  border-radius:0;
  box-shadow:none;
}
html[data-reader-theme="white"] body{background:#fff}
html[data-reader-theme="light"] body{background:#eef3f6}
html[data-reader-theme="warm"] body{background:#eee8dd}
@media(max-width:760px){
  .reader-v3{padding:10px}
  .book-page-v3{padding:36px 20px;border-radius:14px}
  .reader-section-header{flex-direction:column}
  .section-study-heading{flex-direction:column}
  .chapter-pagination-v3{flex-direction:column}
  .chapter-pagination-v3 a{max-width:100%}
}

/* Mobile-safe micro-section reader V4 */
.reader-v4{
  --reader-bg:#fff;--page-bg:#fff;--page-ink:#17212b;
  min-height:100vh;margin-left:calc(50% - 50vw);margin-right:calc(50% - 50vw);
  padding:24px max(18px,calc((100vw - 1020px)/2));background:var(--reader-bg);color:var(--page-ink)
}
.reader-v4[data-theme=white]{--reader-bg:#fff;--page-bg:#fff;--page-ink:#17212b}
.reader-v4[data-theme=light]{--reader-bg:#eef3f6;--page-bg:#f8fafb;--page-ink:#17212b}
.reader-v4[data-theme=warm]{--reader-bg:#eee8dd;--page-bg:#fffaf0;--page-ink:#2d2924}
.reading-stage-v4{width:min(980px,100%);margin:auto}
.book-page-v4{position:relative;min-height:0;padding:52px clamp(22px,6vw,72px);border:1px solid rgba(110,120,128,.2);border-radius:22px;background:var(--page-bg);color:var(--page-ink);box-shadow:0 18px 52px rgba(23,33,43,.08);overflow:visible}
.chapter-heading-v4{position:relative;z-index:2;margin-bottom:34px;padding-bottom:26px;border-bottom:1px solid rgba(110,120,128,.2)}
.chapter-heading-v4 h1{margin:8px 0 0;font-family:Georgia,serif;font-size:clamp(2.1rem,5vw,3.8rem);line-height:1.08}
.reader-section-v4{position:relative;z-index:2;padding:30px 0;border-top:1px solid rgba(110,120,128,.2);scroll-margin-top:22px}
.reader-section-v4:first-of-type{border-top:0;padding-top:0}
.reader-section-header-v4{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:18px}
.reader-section-header-v4 h2{margin:0;font-family:Georgia,serif;font-size:clamp(1.5rem,3vw,2rem)}
.microblock{padding:20px 0;border-top:1px dashed rgba(110,120,128,.18)}
.microblock:first-of-type{border-top:0;padding-top:0}
.micro-source{font-family:Georgia,serif;font-size:1.06rem;line-height:1.82}
.micro-source p{margin:0 0 1rem;text-align:justify}.micro-source ul,.micro-source ol{padding-left:1.35rem}
.micro-highlight,.micro-pyqs{margin-top:14px;padding:16px;border-radius:13px;border:1px solid rgba(8,127,140,.18);background:rgba(8,127,140,.045)}
.micro-highlight[hidden],.micro-pyqs[hidden],.micro-source[hidden]{display:none!important}
.micro-layer-title{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:10px}
.micro-layer-title span{color:var(--teal-dark);font-size:.76rem;font-weight:850;letter-spacing:.08em;text-transform:uppercase}
.micro-layer-title small{color:var(--muted)}
.micro-row{display:grid;grid-template-columns:120px 1fr;gap:12px;padding:10px 0;border-top:1px solid rgba(8,127,140,.12)}
.micro-row:first-of-type{border-top:0}.micro-row strong{font-size:.84rem}.micro-row ul{margin:0;padding-left:1.1rem}.micro-row li+li{margin-top:5px}
.expected-row{border-left:3px solid #d39a21;padding-left:12px}
.mcq-options-v4{display:grid;gap:8px}
.mcq-option-v4{display:flex;gap:10px;align-items:flex-start;width:100%;padding:11px 12px;border:1px solid var(--line);border-radius:10px;background:rgba(238,242,244,.6);text-align:left;cursor:pointer}
.mcq-option-v4>span{flex:0 0 28px;width:28px;height:28px;display:grid;place-items:center;border-radius:50%;background:#e4eaed;font-weight:850}
.mcq-option-v4 p{margin:2px 0 0}.mcq-option-v4.correct{background:#e7f6ed;border-color:#70b28d;color:#175e3d}.mcq-option-v4.correct>span{background:#19734a;color:#fff}
.mcq-option-v4.wrong{background:#fdecec;border-color:#d17e7e;color:#812e2e}.mcq-option-v4.wrong>span{background:#a43a3a;color:#fff}
.embedded-result{margin-top:10px;font-weight:850}.embedded-result.correct{color:#19734a}.embedded-result.wrong{color:#a43a3a}
.answer-explanation-v4{margin-top:12px}.answer-explanation-v4 summary{cursor:pointer;padding:10px 12px;border-radius:9px;background:#e4f1f2;color:var(--teal-dark);font-weight:800}
.answer-box-v4{padding:14px;border-left:4px solid var(--teal);background:rgba(8,127,140,.04)}
.analysis-note{color:var(--muted);font-size:.78rem}
.chapter-pagination-v4{display:flex;justify-content:space-between;gap:16px;margin:20px 0 40px}.chapter-pagination-v4 a{max-width:48%;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:var(--page-bg);color:var(--teal-dark);font-weight:750}
button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:760px){
  html,body{overflow-x:hidden!important}
  .reader-v4{padding:8px}
  .book-page-v4{padding:30px 18px;border-radius:14px;overflow:visible}
  .reader-section-header-v4{flex-direction:column}
  .micro-row{grid-template-columns:1fr}
  .chapter-pagination-v4{flex-direction:column}
  .chapter-pagination-v4 a{max-width:100%}
  #annotationCanvas{display:none!important}
  .reader-drawer{width:94vw}
}

/* Reader V5 refinement */
.reader-section-header-v4{
  display:block;
}
.micro-heading{
  margin:0 0 10px;
  color:var(--teal-dark);
  font-family:Inter,system-ui,sans-serif;
  font-size:.82rem;
  font-weight:850;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.micro-heading[hidden]{display:none!important}
.micro-source p{
  text-indent:1.6em;
}
.micro-source p:first-child{
  text-indent:1.6em;
}
.micro-source li p,
.micro-source blockquote p,
.micro-source .book-callout p{
  text-indent:0;
}
.upsc-key-list{
  margin:0;
  padding-left:1.15rem;
}
.upsc-key-list li+li{
  margin-top:6px;
}
.upsc-recall{
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid rgba(8,127,140,.12);
}
.upsc-recall p{
  margin:5px 0;
  color:var(--teal-dark);
  font-size:.86rem;
  font-weight:700;
}
@media(max-width:760px){
  .reader-v4{
    padding:0;
  }
  .book-page-v4{
    border:0;
    border-radius:0;
    box-shadow:none;
    padding:26px 16px 80px;
  }
  .chapter-heading-v4 h1{
    font-size:clamp(2rem,10vw,3rem);
  }
  .micro-source{
    font-size:1rem;
    line-height:1.72;
  }
  .micro-source p{
    text-align:left;
    text-indent:1.35em;
  }
  .micro-highlight,
  .micro-pyqs{
    padding:14px;
  }
  .micro-layer-title{
    align-items:flex-start;
    flex-direction:column;
  }
  .mcq-option-v4{
    padding:10px;
  }
  .reader-fab{
    width:46px;
    height:46px;
    bottom:12px;
  }
  .reader-fab-left{left:12px}
  .reader-fab-right{right:12px}
}

.always-visible-micro-heading{margin:0 0 9px;padding:0 0 6px;border-bottom:1px solid rgba(8,127,140,.13);color:var(--teal-dark);font-family:Inter,system-ui,sans-serif;font-size:.86rem;font-weight:850;line-height:1.35;letter-spacing:.02em;text-transform:none}
.always-visible-micro-heading[hidden]{display:none!important}
.microblock{padding:18px 0}.micro-source p{margin:0 0 .9rem;text-indent:1.6em}
@media(max-width:760px){.always-visible-micro-heading{font-size:.82rem;line-height:1.3}.microblock{padding:15px 0}.micro-source p{text-indent:1.3em;line-height:1.68}}

/* Reader V7 — mobile justification, stronger indent and source emphasis */
.micro-source p{
  text-align:justify;
  text-justify:inter-word;
  text-indent:2.5em;
  hyphens:auto;
  -webkit-hyphens:auto;
}
.source-key{
  font-weight:800;
  padding:0 .05em;
  border-radius:.18em;
  box-decoration-break:clone;
  -webkit-box-decoration-break:clone;
}
.source-year{
  color:#8a4b08;
  background:rgba(245,158,11,.12);
}
.source-institution{
  color:#075d66;
  background:rgba(8,127,140,.10);
}
.source-event{
  color:#6d3ca3;
  background:rgba(124,58,237,.08);
}
.source-causality{
  color:#96364d;
  background:rgba(190,24,93,.07);
}
.source-name{
  color:#24519a;
  background:rgba(59,130,246,.08);
}
@media(max-width:760px){
  .micro-source p{
    text-align:justify!important;
    text-justify:inter-word;
    text-indent:2.5em!important;
    line-height:1.74;
    overflow-wrap:break-word;
    word-break:normal;
    hyphens:auto;
    -webkit-hyphens:auto;
  }
  .source-key{
    font-weight:800;
  }
}

/* Reader V8 — collapsible section list and section-by-section reading */
.chapter-sections-dropdown{
  margin:4px 0 10px 10px;
  border-left:2px solid var(--line);
}
.chapter-sections-dropdown>summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 10px;
  color:var(--teal-dark);
  font-size:.82rem;
  font-weight:850;
  cursor:pointer;
  list-style:none;
}
.chapter-sections-dropdown>summary::-webkit-details-marker{
  display:none;
}
.chapter-sections-dropdown>summary::before{
  content:'▸';
  margin-right:2px;
}
.chapter-sections-dropdown[open]>summary::before{
  content:'▾';
}
.chapter-sections-dropdown>summary small{
  min-width:25px;
  padding:2px 7px;
  border-radius:999px;
  background:#e7f3f4;
  text-align:center;
}
.drawer-topics{
  padding:2px 5px 8px 12px;
}
.drawer-topics a{
  display:grid;
  grid-template-columns:24px minmax(0,1fr);
  align-items:start;
  gap:7px;
}
.drawer-topics a>span{
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#eef2f4;
  font-size:.7rem;
  font-weight:850;
}
.drawer-topics a.active{
  color:var(--teal-dark);
  border-left-color:var(--teal);
  background:#eaf5f6;
}
.reading-scope-control{
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--line);
}
.control-label{
  display:block;
  margin-bottom:8px;
  color:var(--muted);
  font-size:.78rem;
  font-weight:800;
}
.segmented-control{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px;
  padding:4px;
  border-radius:11px;
  background:#e9eef1;
}
.segmented-control button{
  border:0;
  border-radius:8px;
  padding:9px;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  font-weight:750;
}
.segmented-control button.active{
  background:#fff;
  color:var(--teal-dark);
  box-shadow:0 2px 8px rgba(23,33,43,.08);
}
.section-read-status{
  position:relative;
  z-index:2;
  display:grid;
  grid-template-columns:auto auto minmax(0,1fr);
  align-items:center;
  gap:9px;
  margin:-10px 0 28px;
  padding:12px 14px;
  border:1px solid rgba(8,127,140,.18);
  border-radius:12px;
  background:rgba(8,127,140,.055);
}
.section-read-status[hidden]{
  display:none!important;
}
.section-read-label{
  color:var(--teal-dark);
  font-size:.7rem;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.section-read-status strong{
  white-space:nowrap;
}
.section-read-status>span:last-child{
  min-width:0;
  overflow:hidden;
  color:var(--muted);
  text-overflow:ellipsis;
  white-space:nowrap;
}
.section-reader-navigation{
  position:fixed;
  z-index:95;
  left:50%;
  bottom:18px;
  width:min(520px,calc(100vw - 150px));
  min-height:58px;
  transform:translateX(-50%);
  display:grid;
  grid-template-columns:48px minmax(0,1fr) 48px;
  align-items:center;
  gap:10px;
  padding:7px;
  border:1px solid rgba(8,127,140,.2);
  border-radius:18px;
  background:rgba(255,255,255,.97);
  box-shadow:0 16px 40px rgba(23,33,43,.18);
  backdrop-filter:blur(14px);
}
.section-reader-navigation[hidden]{
  display:none!important;
}
.section-reader-navigation button{
  width:44px;
  height:44px;
  border:0;
  border-radius:13px;
  background:var(--teal);
  color:#fff;
  cursor:pointer;
  font-size:1.25rem;
}
.section-reader-navigation button:disabled{
  background:#d7e0e4;
  color:#87949d;
}
.section-reader-navigation>div{
  min-width:0;
  text-align:center;
}
.section-reader-navigation strong{
  display:block;
  color:var(--teal-dark);
  font-size:.87rem;
}
.section-reader-navigation span{
  display:block;
  overflow:hidden;
  color:var(--muted);
  font-size:.76rem;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.section-reading-active .chapter-pagination-v4{
  display:none;
}
.section-reading-active .book-page-v4{
  padding-bottom:110px;
}
[data-reader-section][hidden]{
  display:none!important;
}
@media(max-width:760px){
  .chapter-sections-dropdown{
    margin-left:4px;
  }
  .section-read-status{
    grid-template-columns:1fr;
    gap:3px;
    padding:11px 12px;
  }
  .section-read-status>span:last-child{
    white-space:normal;
  }
  .section-reader-navigation{
    bottom:10px;
    width:calc(100vw - 126px);
    min-height:54px;
    grid-template-columns:42px minmax(0,1fr) 42px;
    border-radius:16px;
  }
  .section-reader-navigation button{
    width:40px;
    height:40px;
  }
  .section-reader-navigation strong{
    font-size:.8rem;
  }
  .section-reader-navigation span{
    font-size:.7rem;
  }
}

/* Reader V9 */
.controls-drawer{
  height:100dvh;
  max-height:100dvh;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  padding-bottom:42px;
}
.controls-drawer .drawer-header{
  position:sticky;
  top:0;
  z-index:3;
  margin:-22px -22px 0;
  padding:22px 22px 16px;
  background:#fff;
}
.always-visible-micro-heading{
  font-size:1.1rem!important;
  line-height:1.45!important;
  font-weight:850;
  letter-spacing:0!important;
}
.source-key,.source-year,.source-institution,.source-event,.source-causality,.source-name{
  color:inherit!important;
  background:none!important;
  padding:0!important;
  border-radius:0!important;
}
.source-important{
  color:inherit;
  background:none;
  padding:0;
  font-weight:850;
}
@media(max-width:760px){
  .always-visible-micro-heading{
    font-size:1.06rem!important;
    line-height:1.42!important;
  }
}

/* Reader V10 — lightweight rendering */
.layer-loading,.layer-error{
  padding:12px;
  border-radius:9px;
  background:#f3f6f7;
  color:var(--muted);
  font-size:.85rem;
}
.layer-error{
  color:#8a2f2f;
  background:#fff0f0;
}
.microblock{
  content-visibility:auto;
  contain-intrinsic-size:280px;
}
.micro-highlight,.micro-pyqs{
  content-visibility:auto;
  contain-intrinsic-size:120px;
}

/* Reader V11 — nested Unit → Chapter → Section tree */
.nested-book-tree details{
  border:0;
}
.tree-unit{
  border-bottom:1px solid var(--line)!important;
  padding:5px 0!important;
}
.tree-unit>summary,
.tree-chapter>summary{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  cursor:pointer;
  list-style:none;
}
.tree-unit>summary::-webkit-details-marker,
.tree-chapter>summary::-webkit-details-marker{
  display:none;
}
.tree-unit>summary{
  padding:10px 4px!important;
  font-size:.95rem;
  font-weight:900!important;
}
.tree-unit>summary::before,
.tree-chapter>summary::before{
  content:'▸';
  flex:0 0 auto;
  margin-top:1px;
  color:var(--teal-dark);
}
.tree-unit[open]>summary::before,
.tree-chapter[open]>summary::before{
  content:'▾';
}
.tree-unit>summary>span,
.tree-chapter>summary>span{
  flex:1;
  min-width:0;
}
.tree-unit>summary small,
.tree-chapter>summary small{
  flex:0 0 auto;
  padding:3px 7px;
  border-radius:999px;
  background:#edf3f4;
  color:var(--muted);
  font-size:.68rem;
  white-space:nowrap;
}
.tree-unit-children{
  padding:0 0 8px 10px;
}
.tree-chapter{
  margin:3px 0;
  border-left:2px solid var(--line)!important;
}
.tree-chapter>summary{
  padding:9px 10px!important;
  color:var(--muted);
  font-size:.86rem;
  font-weight:750!important;
}
.tree-chapter.current>summary{
  background:#e7f3f4;
  color:var(--teal-dark);
  font-weight:900!important;
}
.tree-sections{
  display:grid;
  padding:2px 4px 10px 18px;
}
.tree-sections a{
  display:grid;
  grid-template-columns:24px minmax(0,1fr);
  gap:7px;
  align-items:start;
  padding:7px 8px;
  border-left:2px solid var(--line);
  color:var(--muted);
  font-size:.78rem;
  line-height:1.4;
}
.tree-sections a:hover,
.tree-sections a.active{
  border-left-color:var(--teal);
  background:#eef7f7;
  color:var(--teal-dark);
}
.tree-sections a>span{
  width:21px;
  height:21px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#edf1f3;
  font-size:.68rem;
  font-weight:850;
}
.source-important{
  font-weight:900!important;
}
@media(max-width:760px){
  .tree-unit>summary{
    font-size:.9rem;
  }
  .tree-chapter>summary{
    font-size:.82rem;
  }
  .tree-sections a{
    font-size:.76rem;
  }
}

/* Reader V12 — intelligent revision narrative */
.lecturer-narrative{
  display:grid;
  gap:10px;
}
.lecturer-step{
  display:grid;
  grid-template-columns:28px minmax(0,1fr);
  gap:10px;
  align-items:start;
}
.lecturer-step>span{
  width:26px;
  height:26px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:var(--teal);
  color:#fff;
  font-size:.72rem;
  font-weight:900;
}
.lecturer-step p{
  margin:1px 0 0;
  line-height:1.65;
}
.lecturer-chronology{
  margin-top:13px;
  padding:11px 13px;
  border-left:3px solid var(--teal);
  border-radius:0 9px 9px 0;
  background:rgba(8,127,140,.055);
  color:var(--teal-dark);
  font-size:.86rem;
  font-weight:800;
  line-height:1.5;
}
@media(max-width:760px){
  .lecturer-step{
    grid-template-columns:24px minmax(0,1fr);
    gap:8px;
  }
  .lecturer-step>span{
    width:23px;
    height:23px;
  }
  .lecturer-step p{
    line-height:1.58;
  }
}

/* V13 Mains-first intelligent reader */
.upsc-focus-only .microblock[data-upsc-relevance="low"]{display:none!important}.ai-narrative-study-layer,.mains-pyq-study-layer{content-visibility:auto;contain-intrinsic-size:120px}.ai-narrative-box{border-left:4px solid currentColor;padding:10px 14px;background:color-mix(in srgb,currentColor 6%,transparent);line-height:1.68}.ai-narrative-box p{margin:.35rem 0}.reader-v4[data-ai-color="teal"] .ai-narrative-study-layer{color:#096f78}.reader-v4[data-ai-color="blue"] .ai-narrative-study-layer{color:#245ca6}.reader-v4[data-ai-color="purple"] .ai-narrative-study-layer{color:#7043a5}.reader-v4[data-ai-color="brown"] .ai-narrative-study-layer{color:#875126}.reader-v4[data-ai-color="green"] .ai-narrative-study-layer{color:#27764a}.ai-color-picker{display:grid;gap:6px;margin-top:10px}.ai-color-picker select{padding:9px;border:1px solid var(--line);border-radius:9px;background:var(--surface)}.mains-source-card{border:1px solid var(--line);border-radius:13px;padding:16px;margin:12px 0;background:var(--surface)}.mains-source-card h4{line-height:1.55}.mains-framework{padding:12px 4px}.mains-framework h5{margin:14px 0 6px}.mains-framework li{margin:5px 0}.mains-pyq-shell{max-width:1100px;margin:auto}.mains-filter-fab{position:sticky;top:70px;z-index:4}.mains-filter-drawer{position:fixed;right:18px;top:70px;width:min(360px,calc(100vw - 36px));max-height:82vh;overflow:auto;background:#fff;border:1px solid var(--line);box-shadow:0 20px 60px #0002;padding:20px;border-radius:16px;z-index:40}.mains-filter-drawer select,.mains-filter-drawer input{width:100%;margin:6px 0;padding:11px;border:1px solid var(--line);border-radius:9px}.mains-stats{margin:18px 0;color:var(--muted)}.mains-question-list{display:grid;gap:14px}.mains-explorer-card{border:1px solid var(--line);border-radius:14px;padding:18px;background:var(--surface)}.mains-explorer-card h3{font-size:1rem;line-height:1.55;margin:.5rem 0}.mains-explorer-card small{color:var(--muted)}
@media(max-width:760px){.mains-source-card{padding:12px}.mains-filter-fab{top:10px}.ai-narrative-box{padding:9px 11px}}

/* V14 adaptive exam reader */
.reader-v4[data-theme=dark]{--reader-bg:#111820;--page-bg:#18222c;--page-ink:#e7edf2;--surface:#202d38;--line:#41505d;--muted:#aebac4;--teal-dark:#7fd3d8;background:var(--reader-bg);color:var(--page-ink)}
.reader-v4[data-theme=dark] .book-page-v4,.reader-v4[data-theme=dark] .reader-drawer,.reader-v4[data-theme=dark] .mains-source-card{background:var(--page-bg);color:var(--page-ink)}
.reader-v4[data-theme=dark] .micro-source,.reader-v4[data-theme=dark] .micro-heading,.reader-v4[data-theme=dark] h1,.reader-v4[data-theme=dark] h2,.reader-v4[data-theme=dark] h3,.reader-v4[data-theme=dark] h4{color:var(--page-ink)}
.reader-v4[data-theme=dark] .theme-controls button,.reader-v4[data-theme=dark] select,.reader-v4[data-theme=dark] button{color:var(--page-ink);background:#25333f;border-color:#465866}
.section-learning-arc{margin:.45rem 0 0;color:var(--muted);font-size:.86rem;line-height:1.5;max-width:760px}
/* Focus mode keeps the complete source visible. */
.upsc-focus-only .microblock{transition:opacity .2s ease,filter .2s ease}
.upsc-focus-only .microblock[data-upsc-relevance="background"]{opacity:.28;filter:saturate(.25)}
.upsc-focus-only .microblock[data-upsc-relevance="background"] .micro-source{text-decoration:line-through;text-decoration-color:color-mix(in srgb,currentColor 28%,transparent);text-decoration-thickness:1px}
.upsc-focus-only .microblock[data-upsc-relevance="medium"]{opacity:.68}
.upsc-focus-only .microblock[data-upsc-relevance="high"]{opacity:1;filter:none}
.upsc-focus-only .microblock:hover,.upsc-focus-only .microblock:focus-within{opacity:1!important;filter:none!important}
.focus-profile{margin:10px 0 14px;padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:color-mix(in srgb,var(--teal) 5%,var(--page-bg));font-size:.86rem;line-height:1.55}
.focus-profile-head{display:flex;justify-content:space-between;gap:10px}.focus-profile ul{margin:.5rem 0 0;padding-left:1.2rem}.focus-high{border-left:4px solid #167b58}.focus-medium{border-left:4px solid #c28a1b}.focus-background{border-left:4px solid #8d98a1}
.ai-coach-box{display:grid;gap:10px;border-left:4px solid currentColor;padding:12px 14px;background:color-mix(in srgb,currentColor 6%,var(--page-bg));border-radius:0 12px 12px 0}
.ai-coach-turn{display:grid;grid-template-columns:52px minmax(0,1fr);gap:10px;align-items:start}.ai-coach-turn span{font-size:.7rem;text-transform:uppercase;font-weight:900;letter-spacing:.05em}.ai-coach-turn p{margin:0;line-height:1.62}
.source-model-answer{padding:14px 2px}.source-model-answer h5{font-size:1rem}.answer-intro,.answer-analysis,.answer-conclusion{line-height:1.65}.answer-dimension{margin:10px 0;padding:10px 12px;border-left:3px solid var(--teal);background:color-mix(in srgb,var(--teal) 5%,var(--page-bg))}.answer-dimension p{margin:.3rem 0 0;line-height:1.6}
@media(max-width:760px){
 .reader-v4{padding:0!important}.reading-stage-v4{width:100%;overflow-x:hidden}.book-page-v4{border-radius:0!important;padding:22px 18px 110px!important;max-width:100%!important}.chapter-heading-v4 h1{font-size:2rem!important;line-height:1.08}.micro-source{font-size:1.03rem!important;line-height:1.72!important;text-align:left!important}.always-visible-micro-heading{font-size:1.08rem!important;line-height:1.4}.reader-drawer{width:min(94vw,420px)!important;max-width:94vw!important}.controls-drawer,.nav-drawer{overflow-y:auto!important;-webkit-overflow-scrolling:touch}.ai-coach-turn{grid-template-columns:44px minmax(0,1fr)}.mains-source-card{padding:13px}.exam-pyq-meta{display:flex;flex-wrap:wrap;gap:5px}.source-model-answer{font-size:.93rem}.section-reader-navigation{left:10px!important;right:10px!important;bottom:10px!important}.reader-fab{width:52px!important;height:52px!important}.tree-sections a{grid-template-columns:22px minmax(0,1fr)!important}.upsc-focus-only .microblock[data-upsc-relevance="background"]{opacity:.36}}

/* Reader V15: precise source focus and simplified UI */
.ai-narrative-study-layer,.ai-color-picker,[data-layer-kind="ai"]{display:none!important}
.upsc-focus-precise .micro-source{color:transparent!important;text-shadow:none!important}
.upsc-focus-precise .micro-source strong.source-important,
.upsc-focus-precise .micro-source strong.source-important *{color:var(--reader-ink,#17212b)!important;opacity:1!important}
.upsc-focus-precise .micro-source strong:not(.source-important){color:transparent!important}
html[data-reader-theme="dark"] .upsc-focus-precise .micro-source strong.source-important{color:#f2f6f7!important}
html[data-reader-theme="dark"], [data-theme="dark"]{--reader-bg:#11171b;--reader-surface:#182126;--reader-ink:#eef3f5;--reader-muted:#a8b3ba;--line:#344148}
html[data-reader-theme="light"], [data-theme="light"]{--reader-bg:#eef2f4;--reader-surface:#fff;--reader-ink:#17212b}
html[data-reader-theme="warm"], [data-theme="warm"]{--reader-bg:#eee7da;--reader-surface:#fffaf0;--reader-ink:#2a241f}
.book-page-v4{background:var(--reader-surface,#fff);color:var(--reader-ink,#17212b)}
.micro-source{color:var(--reader-ink,#17212b)}
.no-direct-pyq{display:none!important}.micro-pyqs:has(.no-direct-pyq){display:none!important}
.reader-drawer{border-radius:18px}.control-section{padding:18px 0}.switch-row{border-radius:11px}
.mains-source-card details[open]{background:rgba(8,127,140,.035);border-radius:12px;padding:12px}
.source-model-answer{display:grid;gap:12px}.answer-dimension{padding:10px 12px;border-left:3px solid var(--teal);background:rgba(8,127,140,.045)}
@media(max-width:760px){
 .book-page-v4{padding-left:15px!important;padding-right:15px!important}
 .reader-drawer{width:min(92vw,390px)!important;border-radius:0}
 .micro-source{font-size:1rem;line-height:1.72}
 .always-visible-micro-heading{font-size:1.04rem!important;line-height:1.38!important}
 .mains-source-card{padding:13px}.source-model-answer{font-size:.93rem}
 .reader-fab{width:44px;height:44px}
}

/* Reader V16 — fitted page, stable section reading and progress */
.reader-v4{padding-left:clamp(10px,3vw,34px)!important;padding-right:clamp(10px,3vw,34px)!important;overflow:visible}
.reading-stage-v4{width:min(1120px,100%)!important;max-width:100%;overflow:visible!important}
.book-page-v4{box-sizing:border-box;width:100%;max-width:100%;min-height:0!important;overflow:visible!important;contain:none!important}
.chapter-heading-v4,.reader-section-v4,.microblock{scroll-margin-top:16px}
.section-reading-active .book-page-v4{min-height:0!important;padding-bottom:86px!important}
.section-reading-active .reader-section-v4{min-height:0!important;padding-bottom:8px!important}
.section-reading-active .reader-section-header-v4{margin-bottom:14px}
.reader-progress-track{position:fixed;z-index:120;top:0;left:0;right:0;height:3px;background:transparent;pointer-events:none}
.reader-progress-fill{width:100%;height:100%;transform:scaleX(0);transform-origin:left center;background:var(--teal);transition:transform .12s linear}
.section-reader-navigation small{display:block;margin-top:2px;color:var(--muted);font-size:.68rem}
html{scroll-behavior:auto!important;overflow-anchor:none}
.reader-section-v4[hidden]{display:none!important}
@media(max-width:760px){
 .reader-v4{padding:0!important}
 .reading-stage-v4{width:100%!important}
 .book-page-v4{width:100%!important;border-left:0!important;border-right:0!important;padding:20px 17px 82px!important}
 .chapter-heading-v4{margin-bottom:24px!important;padding-bottom:20px!important}
 .section-read-status{margin-bottom:20px!important}
 .section-reader-navigation{width:auto!important;left:8px!important;right:8px!important}
}

/* Reader V18 — recovered study layers and reduced heading noise */
.stable-study-layer-controls{
  display:grid;
  width:100%;
  gap:2px;
}
.stable-study-layer-controls .switch-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 22px!important;
  align-items:center;
  gap:14px;
  min-height:44px;
  width:100%;
  margin:0!important;
  padding:9px 0!important;
}
.stable-study-layer-controls .switch-row span{
  min-width:0;
  line-height:1.35;
}
.stable-study-layer-controls .switch-row input{
  width:18px;
  height:18px;
  margin:0!important;
  justify-self:end;
}
.micro-pyqs:empty,
.mains-pyq-study-layer:empty,
[data-layer-kind="pyqs"]:empty,
[data-layer-kind="mains"]:empty{
  display:none!important;
}
.source-model-answer-v18{
  margin-top:14px;
  padding:16px;
  border-top:1px solid var(--line);
}
.source-model-answer-v18 h5{
  margin:16px 0 6px;
  font-size:.9rem;
}
.source-model-answer-v18 p,
.source-model-answer-v18 li{
  line-height:1.65;
}
.answer-dimension-v18{
  margin:10px 0;
  padding:10px 12px;
  border-left:3px solid var(--teal);
  background:rgba(8,127,140,.045);
}
.answer-dimension-v18 p{
  margin:5px 0 0;
}
.microblock:not(:has(.micro-heading)){
  padding-top:4px;
}
@media(max-width:760px){
  .stable-study-layer-controls .switch-row{
    min-height:48px;
    padding:11px 0!important;
  }
  .source-model-answer-v18{
    padding:12px;
  }
}

/* Reader V19 — server-rendered revision notes and stable layers */
.stable-study-layer-controls{
  display:grid!important;
  gap:3px!important;
  width:100%;
}
.stable-study-layer-controls .switch-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 22px!important;
  align-items:center!important;
  gap:14px!important;
  width:100%;
  min-height:44px;
  margin:0!important;
  padding:9px 0!important;
}
.stable-study-layer-controls .switch-row input{
  width:18px;
  height:18px;
  margin:0!important;
  justify-self:end;
}
.server-revision-notes:empty,
.micro-pyqs:empty,
.mains-pyq-study-layer:empty{
  display:none!important;
}
.server-revision-notes{
  margin-top:18px;
}
@media(max-width:760px){
  .stable-study-layer-controls .switch-row{
    min-height:48px;
    padding:11px 0!important;
  }
}

/* Reader V20 — functional independent layer controls */
html:not([data-reader-controls-ready="true"]) .source-study-layer,
html:not([data-reader-controls-ready="true"]) .micro-heading,
html:not([data-reader-controls-ready="true"]) .server-revision-notes,
html:not([data-reader-controls-ready="true"]) [data-layer-kind="pyqs"],
html:not([data-reader-controls-ready="true"]) [data-layer-kind="mains"]{
  display:none!important;
}
.stable-study-layer-controls{
  display:grid!important;
  gap:3px!important;
  width:100%;
}
.stable-study-layer-controls .switch-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 22px!important;
  align-items:center!important;
  gap:14px!important;
  width:100%;
  min-height:46px;
  margin:0!important;
  padding:9px 0!important;
  cursor:pointer;
}
.stable-study-layer-controls .switch-row span{
  min-width:0;
  line-height:1.35;
}
.stable-study-layer-controls .switch-row input{
  width:18px;
  height:18px;
  margin:0!important;
  justify-self:end;
  cursor:pointer;
}
.server-revision-notes[hidden],
.source-study-layer[hidden],
.micro-heading[hidden],
[data-layer-kind="pyqs"][hidden],
[data-layer-kind="mains"][hidden]{
  display:none!important;
}
@media(max-width:760px){
  .stable-study-layer-controls .switch-row{
    min-height:50px;
    padding:11px 0!important;
  }
}
