/* AIMRECA mobile-first finishing pass. Existing CMS and content are unchanged. */
html{scroll-padding-top:90px}html,body{max-width:100%;overflow-x:clip}
img,video,canvas,svg{max-width:100%}img{height:auto}iframe{max-width:100%}
:where(button,a,input,select,textarea,summary):focus-visible{outline:3px solid #d9a429!important;outline-offset:3px}
@media(max-width:1050px){
 body > header.nav{position:sticky;top:0;z-index:150;min-height:70px;padding:9px clamp(12px,4vw,30px)!important;gap:12px}
 body > header.nav .brand{min-width:0;flex:1;gap:8px}
 body > header.nav .brand img{width:clamp(40px,9vw,52px);height:clamp(40px,9vw,52px);flex-shrink:0}
 body > header.nav .brand strong{font-size:clamp(19px,5vw,25px)}
 body > header.nav .brand small{font-size:clamp(7px,1.6vw,9px);line-height:1.3;white-space:normal}
 body > header.nav button.menu{display:inline-flex!important;align-items:center;justify-content:center;flex-shrink:0;width:48px;height:48px;background:#0c5c45!important;color:white!important;border:2px solid #d7b455;border-radius:12px;box-shadow:0 4px 0 #06402e,0 7px 12px #06392c33;font-size:25px;line-height:1;z-index:152}
 body > header.nav #navlinks{display:none!important;position:absolute!important;top:100%;left:0;right:0;z-index:151;max-height:calc(100dvh - 86px);overflow-y:auto;overscroll-behavior:contain;flex-direction:column;align-items:stretch;gap:12px;padding:18px clamp(15px,5vw,32px) 26px;background:#f4f8f4;box-shadow:0 15px 28px #052e2440}
 body > header.nav #navlinks.open{display:flex!important}
 body > header.nav #navlinks > a,body > header.nav #navlinks > .aim-about-menu > summary{--nav-top:#167c59;--nav-bottom:#065b41;--nav-edge:#03442f;display:flex!important;justify-content:center;align-items:center;box-sizing:border-box;min-height:48px;width:100%;padding:12px 14px!important;background:linear-gradient(155deg,var(--nav-top),var(--nav-bottom))!important;color:#fff!important;border:1px solid #ffffff70!important;border-radius:12px!important;box-shadow:0 5px 0 var(--nav-edge),0 9px 15px #052d2638!important;font-size:14px!important;font-weight:800!important;text-align:center!important;text-decoration:none!important;text-shadow:0 1px 2px #0004;white-space:normal}
 body > header.nav #navlinks > .aim-about-menu{display:block!important;width:100%}
 body > header.nav #navlinks > .aim-about-menu > summary{--nav-top:#ffda67;--nav-bottom:#e5a52b;--nav-edge:#976213;color:#173d30!important;text-shadow:none}
 body > header.nav #navlinks > a:nth-of-type(1){--nav-top:#36ac3c;--nav-bottom:#117b2b;--nav-edge:#07551b}
 body > header.nav #navlinks > a:nth-of-type(2){--nav-top:#387cff;--nav-bottom:#1748c6;--nav-edge:#10358e}
 body > header.nav #navlinks > a:nth-of-type(3){--nav-top:#b044e9;--nav-bottom:#7820bd;--nav-edge:#521080}
 body > header.nav #navlinks > a:nth-of-type(4){--nav-top:#ff6660;--nav-bottom:#d93738;--nav-edge:#982124}
 body > header.nav #navlinks > a:nth-of-type(5){--nav-top:#0d856a;--nav-bottom:#07533e;--nav-edge:#033a2b}
 body > header.nav #navlinks > a:nth-of-type(6){--nav-top:#4ba4ff;--nav-bottom:#2167d5;--nav-edge:#154899}
 body > header.nav #navlinks > a:nth-of-type(7){--nav-top:#ff8b4c;--nav-bottom:#ef5434;--nav-edge:#a6371d}
 body > header.nav #navlinks .aim-about-options{position:static!important;min-width:0!important;width:100%;margin:12px 0 0!important;padding:10px!important;box-shadow:none!important}
 body > header.nav #navlinks .aim-about-options a{white-space:normal!important;min-height:43px;display:flex!important;align-items:center!important}
 body > header.nav #navlinks > a:active,body > header.nav #navlinks > .aim-about-menu > summary:active{transform:translateY(3px);box-shadow:0 2px 0 var(--nav-edge),0 4px 8px #052d2633!important}
}
@media(max-width:760px){
 body .topline{gap:10px;min-height:34px;height:auto;padding:7px 4%;line-height:1.3}
 body .topline>span{max-width:65%}
 body .hero-content{padding-top:clamp(45px,10vw,85px);margin-inline:6%}
 body .hero h1{font-size:clamp(30px,8vw,49px);overflow-wrap:break-word}
 body .hero p{font-size:clamp(14px,3.6vw,17px)}
 body .hero-meta{flex-wrap:wrap;gap:10px 18px;margin-top:25px}
 body .hero-controls{bottom:15px}
 body .actions{gap:10px}
 body .actions .btn{min-height:44px;padding:13px 17px;gap:10px}
 body .about-grid,body .founder-layout,body .research-layout,body .events-layout,body .contact-layout{grid-template-columns:minmax(0,1fr)}
 body .aim-grid,body .mission-grid{grid-template-columns:minmax(0,1fr)}
 body .section,body .mission-section,body .research-section,body .events-section,body .contact-section,body .aim-section{padding:clamp(38px,8vw,70px) 5%}
 body .aim-welcome{padding-inline:5%}
 body .seven-visual-strip{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 body .orbit{max-width:100%}
 body .priority-node{max-width:135px}
 body .footer-top,body .footer-bottom{gap:14px}
}
@media(max-width:480px){
 body .brand small{max-width:205px}
 body .seven-visual-strip{grid-template-columns:minmax(0,1fr)!important}
 body .priority-grid{grid-template-columns:minmax(0,1fr)}
 body .aim-card,body .mission-card{padding:20px}
 body .hero{min-height:620px}
 body .hero h1{font-size:clamp(30px,9vw,42px)}
 body .gallery-grid{grid-template-columns:minmax(0,1fr)}
}
/* Generic subpages: tables, forms and cards must fit a narrow screen. */
@media(max-width:760px){
 .site-header{gap:12px!important;padding:12px 4%!important}
 .site-header .brand{min-width:0;overflow-wrap:anywhere}
 .site-header nav{width:100%;gap:7px!important;justify-content:flex-start}
 .site-header nav a{padding:8px 10px;border:1px solid #ffffff4a;border-radius:8px;min-height:40px;display:inline-flex;align-items:center}
 .wrap{padding:30px 4% 60px!important}
 .grid{grid-template-columns:minmax(0,1fr)!important}
 .card,.form-card{padding:18px!important;max-width:100%}
 input,select,textarea{font-size:16px!important;max-width:100%;min-width:0}
 .form-card button,form button{max-width:100%;white-space:normal}
 table{display:block;overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}
 .footer-links{gap:10px;flex-wrap:wrap}
}
/* CMS dashboard: preserve editing controls and make them usable by touch. */
@media(max-width:900px){
 body:has(#cms-upgrade) #cms-upgrade{display:block!important;max-width:100%!important;padding:0 12px!important}
 body:has(#cms-upgrade) #cms-upgrade[hidden]{display:none!important}
 #aimreca-app-menu{position:static!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:14px 0;padding:12px}
 #aimreca-app-menu button{width:100%;min-height:52px;white-space:normal;text-align:center;font-size:13px}
 #aimreca-guide{margin:12px 0}
 #cms-frame{height:min(60vh,520px)!important;width:100%!important;max-width:100%}
 #cms-selected{max-width:100%;overflow-wrap:anywhere}
 #cms-upgrade textarea,#cms-upgrade input,#cms-upgrade select{max-width:100%;font-size:16px}
 #cms-upgrade button{max-width:100%;white-space:normal}
}
@media(max-width:480px){#aimreca-app-menu{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}#aimreca-app-menu button{font-size:12px!important;padding:11px 6px!important}}
@media(prefers-reduced-motion:reduce){body > header.nav #navlinks a,body > header.nav #navlinks summary{transition:none!important}}
