/* RPSGT V3: one chapter at a time, like an LMS or slide deck. */
body[data-module="study"] .spg-study-page[hidden],
body[data-module="study"] .domain-map-card[hidden]{display:none!important}
.spg-study-chapter-nav{scroll-margin-top:90px;position:relative;margin:14px 0 12px;padding:12px;border:1px solid var(--line);border-radius:16px;background:#eef7fa}
.spg-study-nav-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 10px;color:var(--navy);font-size:.94rem;font-weight:900}
.spg-study-nav-heading span{color:var(--muted);font-size:.8rem;font-weight:500}
.spg-study-chapter-items{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}
.spg-study-chapter-button{display:flex;flex-wrap:wrap;align-items:center;column-gap:9px;row-gap:2px;min-height:66px;padding:10px;border:1px solid #bfd4df;border-radius:12px;background:#fff;color:var(--navy);cursor:pointer;text-align:left;touch-action:manipulation}
.spg-study-chapter-button.active{background:#ddf6f3;border:2px solid var(--teal)}
.spg-study-chapter-button:focus-visible,.spg-study-domain-nav button:focus-visible{outline:3px solid #17839b;outline-offset:2px}
.spg-study-chapter-icon{display:grid;place-items:center;width:36px;height:36px;flex:0 0 36px;border-radius:10px;background:var(--sky);font-size:1.15rem}
.spg-study-chapter-button strong{font-size:.87rem}
.spg-study-chapter-button small{display:block;flex-basis:100%;padding-left:45px;color:var(--muted);font-size:.73rem}
.spg-study-page{min-width:0;max-width:100%;margin-top:10px}
.spg-study-page-pager{display:flex;align-items:center;justify-content:space-between;gap:8px;position:static;bottom:auto;z-index:auto;margin:7px 0 11px;padding:8px;border:1px solid #bdced8;border-radius:11px;background:#fff;box-shadow:none}
.spg-study-page-pager strong{color:var(--navy);font-size:.9rem;text-align:center}
.spg-study-page-pager .btn{min-height:44px}
.spg-study-page-pager .btn:disabled{opacity:.5;cursor:not-allowed}
.spg-study-domain-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:0 0 14px}
.spg-study-domain-nav button{min-height:46px;padding:9px 8px;border:1px solid #afc8d3;border-radius:11px;background:#fff;color:var(--navy);font:inherit;font-weight:800;cursor:pointer}
.spg-study-domain-nav button[aria-pressed="true"]{border:2px solid var(--teal);background:#e1f6f2}
body[data-module="study"] .main>.hero{padding:15px 18px;gap:12px;min-height:0}
body[data-module="study"] .main>.hero h1{font-size:clamp(1.55rem,2.5vw,2rem)}
body[data-module="study"] .main>.hero .lead{font-size:.9rem;line-height:1.4}
body[data-module="study"] .main>.hero .coach-card{padding:12px}
body[data-module="study"] .main>.hero .coach-card h2{font-size:1.03rem}
@media(max-width:850px){.spg-study-chapter-items{grid-template-columns:repeat(2,minmax(0,1fr))}.spg-study-domain-nav{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:550px){.spg-study-nav-heading{display:block}.spg-study-nav-heading span{display:block;margin-top:4px}.spg-study-chapter-button{min-height:58px;padding:7px}.spg-study-chapter-icon{width:30px;height:30px;flex-basis:30px}.spg-study-chapter-button strong{font-size:.79rem}.spg-study-chapter-button small{padding-left:39px}.spg-study-page-pager{position:static;bottom:auto;padding:6px;gap:5px}.spg-study-page-pager strong{font-size:.72rem;max-width:100px}.spg-study-page-pager .btn{padding:9px 7px;font-size:.75rem;min-height:42px}}

/* The chapter rail replaces the earlier duplicate direct-destinations chooser. */
body[data-module="study"]:has(.spg-study-chapter-nav) .guided-study-area-chooser{display:none!important}

/* The section pager is now above the active view and never sticks over lesson actions. */
body[data-module="study"] .spg-study-page-pager{position:static;bottom:auto}
body[data-module="study"] .spg-study-page-pager .btn{min-height:42px;white-space:normal;text-align:center}
body[data-module="study"] .spg-study-page{min-width:0;width:100%;max-width:100%}
body[data-module="study"] .main{min-width:0}
body[data-module="study"] .respiratory-study-trail{min-width:0}
@media(max-width:1150px) and (min-width:1051px){
  body[data-module="study"] .layout{grid-template-columns:205px minmax(0,1fr)}
  body[data-module="study"] .main{padding:14px}
}
@media(max-width:720px){
  body[data-module="study"] .spg-study-chapter-nav{padding:8px;margin:9px 0}
  body[data-module="study"] .spg-study-chapter-items{gap:6px}
  body[data-module="study"] .spg-study-chapter-button{min-height:50px}
  body[data-module="study"] .spg-study-page-pager strong{font-size:.72rem}
}
@media(max-width:430px){
  body[data-module="study"] .spg-study-page-pager{display:grid;grid-template-columns:1fr 1fr}
  body[data-module="study"] .spg-study-page-pager strong{order:-1;grid-column:1/-1;max-width:none}
}
