.research-page { max-width: 1440px !important; padding: 0 2rem; }
.research-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 2.5rem; align-items: start; margin-top: 2rem; }
.research-content { min-width: 0; line-height: 1.7; }
.research-content h2, .research-content h3 { scroll-margin-top: 100px; }
.research-content h2 { border-bottom: 1px solid var(--global-border-color, #ddd); padding-bottom: .6rem; margin-top: 3rem; }
.research-content h2:first-child { margin-top: 0; }
.research-content h3 { font-size: 1.2em; margin-top: 2rem; width: fit-content; max-width: 100%; color: #fff; background: #00885e; padding: .2em .55em; border-radius: .35em; }
.research-content figure { width: 100%; margin: 2rem auto; }
.research-content figure img { display: block; max-width: 100%; height: auto; margin: auto; }
.research-content figcaption, .research-map-caption { font-size: .8em; line-height: 1.5; margin-top: .7rem; }
.research-chapters { position: sticky; top: 95px; max-height: calc(100vh - 115px); overflow-y: auto; border: 1px solid var(--global-border-color, #ddd); border-radius: 12px; padding: 1rem; background: var(--global-bg-color, #fff); }
.research-chapters summary { cursor: pointer; font-size: .85em; font-weight: 700; }
.research-chapters nav { display: flex; flex-direction: column; gap: .2rem; margin-top: .8rem; }
.research-chapters a { font-size: .8em; line-height: 1.5; padding: .45rem .6rem; border-left: 3px solid transparent; text-decoration: none; color: inherit; }
.research-chapters a[href='#impute-first'], .research-chapters a[href='#imput2t'], .research-chapters a[href='#igloo'], .research-chapters a[href='#gairr-suite'] { padding-left: 1.4rem; }
.research-chapters a:hover, .research-chapters a[aria-current='location'] { background: rgba(0, 139, 103, .12); border-left-color: #008b67; }
.research-chapters a:focus-visible, .research-map-scroll:focus-visible { outline: 3px solid #008b67; outline-offset: 3px; }
#research-current { display: none; }
.research-map-scroll { overflow-x: auto; border: 0; border-radius: 0; background: transparent; }
.research-map { position: relative; width: 100%; max-width: calc(133.333vh - 80px); margin-right: auto; }
.research-map > img { display: block; width: 100%; height: auto; margin: 0; }
.research-map-link { position: absolute; display: block; border-radius: 8px; }
.research-map-link:hover, .research-map-link:focus-visible { outline: 4px solid #004d3b; outline-offset: 4px; background: rgba(255,255,255,.15); box-shadow: 0 0 0 7px rgba(255,255,255,.8); }
.research-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 1000px) {
 .research-page { padding: 0 1rem; }
 .research-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
 .research-chapters { top: 65px; z-index: 10; padding: .8rem 1rem; max-height: calc(100vh - 90px); }
 .research-chapters nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .research-content h2, .research-content h3 { scroll-margin-top: 145px; }
 #research-current { display: inline; font-weight: 400; font-size: .85em; margin-left: .5rem; }
}
@media (prefers-reduced-motion: no-preference) { html:has(.research-page) { scroll-behavior: smooth; } }

.research-teal-label { color: #fff; background: #00885e; font-weight: 700; padding: .15em .45em; border-radius: .35em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

@media (max-width: 1000px) {
 .research-map { width: 100%; min-width: 760px; max-width: none; }
}

.research-map-instruction { display: flex; align-items: center; gap: .75rem; }
.research-click-hand { width: 36px; height: 36px; flex: 0 0 36px; color: #00885e; }
body.research-auto-header .masthead { transition: transform .2s ease; }
body.research-header-hidden .masthead { transform: translateY(-100%); }
body.research-auto-header .masthead:focus-within { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
 body.research-auto-header .masthead { transition: none; }
}

.research-map-enlarge { position: absolute; display: block; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: zoom-in; transition: all .2s ease-in-out; }
.research-map-enlarge:hover, .research-map-enlarge:focus-visible { outline: 4px solid #111; outline-offset: 4px; background: rgba(255,255,255,.15); box-shadow: 0 0 0 7px rgba(255,255,255,.8); }
body.research-zoom-open { overflow: hidden; }
.research-zoom { width: 96vw; max-width: none; height: 94dvh; max-height: 94dvh; padding: 16px; border: 0; border-radius: 12px; background: white; color: #222; }
.research-zoom::backdrop { background: rgb(0 0 0 / 65%); }
.research-zoom[open] { display: flex; flex-direction: column; }
.research-zoom-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: 0 0 auto; }
.research-zoom-toolbar h2 { margin: 0; font-size: 1.1rem; }
.research-zoom-close { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; margin: 0; border: 1px solid #ccc; border-radius: 50%; background: white; color: #222; font-size: 30px; line-height: 1; cursor: pointer; }
.research-zoom-close:hover { background: #e5f3ee; color: #222; }
.research-zoom-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding-top: 12px; }
.research-zoom-stage svg { display: block; width: 100%; height: 100%; }
.research-zoom-stage rect { fill: transparent; }
.research-zoom-stage a:hover rect, .research-zoom-stage a:focus rect { fill: rgb(255 255 255 / 15%); stroke: #004d3b; stroke-width: 4; }

.research-zoom { transform-origin: top left; }

@media (prefers-reduced-motion: reduce) {
 .research-map-enlarge { transition: none; }
}

/* Preserve the scrollbar space when an enlarged diagram locks page scrolling. */
html:has(.research-page) { scrollbar-gutter: stable; }
