/* Astorians Stage 10 / P10.55–60. Additive layout, text, focus and motion rules. */
:root{--ast10-safe:env(safe-area-inset-bottom,0px);--ast10-focus:#7bedfa}
html{scroll-padding-top:calc(90px + env(safe-area-inset-top,0px))}
:where(#main,.ds-main,.ast-account-box,.ds-grid,.ds-card,.ds-content-column){min-width:0}
:where(#main,.ds-main,.ast-account-layout,.ds-grid) :where(img,video,canvas,svg){max-width:100%}
:where(#main,.ds-main) :where(pre,code){overflow-wrap:anywhere}
:where(#main,.ds-main) :where(pre,table){max-width:100%}
:where(#main,.ds-main) pre{overflow:auto;tab-size:2}
:where(#main,.ds-main) table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
:where(#main,.ds-main) :where(h1,h2,h3,h4,p,li,td,a){overflow-wrap:break-word}
:where(.ds-shell,.ast-p07-account,.ast-dash-page,.ast-p03-site-header) :where(button,a,input,select,textarea,summary):focus-visible{outline:3px solid var(--ast10-focus)!important;outline-offset:3px!important}
:where(.ds-shell,.ast-p03-site-header,.ast-p03-chapters) :where(button,a){touch-action:manipulation}
/* Overlays must be non-interactive while closed (even if an older stylesheet changes opacity). */
.overlay[aria-hidden="true"],.overlay[inert]{pointer-events:none}
.overlay.open[aria-hidden="false"]{pointer-events:auto}
/* Fluid media without distorting course/quiz screenshots. */
.ds-shell :where(.ds-card,.ds-content-column,.ds-main,.ds-next-layout,.ds-account-view),
.ast-dash-page :where(.ast-account-layout,.ast-account-box){min-width:0;max-width:100%}
.ds-shell .ds-card :where(h1,h2,h3,p,a,small){overflow-wrap:break-word}
.ds-shell :where(.ds-hero-actions,.ds-library-note-actions){flex-wrap:wrap}
@media(max-width:1020px){
 .ds-shell .ds-next-layout{grid-template-columns:minmax(0,1fr)}
 .ds-shell .ds-next-layout>*{min-width:0}
}
@media(max-width:780px){
 .ds-shell .ds-main{padding-inline:clamp(12px,3.5vw,22px)}
 .ds-shell .ds-sidebar{padding-bottom:var(--ast10-safe);overscroll-behavior:contain}
 .ds-shell .ds-menu-button{min-height:44px;min-width:44px}
 .ds-shell .ds-topbar{min-width:0}
 .ds-shell .ds-top-search{min-width:0}
 .ds-shell.ds-focused-view .ds-grid{grid-template-columns:minmax(0,1fr)!important}
 .ds-shell.ds-focused-view .ds-grid>*{grid-column:auto!important;grid-row:auto!important}
 .ast-p03-chapters{bottom:calc(74px + var(--ast10-safe))}
}
@media(max-width:600px){
 #topbar .nav-cta .round-btn{min-width:44px;min-height:44px}
 .ds-shell .ds-next-layout,.ds-shell .ds-blank-next{grid-template-columns:minmax(0,1fr)}
 .ds-shell .ds-grid{grid-template-columns:minmax(0,1fr)}
 .ds-shell :where(.ds-card,.ds5-resume){max-width:100%}
 .ds-shell :where(.ds-hero-actions .ds-button,.ds5-resume-cta){white-space:normal;text-align:center}
 .ds-shell .ds-hero-copy{max-width:100%}
 .ds-shell .ds-discover-grid{grid-template-columns:minmax(0,1fr)}
 .ds-shell .ds5-module summary{min-width:0}
 .ds-shell .ds5-module-percent{font-size:11px}
 .ds-shell .ds-viewbar{flex-wrap:wrap}
}
@media(max-width:380px){
 .ds-shell .ds-topbar{gap:8px}
 .ds-shell .ds-mobile-brand span{display:none}
 .ds-shell .ds-hero-copy{padding:20px 14px}
 .ds-shell .ds-card:not(.ds-hero){padding:14px}
}
/* Motion off must preserve structural transforms (such as off-canvas menus). */
body.motion-off *,body.motion-off *::before,body.motion-off *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
body.motion-off :where([data-reveal],[data-cine],.ds-reveal,.ac-reveal,.reveal){opacity:1!important;filter:none!important;clip-path:none!important}
body.motion-off :where(.ds-reveal,[data-reveal],[data-cine],.reveal){transform:none!important}
body.motion-off :where(.ds-card,.ds-side-link,.ds-button,.button):hover{transform:none!important}
@media(prefers-reduced-motion:reduce){
 :root{scroll-behavior:auto!important}
 :where([data-reveal],[data-cine],.ds-reveal,.ac-reveal,.reveal){opacity:1!important;filter:none!important;clip-path:none!important}
 :where(.ds-reveal,[data-reveal],[data-cine],.reveal){transform:none!important}
 :where(.ds-card,.ds-side-link,.ds-button,.button):hover{transform:none!important}
 .ds-hero-mark,.ast-contact-glow{animation:none!important}
}
@media(forced-colors:active){
 .ds-shell :where(.ds-button,.ds-menu-button,.ds-side-link),.ast-p03-chapters-toggle{border:1px solid ButtonText!important}
 .ds-shell .ds-side-link.is-active{outline:2px solid Highlight;outline-offset:-2px}
}

/* Keep the two compact floating utilities on the same bottom edge on phones. */
@media(max-width:600px){
 .ast-p03-chapters{right:12px;bottom:calc(15px + var(--ast10-safe))}
 #motion-toggle.motion-button{left:12px;bottom:calc(15px + var(--ast10-safe));padding:10px 12px;min-height:44px;max-width:calc(50vw - 18px);font-size:12px}
 .ast-p03-chapters-toggle{padding:9px 12px;min-height:44px}
 body:has(.ast-p03-chapters:not([hidden])) #main{padding-bottom:max(110px,calc(80px + var(--ast10-safe)))}
}

/* Stage 71: focused WCAG 2.2 review improvements. Design remains unchanged. */
:where(#main,.ast-journal-article,.ast-ed-latest,.ast-ed-feature,[id^="ast-"]):target{scroll-margin-top:calc(110px + env(safe-area-inset-top,0px))}
:where(#main,.ast-journal-reading,.ast-prose,.ast-journal-prose) :where(img,video,iframe){max-width:100%;height:auto}
:where(#main,.ast-journal-reading,.ast-prose,.ast-journal-prose) :where(pre,table){max-width:100%;overflow-x:auto}
:where(.ast-journal-prose,.ast-prose) :where(a,code,blockquote){overflow-wrap:anywhere}
.ast-journal-reading :where(a,button,input,select,textarea):focus-visible{outline:3px solid #8bf0ff!important;outline-offset:3px!important}
@media(prefers-contrast:more){
 .ast-journal-reading :where(a,button):focus-visible{outline-color:Highlight!important;box-shadow:none!important}
 .ast-journal-reading :where(p,li,small,figcaption){opacity:1!important}
}
@media(prefers-reduced-motion:reduce){
 html:focus-within{scroll-behavior:auto!important}
 .ast-ed-atmosphere,.ast-ed-visual-wash{animation:none!important;transition:none!important}
}
