/* EDIVIC Phase 9 — shared accessibility, performance and responsive safeguards. */
:root{--edv-focus:#2b1b0d;--edv-focus-ring:#ffbe00}
*,*::before,*::after{box-sizing:border-box}
html{width:100%;max-width:100%;-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:96px}
body{width:100%;max-width:100%;overflow-wrap:anywhere}
:where(main,section,article,aside,header,footer,nav,form,fieldset,div,ul,ol,li){min-width:0}
:where(img,picture,video,canvas,svg,iframe,embed,object){max-width:100%}
img,video{height:auto}
iframe{border:0}
:where(button,input,select,textarea){font:inherit;max-width:100%}
textarea{resize:vertical}
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid var(--edv-focus)!important;outline-offset:3px!important;box-shadow:0 0 0 2px var(--edv-focus-ring)!important}
:where(button,input,select,textarea):disabled{cursor:not-allowed;opacity:.7}
:where(p,li,dd,td,th,.muted,.subtitle,.description){overflow-wrap:anywhere}
[hidden],.edivic-legacy-shell-bridge[hidden]{display:none!important}
.edivic-skip-link{position:fixed!important;z-index:2147483647!important;top:10px!important;left:10px!important;transform:translateY(-180%);padding:11px 15px!important;border:2px solid #2b1b0d!important;border-radius:12px!important;background:#fffdf7!important;color:#2b1b0d!important;font:800 14px/1.2 system-ui,sans-serif!important;text-decoration:none!important;box-shadow:0 10px 30px rgba(43,27,13,.2)!important;transition:transform .16s ease}
.edivic-skip-link:focus{transform:translateY(0);outline:3px solid #ffbe00!important;outline-offset:3px!important}
main[id]{scroll-margin-top:96px}
main[id]:focus{outline:0}
.sr-only,.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.edivic-table-scroll,.table-wrap,.tbl-container,.comparison-wrap,.table-container{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-inline:contain}
:where(dialog,.modal,.modal-card,[role="dialog"]){max-width:min(94vw,720px);max-height:min(90dvh,900px)}
:where(.modal,.dialog-backdrop,[role="dialog"]){overscroll-behavior:contain}
/* Prevent asynchronous app-shell hydration from leaving desktop offsets on narrow devices. */
@media(max-width:1100px){
 html,body{overflow-x:clip!important}
 body.edivic-app-shell-active .edivic-shell-content,
 body.edivic-app-shell-active.edivic-shell-mobile-normalized .edivic-shell-content,
 body.edivic-app-shell-active :is(main.main,main.main-shell,main.page-shell,main.dashboard-main,main.pricing-main,main.editor-dashboard-main){box-sizing:border-box!important;margin-left:0!important;margin-right:0!important;left:auto!important;right:auto!important;transform:none!important;width:100%!important;max-width:100%!important;min-width:0!important}
 body.edivic-app-shell-active[data-edivic-shell-page="active-projects.html"] .edivic-shell-content{padding-left:clamp(14px,3vw,22px)!important;padding-right:clamp(14px,3vw,22px)!important}
 body.edivic-app-shell-active[data-edivic-shell-page="project-details.html"] .edivic-shell-content{margin-left:0!important;padding-left:0!important;padding-right:0!important}
 body.edivic-app-shell-active .edivic-shell-content>*{min-width:0;max-width:100%}
}
/* Workflow page containment. */
body.hiw-page,.hiw-hero,.home-page{overflow-x:clip}
.main-shell,.page-shell{max-width:100%}
:where(.marketplace-layout,.directory-layout,.workspace-grid,.dashboard-grid,.settings-layout,.layout,.messages-layout){min-width:0}
/* Settings navigation remains usable without widening the document. */
@media(max-width:900px){
 .settings-layout,.settings-workspace,.settings-grid{grid-template-columns:minmax(0,1fr)!important}
 .settings-nav,.settings-sidebar,.section-nav{position:sticky!important;top:var(--edivic-shell-topbar-h,70px)!important;z-index:20;display:flex!important;max-width:100%!important;overflow-x:auto!important;overscroll-behavior-inline:contain;scrollbar-width:thin;white-space:nowrap}
 .settings-nav button,.settings-sidebar button,.section-nav button{flex:0 0 auto}
}
/* Stable tap areas. Native checkboxes/radios retain their visual size; their labels provide the target. */
@media(pointer:coarse){
 :where(a.btn,button,.btn,.edv-btn,.auth-button,.icon-btn,.menu-btn,.small-button,.filter-button,.quick-reply,summary){min-height:44px}
 :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){min-height:44px}
 label:has(input[type="checkbox"]),label:has(input[type="radio"]){min-height:44px;display:inline-flex;align-items:center}
}
@media(max-width:520px){
 input,select,textarea{font-size:16px!important}
 :where(.btn,.edv-btn,.auth-button,button[type="submit"]){min-height:44px}
 .password-toggle{min-width:44px;min-height:44px}
 .filter-tabs,.toolbar,.quick-actions{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
}
/* Dynamic viewport and safe-area support. */
:where(.auth-page,.auth-shell,.messages-shell,.chat-layout,.full-height,.min-screen){min-height:100vh;min-height:100dvh}
@supports(padding:max(0px)){body{padding-bottom:env(safe-area-inset-bottom)}.sticky-actions,.mobile-composer{padding-bottom:max(12px,env(safe-area-inset-bottom))}}
/* Reduce unnecessary painting for long below-the-fold sections while preserving search/accessibility. */
@supports(content-visibility:auto){
 .home-audience,.home-showcase,.home-process,.home-membership,.home-editors,.edv-how,.home-faq,.home-final-cta{content-visibility:auto;contain-intrinsic-size:700px}
}
@media(hover:none){:where(a,button,.card,.home-showcase-card):hover{transform:none!important}}
@media(prefers-reduced-motion:reduce){
 html{scroll-behavior:auto!important}
 *,*::before,*::after{animation-duration:.01ms!important;animation-delay:0ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important;transition-delay:0ms!important}
 .edivic-skip-link{transition:none}
}
@media(prefers-contrast:more){:where(.panel,.card,.field input,.field select,.field textarea){border-color:currentColor!important}:where(.muted,.subtitle,.description){opacity:1!important}}
@media(forced-colors:active){.edivic-skip-link{border:2px solid ButtonText!important}:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid Highlight!important;box-shadow:none!important}}
@media print{.edivic-app-topbar,.edivic-app-sidebar,.public-shell,.edivic-skip-link,.sticky-actions,.mobile-composer{display:none!important}body,main{margin:0!important;padding:0!important;background:#fff!important;color:#000!important;box-shadow:none!important}}

/* Phase 9 specificity hardening: page-level embedded CSS must never restore the desktop shell offset below the drawer breakpoint. */
@media(max-width:1100px){
 html body.edivic-app-shell-active[data-edivic-shell-page] main.edivic-shell-content.edivic-shell-content{
   margin-left:0!important;margin-right:0!important;left:auto!important;right:auto!important;transform:none!important;width:100%!important;max-width:100%!important;min-width:0!important;
 }
 html body.edivic-app-shell-active main.page-shell.page-shell.page-shell,
 html body.edivic-app-shell-active main.main-shell.main-shell.main-shell,
 html body.edivic-app-shell-active main.dashboard-main.dashboard-main.dashboard-main,
 html body.edivic-app-shell-active main.main.main.main{
   margin-left:0!important;margin-right:0!important;left:auto!important;right:auto!important;transform:none!important;width:100%!important;max-width:100%!important;min-width:0!important;
 }
}

/* Dense directory utilities still need a dependable touch target. */
.clear-btn{min-height:44px!important;padding-block:8px!important}

/* Immediate page identity prevents shell layout shift before app-shell.js finishes. */
body[data-edivic-shell-page="browse-briefs.html"] .page-shell .hero :is(h1,p),
body[data-edivic-shell-page="browse-editors.html"] .page-shell .hero :is(h1,p){color:#fffdf7!important}
body[data-edivic-shell-page="browse-briefs.html"] .page-shell .hero .eyebrow,
body[data-edivic-shell-page="browse-editors.html"] .page-shell .hero .eyebrow{color:#ffd65b!important}
body[data-edivic-shell-page="settings.html"] .hero :is(h1,p),
body[data-edivic-shell-page="notifications.html"] .hero :is(h1,p){color:#fffdf7!important}
@media(max-width:760px){.home-page .home-hero-media,.home-page .home-hero-frame{width:100%!important;max-width:100%!important;transform:none!important;left:auto!important;right:auto!important}}

/* Cross-page visual regressions found in the Phase 9 rendered-device pass. */
@media(max-width:980px){
 body[data-edivic-shell-page="settings.html"] .security-card{grid-template-columns:minmax(0,1fr)!important;min-height:0!important;height:auto!important}
 body[data-edivic-shell-page="settings.html"] .page-head{grid-template-columns:minmax(0,1fr)!important}
}
body[data-edivic-shell-page="pricing.html"] .hero-price strong{font-size:clamp(3.8rem,6vw,5.5rem)!important;white-space:nowrap!important;word-break:normal!important;overflow-wrap:normal!important;letter-spacing:-.075em!important}
body[data-edivic-shell-page="pricing.html"] .price-wrap strong{white-space:nowrap!important;word-break:normal!important;overflow-wrap:normal!important}
body[data-edivic-shell-page="settings.html"] .security-actions{display:flex;gap:8px;flex-wrap:wrap}
@media(max-width:760px){
 body[data-edivic-shell-page="settings.html"] .section-tabs{display:flex!important;grid-template-columns:none!important;max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;gap:8px!important;padding:8px!important;white-space:nowrap;overscroll-behavior-inline:contain;scroll-snap-type:x proximity}
 body[data-edivic-shell-page="settings.html"] .section-tabs button{flex:0 0 auto!important;width:auto!important;min-width:max-content!important;white-space:nowrap!important;scroll-snap-align:start}
}
