/* अध्ययनसार Study Master v2
   Geography chapter reading language, generalized for long-form study pages.
   Scope is opt-in via body[data-study-master="v2"] so legacy pages are untouched. */

body[data-study-master="v2"]{
  --sm-shell:1340px;
  --sm-sidebar:290px;
  --sm-gap:2rem;
  --sm-radius:16px;
  --sm-shadow:0 8px 24px rgba(15,23,42,.07);
  --sm-navy:#0f172a;
  --sm-blue:#1e40af;
  --sm-saffron:#ea580c;
  background:var(--ds-bg,#f8fafc);
  color:var(--ds-text,#1e293b);
}

body[data-study-master="v2"] .as-study-progress{
  position:fixed;inset:0 0 auto 0;height:4px;z-index:1200;
  background:rgba(148,163,184,.18);pointer-events:none;
}
body[data-study-master="v2"] .as-study-progress>span{
  display:block;width:0;height:100%;
  background:linear-gradient(90deg,#2563eb,#ea580c,#059669);
  transition:width .08s linear;
}

body[data-study-master="v2"] :is(.history-reading-main,.ca-topic-main){
  min-width:0;background:var(--ds-bg,#f8fafc);
}
body[data-study-master="v2"] :is(.history-reading-shell,.ca-topic-shell){
  width:100%;max-width:none;margin:0;padding:0;
}

/* When the shared topic reader owns the outline, it owns the sidebar track.
   Flatten the former inner sidebar grid so it cannot reserve an empty column.
   Mobile and tablet keep their existing layout; standalone master pages keep their grid. */
@media(min-width:981px){
  html body[data-study-master="v2"][data-as-layout="study"] .as-reading-layout > .as-reading-content{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    grid-template-columns:minmax(0,1fr)!important;
  }
  html body[data-study-master="v2"][data-as-layout="study"] .as-reading-layout > .as-reading-content > *{
    grid-column:1/-1!important;
  }
  html body[data-study-master="v2"][data-as-layout="study"] .as-reading-layout > .as-reading-content > .as-original-toc{
    display:none!important;
  }
}

/* Shared long-form grid */
body[data-study-master="v2"][data-as-layout="study"] :is(.history-reading-article,.ca-topic-article).as-reading-content{
  width:min(var(--sm-shell),calc(100% - 2rem));
  max-width:var(--sm-shell);
  margin:1.4rem auto 4rem;
  padding:0;
  display:grid;
  grid-template-columns:minmax(240px,var(--sm-sidebar)) minmax(0,1fr);
  gap:var(--sm-gap);
  align-items:start;
  overflow:visible;
}

/* Breadcrumb */
body[data-study-master="v2"] :is(.history-reading-breadcrumb,.ca-breadcrumb){
  font-size:.84rem;color:var(--ds-text-muted,#64748b);line-height:1.65;
}
body[data-study-master="v2"] .history-reading-breadcrumb{
  grid-column:1/-1;margin:0 .15rem -.9rem;
}
body[data-study-master="v2"] .ca-topic-main>.ca-topic-shell>.ca-breadcrumb{
  width:min(var(--sm-shell),calc(100% - 2rem));
  margin:1.1rem auto 0;
}
body[data-study-master="v2"] :is(.history-reading-breadcrumb,.ca-breadcrumb) a{
  color:var(--ds-primary,#2563eb);text-decoration:none;
}
body[data-study-master="v2"] :is(.history-reading-breadcrumb,.ca-breadcrumb) a:hover{text-decoration:underline}

/* Geography-style hero */
body[data-study-master="v2"] :is(.history-reading-head,.ca-topic-head){
  grid-column:1/-1;
  margin:0;
  padding:2.05rem 2rem 1.75rem;
  border:0;
  border-bottom:4px solid var(--sm-saffron);
  border-radius:var(--sm-radius);
  background:linear-gradient(135deg,var(--sm-navy) 0%,#1e3a8a 58%,var(--sm-blue) 100%);
  color:#fff;
  box-shadow:var(--sm-shadow);
}
body[data-study-master="v2"] :is(.history-reading-head,.ca-topic-head)>span:first-child{
  display:inline-flex;align-items:center;
  margin:0 0 .75rem;padding:.25rem .7rem;border-radius:999px;
  background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.2);
  color:#dbeafe;font-size:.75rem;font-weight:800;letter-spacing:.02em;
}
body[data-study-master="v2"] :is(.history-reading-head,.ca-topic-head) h1{
  max-width:1100px;margin:0;
  color:#fff;
  font-size:clamp(1.65rem,2.5vw,2.25rem);
  line-height:1.35;font-weight:800;text-wrap:balance;
}
body[data-study-master="v2"] :is(.history-reading-head,.ca-topic-head)>p{
  max-width:1000px;margin:.75rem 0 0;
  color:#dbeafe;font-size:1rem;line-height:1.8;
}
body[data-study-master="v2"] .history-reading-tags{
  display:flex;flex-wrap:wrap;gap:.45rem;margin-top:1rem;
}
body[data-study-master="v2"] .history-reading-tags span{
  display:inline-flex;align-items:center;padding:.25rem .65rem;border-radius:999px;
  background:rgba(255,255,255,.11);border:1px solid rgba(255,255,255,.2);
  color:#f8fafc;font-size:.75rem;font-weight:700;
}

/* History / Important Acts TOC */
body[data-study-master="v2"] .history-reading-toc{
  grid-column:1;
  position:sticky;top:5.6rem;
  max-height:calc(100dvh - 7rem);overflow:auto;
  margin:0;padding:0;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:12px;background:var(--ds-surface,#fff);
  box-shadow:0 2px 12px rgba(15,23,42,.05);
  scrollbar-width:thin;
}
body[data-study-master="v2"] .history-reading-toc>summary{
  position:sticky;top:0;z-index:1;
  list-style:none;cursor:pointer;
  padding:1rem 1.05rem;
  background:var(--ds-surface,#fff);
  border-bottom:1px solid var(--ds-border,#e2e8f0);
  color:var(--ds-heading,#0f172a);font-weight:800;font-size:.94rem;
}
body[data-study-master="v2"] .history-reading-toc>summary::-webkit-details-marker{display:none}
body[data-study-master="v2"] .history-reading-toc>div{
  display:flex;flex-direction:column;gap:.15rem;padding:.75rem;
}
body[data-study-master="v2"] .history-reading-toc a{
  display:block;padding:.48rem .6rem;border-left:3px solid transparent;border-radius:7px;
  color:var(--ds-text,#334155);text-decoration:none;font-size:.83rem;font-weight:600;line-height:1.5;
}
body[data-study-master="v2"] .history-reading-toc a:hover,
body[data-study-master="v2"] .history-reading-toc a[aria-current="location"]{
  color:var(--ds-primary,#2563eb);
  border-left-color:var(--ds-primary,#2563eb);
  background:var(--ds-surface-soft,#f1f5f9);
}

/* History content column */
body[data-study-master="v2"] .history-article-content{
  grid-column:2;
  min-width:0;
  display:flex;flex-direction:column;gap:1.25rem;
}
body[data-study-master="v2"][data-as-layout="study"] .as-reading-content .study-master-section{
  margin:0;
  padding:1.65rem 1.8rem;
  min-width:0;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:var(--sm-radius);
  background:var(--ds-surface,#fff);
  box-shadow:var(--sm-shadow);
}
body[data-study-master="v2"] .study-master-section>h2:first-child{
  margin:0 0 1rem;
  padding:0 0 .75rem;
  border-bottom:2px solid var(--ds-border,#e2e8f0);
  color:var(--ds-heading,#0f172a);
  font-size:1.32rem;line-height:1.4;
}
body[data-study-master="v2"] .study-master-section h3{
  margin:1.45rem 0 .65rem;color:var(--ds-heading,#0f172a);font-size:1.08rem;
}
body[data-study-master="v2"] .study-master-section :is(p,li){
  font-size:var(--as-reader-font,1rem);line-height:1.88;
}

/* Static topic pages */
body[data-study-master="v2"] .ca-topic-article>.ca-topic-head{grid-column:1/-1}
body[data-study-master="v2"] .ca-topic-editorial-meta{
  grid-column:1/-1;
  display:flex;flex-wrap:wrap;gap:.5rem;
  margin:-.8rem 0 0;padding:0 .15rem;
}
body[data-study-master="v2"] .ca-topic-editorial-meta span{
  padding:.3rem .65rem;border-radius:999px;
  border:1px solid var(--ds-border,#e2e8f0);
  background:var(--ds-surface,#fff);
  color:var(--ds-text-muted,#64748b);
  font-size:.76rem;font-weight:700;
}
body[data-study-master="v2"] .ca-topic-auto-toc{
  grid-column:1;
  position:sticky;top:5.6rem;
  max-height:calc(100dvh - 7rem);overflow:auto;
  margin:0;padding:1rem;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:12px;background:var(--ds-surface,#fff);
  box-shadow:0 2px 12px rgba(15,23,42,.05);
  scrollbar-width:thin;
}
body[data-study-master="v2"] .ca-topic-auto-toc>strong{
  display:block;padding-bottom:.65rem;margin-bottom:.55rem;
  border-bottom:1px solid var(--ds-border,#e2e8f0);
  color:var(--ds-heading,#0f172a);font-size:.94rem;
}
body[data-study-master="v2"] .ca-topic-auto-toc [data-topic-toc]{
  display:flex;flex-direction:column;gap:.15rem;
}
body[data-study-master="v2"] .ca-topic-auto-toc a{
  display:block;padding:.48rem .6rem;border-left:3px solid transparent;border-radius:7px;
  color:var(--ds-text,#334155);text-decoration:none;font-size:.83rem;font-weight:600;line-height:1.5;
}
body[data-study-master="v2"] .ca-topic-auto-toc a:hover,
body[data-study-master="v2"] .ca-topic-auto-toc a[aria-current="location"]{
  color:var(--ds-primary,#2563eb);border-left-color:var(--ds-primary,#2563eb);
  background:var(--ds-surface-soft,#f1f5f9);
}
body[data-study-master="v2"][data-as-layout="study"] .ca-topic-article>section.study-master-section{
  grid-column:2;
  margin:0 0 1.25rem;
  padding:1.65rem 1.8rem;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:var(--sm-radius);
  background:var(--ds-surface,#fff);
  box-shadow:var(--sm-shadow);
}
body[data-study-master="v2"] .ca-topic-article>section.study-master-section>h2:first-child{
  margin:0 0 1rem;padding:0 0 .75rem;border-bottom:2px solid var(--ds-border,#e2e8f0);
  font-size:1.32rem;line-height:1.4;color:var(--ds-heading,#0f172a);
}

/* Geography-like data surfaces */
body[data-study-master="v2"] :is(.history-table-wrap,.bs-table-wrap,.as-table-scroll){
  max-width:100%;overflow:auto;margin:1.1rem 0;
  border:1px solid var(--ds-border,#e2e8f0);border-radius:12px;background:var(--ds-surface,#fff);
  scrollbar-width:thin;
}
body[data-study-master="v2"] :is(.history-table-wrap,.bs-table-wrap) table{
  width:100%;min-width:620px;border-collapse:collapse;margin:0;
}
body[data-study-master="v2"] :is(.history-table-wrap,.bs-table-wrap) :is(th,td){
  padding:.8rem .9rem;border:1px solid var(--ds-border,#e2e8f0);
  text-align:start;vertical-align:top;line-height:1.7;
}
body[data-study-master="v2"] :is(.history-table-wrap,.bs-table-wrap) th{
  background:var(--ds-surface-soft,#f1f5f9);color:var(--ds-heading,#0f172a);font-weight:750;
}
body[data-study-master="v2"] :is(.history-table-wrap,.bs-table-wrap) tr:nth-child(even) td{
  background:color-mix(in srgb,var(--ds-surface-soft,#f1f5f9) 42%,var(--ds-surface,#fff));
}
body[data-study-master="v2"] :is(blockquote,.fact-box,.key-box,.ca-key-box,.ca-exam-box,.ca-static-box){
  border-left:4px solid var(--ds-primary,#2563eb);
  border-radius:10px;
  background:var(--ds-surface-soft,#f1f5f9);
}

/* Keep related links in the same reading language */
body[data-study-master="v2"] .ca-related>div{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:.7rem;
}
body[data-study-master="v2"] .ca-related a{
  display:flex;justify-content:space-between;gap:1rem;
  padding:.85rem 1rem;border:1px solid var(--ds-border,#e2e8f0);border-radius:10px;
  background:var(--ds-surface-soft,#f8fafc);text-decoration:none;font-weight:700;
}

/* Mobile and tablet */
@media(max-width:980px){
  body[data-study-master="v2"]{--sm-gap:1rem}
  body[data-study-master="v2"][data-as-layout="study"] :is(.history-reading-article,.ca-topic-article).as-reading-content{
    width:min(100% - 1.2rem,820px);
    grid-template-columns:minmax(0,1fr);
    margin-top:1rem;
  }
  body[data-study-master="v2"] :is(.history-reading-breadcrumb,.history-reading-head,.history-reading-toc,.history-article-content),
  body[data-study-master="v2"] :is(.ca-topic-article>.ca-topic-head,.ca-topic-editorial-meta,.ca-topic-auto-toc,.ca-topic-article>section.study-master-section){
    grid-column:1;
  }
  body[data-study-master="v2"] .history-reading-toc,
  body[data-study-master="v2"] .ca-topic-auto-toc{
    position:static;max-height:none;
  }
  body[data-study-master="v2"] :is(.history-reading-head,.ca-topic-head){
    padding:1.45rem 1.15rem 1.25rem;border-radius:13px;
  }
  body[data-study-master="v2"] :is(.history-reading-head,.ca-topic-head) h1{
    font-size:clamp(1.4rem,6vw,1.75rem);
  }
  body[data-study-master="v2"] :is(.history-reading-head,.ca-topic-head)>p{
    font-size:.93rem;line-height:1.72;
  }
  body[data-study-master="v2"][data-as-layout="study"] .as-reading-content .study-master-section,
  body[data-study-master="v2"][data-as-layout="study"] .ca-topic-article>section.study-master-section{
    padding:1.15rem 1rem;border-radius:12px;box-shadow:0 2px 10px rgba(15,23,42,.05);
  }
  body[data-study-master="v2"] .study-master-section>h2:first-child,
  body[data-study-master="v2"] .ca-topic-article>section.study-master-section>h2:first-child{
    font-size:1.16rem;
  }
  body[data-study-master="v2"] .ca-topic-main>.ca-topic-shell>.ca-breadcrumb{
    width:calc(100% - 1.2rem);
  }
}
@media(max-width:560px){
  body[data-study-master="v2"] .history-reading-tags{gap:.35rem}
  body[data-study-master="v2"] .history-reading-tags span{font-size:.69rem}
  body[data-study-master="v2"] :is(.history-table-wrap,.bs-table-wrap) table{min-width:560px}
  body[data-study-master="v2"] .ca-topic-editorial-meta span{font-size:.7rem}
}


/* Economics adapter — preserves subject-specific formulas, diagrams and data styling. */
body[data-study-master="v2"] .economics-reading-main{
  min-width:0;background:var(--ds-bg,#f8fafc);
}
body[data-study-master="v2"] .economics-reading-shell{
  width:100%;max-width:none;margin:0;padding:0;
}
body[data-study-master="v2"][data-as-layout="study"] .economics-reading-article.as-reading-content{
  width:min(var(--sm-shell),calc(100% - 2rem));
  max-width:var(--sm-shell);
  margin:1.4rem auto 4rem;
  padding:0;
  display:grid;
  grid-template-columns:minmax(240px,var(--sm-sidebar)) minmax(0,1fr);
  gap:var(--sm-gap);
  align-items:start;
  overflow:visible;
}
body[data-study-master="v2"] .economics-breadcrumb{
  grid-column:1/-1;margin:0 .15rem -.9rem;
  color:var(--ds-text-muted,#64748b);font-size:.84rem;line-height:1.65;
}
body[data-study-master="v2"] .economics-breadcrumb a{
  color:var(--ds-primary,#2563eb);text-decoration:none;
}
body[data-study-master="v2"] .economics-reading-head{
  grid-column:1/-1;
  margin:0;padding:2.05rem 2rem 1.75rem;
  border:0;border-bottom:4px solid var(--sm-saffron);
  border-radius:var(--sm-radius);
  background:linear-gradient(135deg,var(--sm-navy) 0%,#1e3a8a 58%,var(--sm-blue) 100%);
  color:#fff;box-shadow:var(--sm-shadow);
}
body[data-study-master="v2"] .economics-reading-head .economics-kicker{
  display:inline-flex;margin:0 0 .75rem;padding:.25rem .7rem;border-radius:999px;
  background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.2);
  color:#dbeafe;font-size:.75rem;font-weight:800;
}
body[data-study-master="v2"] .economics-reading-head h1{
  margin:0;color:#fff;font-size:clamp(1.65rem,2.5vw,2.25rem);line-height:1.35;text-wrap:balance;
}
body[data-study-master="v2"] .economics-reading-head :is(p,.economics-english-title){
  max-width:1000px;margin:.7rem 0 0;color:#dbeafe;line-height:1.75;
}
body[data-study-master="v2"] .economics-reading-tags{
  display:flex;flex-wrap:wrap;gap:.45rem;margin-top:1rem;
}
body[data-study-master="v2"] .economics-reading-tags span{
  padding:.25rem .65rem;border-radius:999px;background:rgba(255,255,255,.11);
  border:1px solid rgba(255,255,255,.2);color:#f8fafc;font-size:.75rem;font-weight:700;
}
body[data-study-master="v2"] .economics-reading-toc{
  grid-column:1;position:sticky;top:5.6rem;
  max-height:calc(100dvh - 7rem);overflow:auto;
  margin:0;padding:0;border:1px solid var(--ds-border,#e2e8f0);
  border-radius:12px;background:var(--ds-surface,#fff);
  box-shadow:0 2px 12px rgba(15,23,42,.05);scrollbar-width:thin;
}
body[data-study-master="v2"] .economics-reading-toc>summary{
  position:sticky;top:0;z-index:1;list-style:none;cursor:pointer;
  padding:1rem 1.05rem;background:var(--ds-surface,#fff);
  border-bottom:1px solid var(--ds-border,#e2e8f0);
  color:var(--ds-heading,#0f172a);font-weight:800;font-size:.94rem;
}
body[data-study-master="v2"] .economics-reading-toc>summary::-webkit-details-marker{display:none}
body[data-study-master="v2"] .economics-reading-toc>div{
  display:flex;flex-direction:column;gap:.15rem;padding:.75rem;
}
body[data-study-master="v2"] .economics-reading-toc a{
  display:block;padding:.48rem .6rem;border-left:3px solid transparent;border-radius:7px;
  color:var(--ds-text,#334155);text-decoration:none;font-size:.83rem;font-weight:600;line-height:1.5;
}
body[data-study-master="v2"] .economics-reading-toc a:hover,
body[data-study-master="v2"] .economics-reading-toc a[aria-current="location"]{
  color:var(--ds-primary,#2563eb);border-left-color:var(--ds-primary,#2563eb);
  background:var(--ds-surface-soft,#f1f5f9);
}
body[data-study-master="v2"] .economics-article-content{
  grid-column:2;min-width:0;display:flex;flex-direction:column;gap:1.25rem;
}
body[data-study-master="v2"] .economics-article-content>.study-master-section{
  margin:0;padding:1.65rem 1.8rem;min-width:0;
  border:1px solid var(--ds-border,#e2e8f0);border-radius:var(--sm-radius);
  background:var(--ds-surface,#fff);box-shadow:var(--sm-shadow);
}
body[data-study-master="v2"] .economics-article-content>.study-master-section>h2:first-child{
  margin:0 0 1rem;padding:0 0 .75rem;border-bottom:2px solid var(--ds-border,#e2e8f0);
  color:var(--ds-heading,#0f172a);font-size:1.32rem;line-height:1.4;
}
body[data-study-master="v2"] .economics-article-content>.study-master-section :is(p,li){
  font-size:var(--as-reader-font,1rem);line-height:1.88;
}
body[data-study-master="v2"] .economics-article-content>.study-master-section :is(.economics-code-diagram,.economics-table-wrap){
  max-width:100%;
}
body[data-study-master="v2"] .economics-article-content>hr{display:none}

@media(max-width:980px){
  body[data-study-master="v2"][data-as-layout="study"] .economics-reading-article.as-reading-content{
    width:min(100% - 1.2rem,820px);grid-template-columns:minmax(0,1fr);margin-top:1rem;
  }
  body[data-study-master="v2"] :is(.economics-breadcrumb,.economics-reading-head,.economics-reading-toc,.economics-article-content){
    grid-column:1;
  }
  body[data-study-master="v2"] .economics-reading-toc{position:static;max-height:none}
  body[data-study-master="v2"] .economics-reading-head{
    padding:1.45rem 1.15rem 1.25rem;border-radius:13px;
  }
  body[data-study-master="v2"] .economics-reading-head h1{
    font-size:clamp(1.4rem,6vw,1.75rem);
  }
  body[data-study-master="v2"] .economics-article-content>.study-master-section{
    padding:1.15rem 1rem;border-radius:12px;box-shadow:0 2px 10px rgba(15,23,42,.05);
  }
}


/* Master-topic adapter — environment and international-relations long-form pages. */
body[data-study-master="v2"] .master-topic-main{
  min-width:0;background:var(--ds-bg,#f8fafc);
}
body[data-study-master="v2"] .master-topic-shell{
  width:100%;max-width:none;margin:0;padding:0;
}
body[data-study-master="v2"] .master-topic-shell>.ca-breadcrumb{
  width:min(var(--sm-shell),calc(100% - 2rem));
  margin:1.1rem auto 0;
}
body[data-study-master="v2"][data-as-layout="study"] .master-topic.as-reading-content{
  width:min(var(--sm-shell),calc(100% - 2rem));
  max-width:var(--sm-shell);
  margin:1.4rem auto 4rem;padding:0;
  display:grid;grid-template-columns:minmax(240px,var(--sm-sidebar)) minmax(0,1fr);
  gap:var(--sm-gap);align-items:start;overflow:visible;
}
body[data-study-master="v2"] .master-topic-head{
  grid-column:1/-1;margin:0;padding:2.05rem 2rem 1.75rem;
  border:0;border-bottom:4px solid var(--sm-saffron);border-radius:var(--sm-radius);
  background:linear-gradient(135deg,var(--sm-navy) 0%,#1e3a8a 58%,var(--sm-blue) 100%);
  color:#fff;box-shadow:var(--sm-shadow);
}
body[data-study-master="v2"] .master-topic-head>span:first-child{
  display:inline-flex;margin:0 0 .75rem;padding:.25rem .7rem;border-radius:999px;
  background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.2);
  color:#dbeafe;font-size:.75rem;font-weight:800;
}
body[data-study-master="v2"] .master-topic-head h1{
  margin:0;color:#fff;font-size:clamp(1.65rem,2.5vw,2.25rem);line-height:1.35;text-wrap:balance;
}
body[data-study-master="v2"] .master-topic-head>p{
  max-width:1000px;margin:.75rem 0 0;color:#dbeafe;font-size:1rem;line-height:1.8;
}
body[data-study-master="v2"] .master-topic-toc{
  grid-column:1;position:sticky;top:5.6rem;max-height:calc(100dvh - 7rem);overflow:auto;
  margin:0;padding:1rem;border:1px solid var(--ds-border,#e2e8f0);border-radius:12px;
  background:var(--ds-surface,#fff);box-shadow:0 2px 12px rgba(15,23,42,.05);scrollbar-width:thin;
}
body[data-study-master="v2"] .master-topic-toc>strong{
  display:block;padding-bottom:.65rem;margin-bottom:.55rem;border-bottom:1px solid var(--ds-border,#e2e8f0);
  color:var(--ds-heading,#0f172a);font-size:.94rem;
}
body[data-study-master="v2"] .master-topic-toc a{
  display:block;padding:.48rem .6rem;border-left:3px solid transparent;border-radius:7px;
  color:var(--ds-text,#334155);text-decoration:none;font-size:.83rem;font-weight:600;line-height:1.5;
}
body[data-study-master="v2"] .master-topic-toc a:hover,
body[data-study-master="v2"] .master-topic-toc a[aria-current="location"]{
  color:var(--ds-primary,#2563eb);border-left-color:var(--ds-primary,#2563eb);
  background:var(--ds-surface-soft,#f1f5f9);
}
body[data-study-master="v2"] .master-topic>section{
  grid-column:2;min-width:0;margin:0 0 1.25rem;
}
body[data-study-master="v2"] .master-topic>section:not(#concept){
  padding:1.45rem 1.55rem;border:1px solid var(--ds-border,#e2e8f0);
  border-radius:var(--sm-radius);background:var(--ds-surface,#fff);box-shadow:var(--sm-shadow);
}
body[data-study-master="v2"] .master-topic>#concept{
  display:grid;gap:1rem;
}
body[data-study-master="v2"] .master-topic-section{
  margin:0;padding:1.35rem 1.5rem;border:1px solid var(--ds-border,#e2e8f0);
  border-radius:var(--sm-radius);background:var(--ds-surface,#fff);box-shadow:var(--sm-shadow);
}
body[data-study-master="v2"] .master-topic :is(.master-topic-section,section)>h2:first-child{
  margin:0 0 .9rem;padding:0 0 .7rem;border-bottom:2px solid var(--ds-border,#e2e8f0);
  color:var(--ds-heading,#0f172a);font-size:1.25rem;line-height:1.4;
}
@media(max-width:980px){
  body[data-study-master="v2"][data-as-layout="study"] .master-topic.as-reading-content{
    width:min(100% - 1.2rem,820px);grid-template-columns:minmax(0,1fr);margin-top:1rem;
  }
  body[data-study-master="v2"] :is(.master-topic-head,.master-topic-toc,.master-topic>section){grid-column:1}
  body[data-study-master="v2"] .master-topic-toc{position:static;max-height:none}
  body[data-study-master="v2"] .master-topic-head{padding:1.45rem 1.15rem 1.25rem;border-radius:13px}
  body[data-study-master="v2"] .master-topic-head h1{font-size:clamp(1.4rem,6vw,1.75rem)}
  body[data-study-master="v2"] .master-topic-shell>.ca-breadcrumb{width:calc(100% - 1.2rem)}
  body[data-study-master="v2"] .master-topic>section:not(#concept),
  body[data-study-master="v2"] .master-topic-section{padding:1.1rem 1rem;border-radius:12px}
}

/* Ambedkar legacy-content adapter inside Study Master v2 */
body[data-study-master="v2"] .amb-grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;margin:1rem 0}
body[data-study-master="v2"] .amb-mini{padding:1rem 1.1rem;border:1px solid var(--ds-border,#e2e8f0);border-radius:12px;background:var(--ds-surface-soft,#f8fafc)}
body[data-study-master="v2"] .amb-mini>b{display:block;margin-bottom:.35rem;color:var(--ds-heading,#0f172a)}
body[data-study-master="v2"] .amb-note{margin:1.2rem 0;padding:1rem 1.15rem;border-left:4px solid var(--ds-primary,#2563eb);border-radius:10px;background:var(--ds-surface-soft,#f1f5f9);line-height:1.8}
body[data-study-master="v2"] .amb-note.amb-warn{border-left-color:#d97706;background:#fffbeb;color:#78350f}
body[data-study-master="v2"] .amb-pyq{margin:1rem 0;padding:1rem 1.1rem;border:1px solid var(--ds-border,#e2e8f0);border-radius:12px;background:var(--ds-surface,#fff)}
body[data-study-master="v2"] .amb-pyq>b{display:block;color:var(--ds-primary,#2563eb);margin-bottom:.4rem}
body[data-study-master="v2"] .amb-answer{margin-top:.7rem;padding:.7rem .85rem;border-left:4px solid #059669;border-radius:8px;background:#ecfdf5;color:#065f46;font-weight:700}
body[data-study-master="v2"] .amb-source{margin-top:1.2rem;padding-top:1rem;border-top:1px solid var(--ds-border,#e2e8f0);color:var(--ds-text-muted,#64748b);font-size:.9rem}
body[data-study-master="v2"] .amb-back{display:inline-flex;margin-top:1rem;font-weight:800;text-decoration:none}
@media(max-width:700px){body[data-study-master="v2"] .amb-grid2{grid-template-columns:1fr}}


/* Ethics / GS-IV chapter adapter */
body[data-study-master="v2"] .eth-note{
  width:min(var(--sm-shell),calc(100% - 2rem));
  max-width:var(--sm-shell);
  margin:1.35rem auto 4rem;
  min-width:0;
}
body[data-study-master="v2"] .eth-crumb{
  margin:0 .15rem .9rem;
  color:var(--ds-text-muted,#64748b);
  font-size:.84rem;
  line-height:1.65;
}
body[data-study-master="v2"] .eth-crumb a{
  color:var(--ds-primary,#2563eb);
  text-decoration:none;
}
body[data-study-master="v2"][data-as-layout="study"] .note-body.as-reading-content{
  width:100%;
  max-width:none;
  margin:0;
  padding:0;
  display:grid;
  grid-template-columns:minmax(240px,var(--sm-sidebar)) minmax(0,1fr);
  gap:var(--sm-gap);
  align-items:start;
  overflow:visible;
}
body[data-study-master="v2"] .ethics-reading-head{
  grid-column:1/-1;
  margin:0;
  padding:2.05rem 2rem 1.75rem;
  border:0;
  border-bottom:4px solid var(--sm-saffron);
  border-radius:var(--sm-radius);
  background:linear-gradient(135deg,var(--sm-navy) 0%,#1e3a8a 58%,var(--sm-blue) 100%);
  color:#fff;
  box-shadow:var(--sm-shadow);
}
body[data-study-master="v2"] .ethics-reading-head h1{
  margin:0;
  color:#fff;
  font-size:clamp(1.65rem,2.5vw,2.25rem);
  line-height:1.35;
  text-wrap:balance;
}
body[data-study-master="v2"] .ethics-reading-head .note-lead{
  max-width:1000px;
  margin:.75rem 0 0;
  color:#dbeafe;
  font-size:1rem;
  line-height:1.8;
}
body[data-study-master="v2"] .ethics-reading-toc{
  grid-column:1;
  position:sticky;
  top:5.6rem;
  max-height:calc(100dvh - 7rem);
  overflow:auto;
  margin:0;
  padding:1rem;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:12px;
  background:var(--ds-surface,#fff);
  box-shadow:0 2px 12px rgba(15,23,42,.05);
  scrollbar-width:thin;
}
body[data-study-master="v2"] .ethics-reading-toc>strong{
  display:block;
  padding-bottom:.65rem;
  margin-bottom:.55rem;
  border-bottom:1px solid var(--ds-border,#e2e8f0);
  color:var(--ds-heading,#0f172a);
  font-size:.94rem;
}
body[data-study-master="v2"] .ethics-reading-toc a{
  display:block;
  padding:.48rem .6rem;
  border-left:3px solid transparent;
  border-radius:7px;
  color:var(--ds-text,#334155);
  text-decoration:none;
  font-size:.83rem;
  font-weight:600;
  line-height:1.5;
}
body[data-study-master="v2"] .ethics-reading-toc a:hover,
body[data-study-master="v2"] .ethics-reading-toc a[aria-current="location"]{
  color:var(--ds-primary,#2563eb);
  border-left-color:var(--ds-primary,#2563eb);
  background:var(--ds-surface-soft,#f1f5f9);
}
body[data-study-master="v2"] .note-body>.ra-card,
body[data-study-master="v2"] .note-body>.ethics-reading-prelude,
body[data-study-master="v2"] .note-body>.ds-prev-next,
body[data-study-master="v2"] .note-body>.back-link{
  grid-column:2;
}
body[data-study-master="v2"] .note-body>.study-master-section{
  grid-column:2;
  min-width:0;
  margin:0;
  padding:1.55rem 1.65rem;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:var(--sm-radius);
  background:var(--ds-surface,#fff);
  box-shadow:var(--sm-shadow);
}
body[data-study-master="v2"] .note-body>.study-master-section>h2:first-child{
  margin:0 0 1rem;
  padding:0 0 .75rem;
  border-bottom:2px solid var(--ds-border,#e2e8f0);
  color:var(--ds-heading,#0f172a);
  font-size:1.28rem;
  line-height:1.4;
}
body[data-study-master="v2"] .note-body>.study-master-section :is(p,li){
  font-size:var(--as-reader-font,1rem);
  line-height:1.88;
}
body[data-study-master="v2"] .note-body :is(.eth-table,.exam-box,.warn-box,.flow){
  max-width:100%;
}
body[data-study-master="v2"] .note-body .eth-table{
  display:table;
  width:100%;
}
body[data-study-master="v2"] .note-body>.back-link{
  display:inline-flex;
  justify-self:start;
  margin-top:.25rem;
  font-weight:800;
  text-decoration:none;
}
@media(max-width:980px){
  body[data-study-master="v2"] .eth-note{
    width:min(100% - 1.2rem,820px);
    margin-top:1rem;
  }
  body[data-study-master="v2"][data-as-layout="study"] .note-body.as-reading-content{
    grid-template-columns:minmax(0,1fr);
  }
  body[data-study-master="v2"] :is(.ethics-reading-head,.ethics-reading-toc,.note-body>.ra-card,.note-body>.ethics-reading-prelude,.note-body>.study-master-section,.note-body>.ds-prev-next,.note-body>.back-link){
    grid-column:1;
  }
  body[data-study-master="v2"] .ethics-reading-toc{
    position:static;
    max-height:none;
  }
  body[data-study-master="v2"] .ethics-reading-head{
    padding:1.45rem 1.15rem 1.25rem;
    border-radius:13px;
  }
  body[data-study-master="v2"] .ethics-reading-head h1{
    font-size:clamp(1.4rem,6vw,1.75rem);
  }
  body[data-study-master="v2"] .note-body>.study-master-section{
    padding:1.15rem 1rem;
    border-radius:12px;
    box-shadow:0 2px 10px rgba(15,23,42,.05);
  }
}
@media(max-width:560px){
  body[data-study-master="v2"] .note-body .eth-table{
    min-width:560px;
  }
  body[data-study-master="v2"] .note-body>.study-master-section{
    overflow-x:auto;
  }
}


/* History Optional note adapter */
body[data-study-master="v2"].history-note-page :is(.note-wrap,.history-note-shell){
  width:min(var(--sm-shell),calc(100% - 2rem));
  max-width:var(--sm-shell);
  margin:1.35rem auto 4rem;
  min-width:0;
}
body[data-study-master="v2"].history-note-page .note-wrap{
  display:grid;
  grid-template-columns:minmax(240px,var(--sm-sidebar)) minmax(0,1fr);
  gap:var(--sm-gap);
  align-items:start;
}
body[data-study-master="v2"].history-note-page :is(.breadcrumb,.history-breadcrumb){
  grid-column:1/-1;
  margin:0 .15rem .9rem;
  color:var(--ds-text-muted,#64748b);
  font-size:.84rem;
  line-height:1.65;
}
body[data-study-master="v2"].history-note-page :is(.breadcrumb,.history-breadcrumb) a{
  color:var(--ds-primary,#2563eb);
  text-decoration:none;
}
body[data-study-master="v2"].history-note-page .history-note{
  display:grid;
  grid-template-columns:minmax(240px,var(--sm-sidebar)) minmax(0,1fr);
  gap:var(--sm-gap);
  align-items:start;
  min-width:0;
}
body[data-study-master="v2"].history-note-page .history-optional-note-head{
  grid-column:1/-1;
  margin:0;
  padding:2.05rem 2rem 1.75rem;
  border:0;
  border-bottom:4px solid var(--sm-saffron);
  border-radius:var(--sm-radius);
  background:linear-gradient(135deg,var(--sm-navy) 0%,#1e3a8a 58%,var(--sm-blue) 100%);
  color:#fff;
  box-shadow:var(--sm-shadow);
}
body[data-study-master="v2"].history-note-page .history-optional-note-head :is(.note-kicker,.history-note-kicker){
  display:inline-flex;
  margin:0 0 .7rem;
  padding:.25rem .7rem;
  border:1px solid rgba(255,255,255,.2);
  border-radius:999px;
  background:rgba(255,255,255,.12);
  color:#dbeafe;
  font-size:.75rem;
  font-weight:800;
}
body[data-study-master="v2"].history-note-page .history-optional-note-head h1{
  margin:0;
  color:#fff;
  font-size:clamp(1.65rem,2.5vw,2.25rem);
  line-height:1.35;
  text-wrap:balance;
}
body[data-study-master="v2"].history-note-page .history-optional-note-head>p{
  max-width:1000px;
  margin:.75rem 0 0;
  color:#dbeafe;
  font-size:1rem;
  line-height:1.8;
}
body[data-study-master="v2"].history-note-page .history-optional-note-toc{
  grid-column:1;
  position:sticky;
  top:5.6rem;
  max-height:calc(100dvh - 7rem);
  overflow:auto;
  margin:0;
  padding:0;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:12px;
  background:var(--ds-surface,#fff);
  box-shadow:0 2px 12px rgba(15,23,42,.05);
  scrollbar-width:thin;
}
body[data-study-master="v2"].history-note-page .history-optional-note-toc>summary,
body[data-study-master="v2"].history-note-page .history-optional-note-toc>strong{
  position:sticky;
  top:0;
  z-index:1;
  display:block;
  padding:1rem 1.05rem;
  margin:0;
  border-bottom:1px solid var(--ds-border,#e2e8f0);
  background:var(--ds-surface,#fff);
  color:var(--ds-heading,#0f172a);
  font-size:.94rem;
  font-weight:800;
}
body[data-study-master="v2"].history-note-page .history-optional-note-toc>summary{
  list-style:none;
  cursor:pointer;
}
body[data-study-master="v2"].history-note-page .history-optional-note-toc>summary::-webkit-details-marker{display:none}
body[data-study-master="v2"].history-note-page .history-optional-note-toc :is(ul,div){
  margin:0;
  padding:.75rem;
  list-style:none;
}
body[data-study-master="v2"].history-note-page .history-optional-note-toc li{margin:0}
body[data-study-master="v2"].history-note-page .history-optional-note-toc a{
  display:block;
  padding:.48rem .6rem;
  border-left:3px solid transparent;
  border-radius:7px;
  color:var(--ds-text,#334155);
  text-decoration:none;
  font-size:.83rem;
  font-weight:600;
  line-height:1.5;
}
body[data-study-master="v2"].history-note-page .history-optional-note-toc a:hover,
body[data-study-master="v2"].history-note-page .history-optional-note-toc a[aria-current="location"]{
  color:var(--ds-primary,#2563eb);
  border-left-color:var(--ds-primary,#2563eb);
  background:var(--ds-surface-soft,#f1f5f9);
}
body[data-study-master="v2"].history-note-page .history-optional-note-content{
  grid-column:2;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:1.25rem;
}
body[data-study-master="v2"].history-note-page .history-optional-note-content>.history-optional-note-prelude,
body[data-study-master="v2"].history-note-page .history-optional-note-content>.study-master-section{
  min-width:0;
  margin:0;
  padding:1.55rem 1.65rem;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:var(--sm-radius);
  background:var(--ds-surface,#fff);
  box-shadow:var(--sm-shadow);
}
body[data-study-master="v2"].history-note-page .history-optional-note-content>.study-master-section>h2:first-child{
  margin:0 0 1rem;
  padding:0 0 .75rem;
  border-bottom:2px solid var(--ds-border,#e2e8f0);
  color:var(--ds-heading,#0f172a);
  font-size:1.28rem;
  line-height:1.4;
}
body[data-study-master="v2"].history-note-page .history-optional-note-content :is(p,li){
  font-size:var(--as-reader-font,1rem);
  line-height:1.88;
}
body[data-study-master="v2"].history-note-page .history-optional-note-content h3{
  margin:1.35rem 0 .6rem;
  color:var(--ds-heading,#0f172a);
  font-size:1.06rem;
  line-height:1.45;
}
body[data-study-master="v2"].history-note-page .history-note-nav{
  grid-column:2;
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:.75rem;
  margin:0;
}
body[data-study-master="v2"].history-note-page .history-note-nav a{
  display:inline-flex;
  padding:.75rem .9rem;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:10px;
  background:var(--ds-surface,#fff);
  color:var(--ds-primary,#2563eb);
  text-decoration:none;
  font-weight:750;
}
@media(max-width:980px){
  body[data-study-master="v2"].history-note-page :is(.note-wrap,.history-note-shell){
    width:min(100% - 1.2rem,820px);
    margin-top:1rem;
  }
  body[data-study-master="v2"].history-note-page :is(.note-wrap,.history-note){
    grid-template-columns:minmax(0,1fr);
  }
  body[data-study-master="v2"].history-note-page :is(.breadcrumb,.history-breadcrumb,.history-optional-note-head,.history-optional-note-toc,.history-optional-note-content,.history-note-nav){
    grid-column:1;
  }
  body[data-study-master="v2"].history-note-page .history-optional-note-toc{
    position:static;
    max-height:none;
  }
  body[data-study-master="v2"].history-note-page .history-optional-note-head{
    padding:1.45rem 1.15rem 1.25rem;
    border-radius:13px;
  }
  body[data-study-master="v2"].history-note-page .history-optional-note-head h1{
    font-size:clamp(1.4rem,6vw,1.75rem);
  }
  body[data-study-master="v2"].history-note-page .history-optional-note-content>.history-optional-note-prelude,
  body[data-study-master="v2"].history-note-page .history-optional-note-content>.study-master-section{
    padding:1.15rem 1rem;
    border-radius:12px;
  }
}


/* History Optional rich topic adapter */
body[data-study-master="v2"].topic-page .topic-hero>.shell,
body[data-study-master="v2"].topic-page .quick-facts,
body[data-study-master="v2"].topic-page .page-layout{
  width:min(var(--sm-shell),calc(100% - 2rem));
  max-width:var(--sm-shell);
  margin-inline:auto;
}
body[data-study-master="v2"].topic-page .topic-hero{
  padding:1.35rem 0 1rem;
  background:transparent;
  border:0;
}
body[data-study-master="v2"].topic-page .topic-hero .hero-grid{
  padding:2rem;
  border-bottom:4px solid var(--sm-saffron);
  border-radius:var(--sm-radius);
  background:linear-gradient(135deg,var(--sm-navy) 0%,#1e3a8a 58%,var(--sm-blue) 100%);
  color:#fff;
  box-shadow:var(--sm-shadow);
}
body[data-study-master="v2"].topic-page .topic-hero :is(.crumb,.kicker,.hero-lead){
  color:#dbeafe;
}
body[data-study-master="v2"].topic-page .topic-hero .crumb a{
  color:#fff;
}
body[data-study-master="v2"].topic-page .topic-hero h1{
  color:#fff;
  font-size:clamp(1.7rem,2.7vw,2.35rem);
  line-height:1.3;
  text-wrap:balance;
}
body[data-study-master="v2"].topic-page .topic-hero .exam-card,
body[data-study-master="v2"].topic-page .topic-hero .status-note{
  border:1px solid rgba(255,255,255,.2);
  background:rgba(255,255,255,.1);
  color:#f8fafc;
  box-shadow:none;
}
body[data-study-master="v2"].topic-page .topic-hero .exam-card :is(h2,h3,strong),
body[data-study-master="v2"].topic-page .topic-hero .status-note strong{
  color:#fff;
}
body[data-study-master="v2"].topic-page .quick-facts{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:.7rem;
  margin-top:.15rem;
  margin-bottom:1rem;
}
body[data-study-master="v2"].topic-page .quick-facts>div{
  min-width:0;
  padding:.85rem .9rem;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:10px;
  background:var(--ds-surface,#fff);
}
body[data-study-master="v2"].topic-page .quick-facts small{
  display:block;
  margin-bottom:.25rem;
  color:var(--ds-text-muted,#64748b);
}
body[data-study-master="v2"].topic-page .quick-facts strong{
  color:var(--ds-heading,#0f172a);
  line-height:1.45;
}
body[data-study-master="v2"].topic-page .page-layout{
  display:grid;
  grid-template-columns:minmax(240px,var(--sm-sidebar)) minmax(0,1fr);
  gap:var(--sm-gap);
  align-items:start;
  margin-top:1rem;
  margin-bottom:4rem;
}
body[data-study-master="v2"].topic-page .page-layout>aside{
  position:sticky;
  top:5.6rem;
  display:grid;
  gap:.75rem;
}
body[data-study-master="v2"].topic-page .toc-card,
body[data-study-master="v2"].topic-page .side-box{
  margin:0;
  padding:1rem;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:12px;
  background:var(--ds-surface,#fff);
  color:inherit;
  box-shadow:0 2px 12px rgba(15,23,42,.05);
}
body[data-study-master="v2"].topic-page .toc-card>span{
  display:block;
  margin-bottom:.55rem;
  padding-bottom:.65rem;
  border-bottom:1px solid var(--ds-border,#e2e8f0);
  color:var(--ds-heading,#0f172a);
  font-size:.94rem;
  font-weight:800;
}
body[data-study-master="v2"].topic-page .toc-card a{
  display:block;
  padding:.48rem .6rem;
  border-left:3px solid transparent;
  border-radius:7px;
  color:var(--ds-text,#334155);
  text-decoration:none;
  font-size:.83rem;
  font-weight:600;
  line-height:1.5;
}
body[data-study-master="v2"].topic-page .toc-card a:hover,
body[data-study-master="v2"].topic-page .toc-card a[aria-current="location"]{
  color:var(--ds-primary,#2563eb);
  border-left-color:var(--ds-primary,#2563eb);
  background:var(--ds-surface-soft,#f1f5f9);
}
body[data-study-master="v2"].topic-page .side-box{
  display:block;
  text-decoration:none;
}
body[data-study-master="v2"].topic-page .side-box small,
body[data-study-master="v2"].topic-page .side-box span{
  display:block;
  color:var(--ds-text-muted,#64748b);
  line-height:1.55;
}
body[data-study-master="v2"].topic-page .side-box strong{
  display:block;
  margin:.2rem 0;
  color:var(--ds-heading,#0f172a);
}
body[data-study-master="v2"].topic-page .article.as-reading-content{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:1.25rem;
}
body[data-study-master="v2"].topic-page .article.as-reading-content>.section{
  margin:0;
  padding:1.55rem 1.65rem;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:var(--sm-radius);
  background:var(--ds-surface,#fff);
  box-shadow:var(--sm-shadow);
}
body[data-study-master="v2"].topic-page .article.as-reading-content>.section>h2{
  margin:.2rem 0 1rem;
  padding:0 0 .75rem;
  border-bottom:2px solid var(--ds-border,#e2e8f0);
  color:var(--ds-heading,#0f172a);
  font-size:1.28rem;
  line-height:1.4;
}
body[data-study-master="v2"].topic-page .article.as-reading-content>.section :is(p,li){
  font-size:var(--as-reader-font,1rem);
  line-height:1.88;
}
body[data-study-master="v2"].topic-page :is(.source-grid,.dimension-grid,.grid2,.grid3,.related-grid){
  gap:.85rem;
}
body[data-study-master="v2"].topic-page :is(.mini-card,.debate,.soft-note,.warning-note,.highlight,.safe-note,.pyq-box,.revision,.related-card){
  border-radius:10px;
}
body[data-study-master="v2"].topic-page :is(.matrix,.timeline){
  max-width:100%;
  overflow:auto;
}
@media(max-width:980px){
  body[data-study-master="v2"].topic-page .topic-hero>.shell,
  body[data-study-master="v2"].topic-page .quick-facts,
  body[data-study-master="v2"].topic-page .page-layout{
    width:min(100% - 1.2rem,820px);
  }
  body[data-study-master="v2"].topic-page .quick-facts{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  body[data-study-master="v2"].topic-page .page-layout{
    grid-template-columns:minmax(0,1fr);
  }
  body[data-study-master="v2"].topic-page .page-layout>aside{
    position:static;
  }
  body[data-study-master="v2"].topic-page .article.as-reading-content>.section{
    padding:1.15rem 1rem;
    border-radius:12px;
  }
  body[data-study-master="v2"].topic-page .topic-hero .hero-grid{
    padding:1.4rem 1.15rem 1.2rem;
    border-radius:13px;
  }
}
@media(max-width:560px){
  body[data-study-master="v2"].topic-page .quick-facts{
    grid-template-columns:1fr;
  }
}


/* CA_MOBILE_SINGLE_COLUMN_FIX_20261018 */
@media (max-width:980px){
  html body[data-study-master="v2"].ca-topic-page[data-as-layout="study"] .ca-topic-main{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    overflow-x:hidden !important;
  }
  html body[data-study-master="v2"].ca-topic-page[data-as-layout="study"] .ca-topic-shell{
    box-sizing:border-box !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:0 auto !important;
    padding-inline:.75rem !important;
  }
  html body[data-study-master="v2"].ca-topic-page[data-as-layout="study"] .ca-topic-main>.ca-topic-shell>.ca-breadcrumb{
    box-sizing:border-box !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:1rem 0 0 !important;
  }
  html body[data-study-master="v2"].ca-topic-page[data-as-layout="study"] .ca-topic-article.as-reading-content{
    box-sizing:border-box !important;
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin:1rem 0 4rem !important;
    padding:0 !important;
    overflow:visible !important;
  }
  html body[data-study-master="v2"].ca-topic-page[data-as-layout="study"] .ca-topic-article.as-reading-content > :is(.ca-topic-head,.ca-topic-editorial-meta,.ca-topic-auto-toc,section){
    box-sizing:border-box !important;
    display:block !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin-inline:0 !important;
  }
  html body[data-study-master="v2"].ca-topic-page[data-as-layout="study"] .ca-topic-article.as-reading-content :is(h1,h2,h3,h4,p,li,a,strong,span){
    writing-mode:horizontal-tb !important;
    word-break:normal !important;
    overflow-wrap:break-word !important;
    hyphens:none !important;
  }
  html body[data-study-master="v2"].ca-topic-page[data-as-layout="study"] .ca-topic-head h1{
    max-width:none !important;
    white-space:normal !important;
    font-size:clamp(1.45rem,6.2vw,1.85rem) !important;
    line-height:1.42 !important;
  }
  html body[data-study-master="v2"].ca-topic-page[data-as-layout="study"] .ca-topic-auto-toc{
    position:static !important;
    max-height:none !important;
    overflow:visible !important;
  }
  html body[data-study-master="v2"].ca-topic-page[data-as-layout="study"] .ca-topic-article.as-reading-content table{
    display:table;
    width:100%;
    max-width:100%;
  }
}
@media (max-width:560px){
  html body[data-study-master="v2"].ca-topic-page[data-as-layout="study"] .ca-topic-shell{padding-inline:.6rem !important;}
  html body[data-study-master="v2"].ca-topic-page[data-as-layout="study"] .ca-topic-head{padding:1.2rem .95rem 1.05rem !important;}
  html body[data-study-master="v2"].ca-topic-page[data-as-layout="study"] .ca-topic-article>section.study-master-section{padding:1.05rem .9rem !important;}
}


/* Legacy Geography reader adapter */
body[data-study-master="v2"][data-as-layout="study"] .geo-note.as-reading-content{
  width:min(var(--sm-shell),calc(100% - 2rem));
  max-width:var(--sm-shell);
  margin:1.4rem auto 4rem;
  padding:0;
  display:grid;
  grid-template-columns:minmax(240px,var(--sm-sidebar)) minmax(0,1fr);
  gap:var(--sm-gap);
  align-items:start;
  overflow:visible;
}
body[data-study-master="v2"] .geo-note>.note-breadcrumb{
  grid-column:1/-1;
  margin:0 .15rem -.9rem;
  color:var(--ds-text-muted,#64748b);
  font-size:.84rem;
  line-height:1.65;
}
body[data-study-master="v2"] .geo-note>.note-breadcrumb a{
  color:var(--ds-primary,#2563eb);
  text-decoration:none;
}
body[data-study-master="v2"] .geo-study-head{
  grid-column:1/-1;
  margin:0;
  padding:2rem 2rem 1.7rem;
  border-bottom:4px solid var(--sm-saffron);
  border-radius:var(--sm-radius);
  background:linear-gradient(135deg,var(--sm-navy) 0%,#1e3a8a 58%,var(--sm-blue) 100%);
  color:#fff;
  box-shadow:var(--sm-shadow);
}
body[data-study-master="v2"] .geo-study-head h1{
  margin:0;
  max-width:1100px;
  color:#fff;
  font-size:clamp(1.65rem,2.5vw,2.25rem);
  line-height:1.35;
  font-weight:800;
  text-wrap:balance;
}
body[data-study-master="v2"] .geo-study-head :is(p,li){
  color:#dbeafe;
  font-size:.98rem;
  line-height:1.8;
}
body[data-study-master="v2"] .geo-study-head>p:last-child{margin-bottom:0}
body[data-study-master="v2"] .geo-study-head a{
  color:#fff;
  text-decoration-color:rgba(255,255,255,.55);
}
body[data-study-master="v2"] .geo-reading-toc{
  grid-column:1;
  position:sticky;
  top:5.6rem;
  max-height:calc(100dvh - 7rem);
  overflow:auto;
  padding:.8rem;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:12px;
  background:var(--ds-surface,#fff);
  box-shadow:0 2px 12px rgba(15,23,42,.05);
  scrollbar-width:thin;
}
body[data-study-master="v2"] .geo-reading-toc>strong{
  display:block;
  padding:.25rem .45rem .75rem;
  margin-bottom:.25rem;
  border-bottom:1px solid var(--ds-border,#e2e8f0);
  color:var(--ds-heading,#0f172a);
  font-size:.92rem;
}
body[data-study-master="v2"] .geo-reading-toc a{
  display:block;
  padding:.5rem .55rem;
  border-left:3px solid transparent;
  border-radius:7px;
  color:var(--ds-text,#334155);
  text-decoration:none;
  font-size:.82rem;
  font-weight:600;
  line-height:1.5;
}
body[data-study-master="v2"] .geo-reading-toc a:hover,
body[data-study-master="v2"] .geo-reading-toc a[aria-current="location"]{
  color:var(--ds-primary,#2563eb);
  border-left-color:var(--ds-primary,#2563eb);
  background:var(--ds-surface-soft,#f1f5f9);
}
body[data-study-master="v2"] .geo-study-content{
  grid-column:2;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:1.25rem;
}
body[data-study-master="v2"] .geo-study-content>.study-master-section{
  margin:0;
  padding:1.6rem 1.75rem;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:var(--sm-radius);
  background:var(--ds-surface,#fff);
  box-shadow:var(--sm-shadow);
  overflow-wrap:anywhere;
}
body[data-study-master="v2"] .geo-study-content>.study-master-section>:is(h2,h3):first-child{
  margin:0 0 1rem;
  padding:0 0 .75rem;
  border-bottom:2px solid var(--ds-border,#e2e8f0);
  color:var(--ds-heading,#0f172a);
  font-size:1.3rem;
  line-height:1.4;
}
body[data-study-master="v2"] .geo-study-content .study-master-section h3{
  color:var(--ds-heading,#0f172a);
}
body[data-study-master="v2"] .geo-study-content .study-master-section :is(p,li){
  font-size:var(--as-reader-font,1rem);
  line-height:1.88;
}
body[data-study-master="v2"] .geo-study-content :is(.fact-line,.fact-list,.next-topic,.detail-link){
  margin:1rem 0;
  padding:.85rem 1rem;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:10px;
  background:var(--ds-surface-soft,#f8fafc);
}
body[data-study-master="v2"] .geo-study-content .table-wrap{
  max-width:100%;
  overflow-x:auto;
  margin:1rem 0;
  border:1px solid var(--ds-border,#e2e8f0);
  border-radius:12px;
  background:var(--ds-surface,#fff);
}
body[data-study-master="v2"] .geo-study-content .table-wrap table{
  width:100%;
  min-width:620px;
  border-collapse:collapse;
}
body[data-study-master="v2"] .geo-study-content .table-wrap th,
body[data-study-master="v2"] .geo-study-content .table-wrap td{
  padding:.75rem .8rem;
  border-bottom:1px solid var(--ds-border,#e2e8f0);
  text-align:left;
  vertical-align:top;
}
body[data-study-master="v2"] .geo-study-content .table-wrap th{
  background:var(--ds-surface-soft,#f8fafc);
  color:var(--ds-heading,#0f172a);
}
body[data-study-master="v2"] .geo-study-content hr.section-break{
  border:0;
  border-top:1px solid var(--ds-border,#e2e8f0);
  margin:1.3rem 0;
}
@media(max-width:980px){
  body[data-study-master="v2"][data-as-layout="study"] .geo-note.as-reading-content{
    grid-template-columns:1fr;
    width:min(100% - 1rem,var(--sm-shell));
    gap:1rem;
  }
  body[data-study-master="v2"] .geo-reading-toc{
    grid-column:1;
    position:static;
    max-height:none;
    display:flex;
    flex-wrap:wrap;
    gap:.35rem;
  }
  body[data-study-master="v2"] .geo-reading-toc>strong{
    width:100%;
  }
  body[data-study-master="v2"] .geo-reading-toc a{
    display:inline-flex;
    border:1px solid var(--ds-border,#e2e8f0);
    border-left-width:1px;
  }
  body[data-study-master="v2"] .geo-study-content{
    grid-column:1;
  }
}
@media(max-width:640px){
  body[data-study-master="v2"] .geo-study-head{
    padding:1.45rem 1.15rem 1.3rem;
    border-radius:13px;
  }
  body[data-study-master="v2"] .geo-study-content>.study-master-section{
    padding:1.2rem 1rem;
    border-radius:13px;
  }
}



/* History Optional single-outline guard
   If an older shared-reader script wraps .note-body in .as-reading-layout,
   collapse that accidental nested grid and keep the subject TOC as the only sidebar. */
@media(min-width:981px){
  body[data-study-master="v2"].history-note-page .note-wrap > .as-reading-layout{
    grid-column:2;
    display:block;
    width:100%;
    max-width:none;
    margin:0;
  }
  body[data-study-master="v2"].history-note-page .note-wrap > .as-reading-layout > .as-study-outline{
    display:none!important;
  }
  body[data-study-master="v2"].history-note-page .note-wrap > .as-reading-layout > .history-optional-note-content{
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    grid-column:auto!important;
  }
}


/* =========================================================
   HISTORY OPTIONAL NOTES — LOCKED SINGLE-OUTLINE LAYOUT
   The subject owns its left TOC. Shared reader outline is never shown here.
   ========================================================= */
body.history-note-page .as-study-outline{display:none!important;}
body.history-note-page .as-reading-layout{
  display:contents!important;
  width:auto!important;
  max-width:none!important;
  margin:0!important;
  padding:0!important;
}
body[data-study-master="v2"].history-note-page .history-optional-notes-static{
  width:min(1280px,calc(100% - 32px))!important;
  max-width:1280px!important;
  margin:1.25rem auto 4rem!important;
  display:grid!important;
  grid-template-columns:250px minmax(0,1fr)!important;
  column-gap:30px!important;
  row-gap:22px!important;
  align-items:start!important;
}
body[data-study-master="v2"].history-note-page .history-optional-notes-static>.breadcrumb,
body[data-study-master="v2"].history-note-page .history-optional-notes-static>.history-optional-note-head{
  grid-column:1/-1!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
}
body[data-study-master="v2"].history-note-page .history-optional-notes-static>.history-optional-note-toc{
  grid-column:1!important;
  grid-row:auto!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  position:sticky!important;
  top:5.6rem!important;
  max-height:calc(100dvh - 7rem)!important;
  overflow:auto!important;
}
body[data-study-master="v2"].history-note-page .history-optional-notes-static>.history-optional-note-content{
  grid-column:2!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  margin:0!important;
  display:flex!important;
  flex-direction:column!important;
  gap:1.1rem!important;
}
body[data-study-master="v2"].history-note-page .history-optional-notes-static>.history-note-nav{
  grid-column:2!important;
  width:100%!important;
  margin:0!important;
}
body[data-study-master="v2"].history-note-page .history-optional-note-content>.history-optional-note-prelude,
body[data-study-master="v2"].history-note-page .history-optional-note-content>.study-master-section{
  width:100%!important;
  min-width:0!important;
  margin:0!important;
}
body[data-study-master="v2"].history-note-page .history-optional-note-head{
  padding:1.7rem 1.8rem 1.5rem!important;
}
@media(max-width:980px){
  body[data-study-master="v2"].history-note-page .history-optional-notes-static{
    width:min(100% - 16px,820px)!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:14px!important;
    margin-top:.75rem!important;
  }
  body[data-study-master="v2"].history-note-page .history-optional-notes-static>
  :is(.breadcrumb,.history-optional-note-head,.history-optional-note-toc,.history-optional-note-content,.history-note-nav){
    grid-column:1!important;
  }
  body[data-study-master="v2"].history-note-page .history-optional-notes-static>.history-optional-note-toc{
    position:static!important;
    max-height:none!important;
  }
  body[data-study-master="v2"].history-note-page .history-optional-note-head{
    padding:1.25rem 1rem 1.1rem!important;
  }
}
