/* Shared mobile layout: retain DAICO identity and keep controls within the viewport. */
@media(max-width:980px){
 html{color-scheme:light;scroll-padding-top:90px;-webkit-text-size-adjust:100%}
 body{min-width:0}
 body:has(dialog[open]),body:has(.side.open){overflow:hidden}
 img,video,canvas{max-inline-size:100%}
 button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
 input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea{font-size:16px!important;max-width:100%;min-width:0}
 input[type=checkbox],input[type=radio]{accent-color:#0e2a4e}
 button,.btn,.iconbtn{touch-action:manipulation}
 .btn,.iconbtn,.lang,.chip{min-height:44px}
 .iconbtn{min-width:44px;flex-shrink:0}
 .qa,.acts,.filters,.soc{flex-wrap:wrap}
 .qa>*,.acts>*{max-width:100%}
 .sheet{width:calc(100% - 24px);max-width:calc(100% - 24px);max-height:calc(100dvh - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));margin:auto;border-radius:24px}
 .sheet .sh{max-height:calc(100dvh - 28px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;min-height:0}
 .sheet .sh-head{flex-shrink:0;padding:18px 16px 12px}
 .sheet .sh-body{padding:18px 16px calc(20px + env(safe-area-inset-bottom,0px));min-height:0;overflow-y:auto;overscroll-behavior:contain}
 .sheet .sh-head h2{font-size:20px;line-height:1.5;overflow-wrap:anywhere}
 .sheet .sh-head .sp{min-width:0}
 body[data-app=portal] .mtop{top:env(safe-area-inset-top,0px);padding-top:10px;gap:10px}
 body[data-app=portal] .mobile-brand{display:flex;min-width:0}
 body[data-app=portal] .mobile-brand svg{display:block;width:auto;height:36px;max-width:170px}
 body[data-app=portal] .side{max-height:100dvh;overscroll-behavior:contain}
 body[data-app=portal] .main{padding-top:18px;padding-bottom:calc(104px + env(safe-area-inset-bottom,0px))}
 body[data-app=portal] .inner,body[data-app=portal] .card,body[data-app=portal] .form,body[data-app=portal] .form>*{min-width:0}
 body[data-app=portal] .card:has(table){overflow-x:auto}
 body[data-app=portal] .tabbar{padding-top:8px;min-height:72px}
 body[data-app=portal] .tabbar a{min-height:48px;align-content:center;font-size:12px}
 body[data-app=portal] .tabbar a .i{width:24px;height:24px}
 body[data-app=portal].keyboard-open .tabbar{display:none}
 body[data-app=portal].keyboard-open .main{padding-bottom:20px}
 body[data-app=portal] .login .art{min-height:190px;max-height:none;padding:28px 22px;align-content:center;gap:10px}
 body[data-app=portal] .login .art h1{max-width:calc(100% - 78px);font-size:clamp(22px,5vw,28px);line-height:1.6}
 body[data-app=portal] .login .art p{display:block;max-width:calc(100% - 78px);font-size:14px;line-height:1.7}
 body[data-app=portal] .login .art svg.sw{height:100%!important;width:auto!important;left:-8px!important;pointer-events:none}
 body[data-app=portal] .login .pane2{padding:26px max(20px,env(safe-area-inset-right,0px)) calc(32px + env(safe-area-inset-bottom,0px)) max(20px,env(safe-area-inset-left,0px));gap:20px}
 body[data-app=portal] .login .lk svg{height:auto;max-height:58px;max-width:100%}
 body[data-app=portal] .login .pane2 h2{font-size:clamp(21px,5.5vw,26px)!important;line-height:1.6}
 body[data-app=events]{padding-top:env(safe-area-inset-top,0px)}
 body[data-app=events] .top{top:calc(env(safe-area-inset-top,0px) + 12px * var(--header-progress))}
 body[data-app=events] .top .brand svg{max-width:165px}
 body[data-app=events] .hero .rib{display:block;pointer-events:none;top:auto;bottom:-30px;left:-18px;height:280px;width:auto;opacity:.85}
 html[dir=ltr] body[data-app=events] .hero .rib{left:auto;right:-18px;transform:scaleX(-1)}
 body[data-app=events] .hero .copy{position:relative;z-index:1}
 body[data-app=events] .hero .wrap{padding-block:48px 106px}
 body[data-app=events] footer{padding-bottom:calc(28px + env(safe-area-inset-bottom,0px))}
 body[data-app=events] footer .brand svg{max-width:100%;height:auto;max-height:52px}
 body[data-app=events] .socials{flex-wrap:wrap}
 body[data-app=events] .socials a{width:46px;height:46px}
 body[data-app=events] .public-community-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))}
 body[data-app=events] .public-member-card{min-width:0}
}
@media(max-width:600px){
 .form-row,.grid2,.about-grid{grid-template-columns:minmax(0,1fr)!important}
 .form-row>*{min-width:0}
 .opts,.pick,.checks{max-width:100%}
 .opts label{min-height:44px}
 .btn{white-space:normal;text-align:center;line-height:1.5;padding-block:10px}
 .sh-body .btn{max-width:100%}
 body[data-app=events] .wrap{width:calc(100% - 32px)}
 body[data-app=events] .top{top:calc(env(safe-area-inset-top,0px) + 8px * var(--header-progress))}
 body[data-app=events] .top>.wrap{width:calc(100% - 24px)}
 body[data-app=events] .lang{min-width:68px;padding-inline:12px}
 body[data-app=events] .hero .copy{gap:18px}
 body[data-app=events] .hero h1{font-size:clamp(30px,8vw,40px);line-height:1.45}
 body[data-app=events] .hero .lead{line-height:1.9}
 body[data-app=events] .hero .cta{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:10px}
 body[data-app=events] .hero .cta .btn{font-size:14px;padding-inline:10px}
 body[data-app=events] .hstats{gap:18px;flex-wrap:wrap}
 body[data-app=events] section.s{padding-block:52px}
 body[data-app=events] .s-head{gap:20px;margin-bottom:24px}
 body[data-app=events] .s-head h2{line-height:1.5}
 body[data-app=events] .past{grid-template-columns:minmax(0,1fr);gap:16px}
 body[data-app=events] .ev{grid-template-columns:minmax(0,1fr) 76px;gap:12px}
 body[data-app=events] .ev .thumb{width:76px}
 body[data-app=events] .ev h3{line-height:1.6;overflow-wrap:anywhere}
 body[data-app=events] .box{padding:20px 16px}
 body[data-app=events] .evhead,body[data-app=events] .evbody{grid-template-columns:minmax(0,1fr);gap:22px}
 body[data-app=events] .evhead .poster{max-width:340px;width:100%;margin-inline:auto}
 body[data-app=events] footer{padding-top:44px}
 body[data-app=events] footer .cols{grid-template-columns:minmax(0,1fr);gap:28px}
 body[data-app=events] .public-community{padding-top:24px}
 body[data-app=events] .public-community>header p{font-size:16px}
 body[data-app=events] .public-member-card{min-height:330px;padding:24px}
 body[data-app=events] .public-member-tile{width:276px;min-height:160px}
 body[data-app=portal] .main{padding-inline:14px}
 body[data-app=portal] .ph{gap:14px;align-items:flex-start;flex-direction:column}
 body[data-app=portal] .ph h1{font-size:clamp(24px,6vw,30px);line-height:1.5}
 body[data-app=portal] .ph>.qa{width:100%}
 body[data-app=portal] .evlist,body[data-app=portal] .mgrid,body[data-app=portal] .inigrid{grid-template-columns:minmax(0,1fr)}
 body[data-app=portal] .card{padding:18px 16px;border-radius:20px}
 body[data-app=portal] .card>header{flex-wrap:wrap;gap:10px}
 body[data-app=portal] .li{flex-wrap:wrap}
 body[data-app=portal] .li>.tx{flex:1 1 140px}
 body[data-app=portal] .hello{padding:24px 20px;gap:20px}
 body[data-app=portal] .hello .rib{display:block;pointer-events:none;height:220px;width:auto;left:-24px;opacity:.4}
 body[data-app=portal] .hello .hl{position:relative;z-index:1}
 body[data-app=portal] .hstat{gap:6px;grid-template-columns:repeat(3,minmax(0,1fr))}
 body[data-app=portal] .hstat a{padding:12px 8px}
 body[data-app=portal] .hstat span{line-height:1.5}
 body[data-app=portal] .mg-head{gap:12px;flex-wrap:wrap}
 body[data-app=portal] .mg-head .t{min-width:0;flex:1 1 160px}
 body[data-app=portal] .mecard{position:relative;border-top:4px solid var(--teal)}
 body[data-app=portal] .mecard h1{font-size:26px}
 body[data-app=portal] .acct-grid{grid-template-columns:minmax(0,1fr)}
 body[data-app=portal] .prof-head{padding:20px 16px;gap:12px;align-items:flex-start;flex-wrap:wrap}
 body[data-app=portal] .prof-head>div{min-width:0;flex:1 1 140px}
 body[data-app=portal] .prof-head h2{font-size:22px;overflow-wrap:anywhere}
 body[data-app=portal] .lvls{gap:4px}
 body[data-app=portal] .lv span{width:40px;height:40px}
 body[data-app=portal] .lv.on span{width:44px;height:44px}
 body[data-app=portal] .mentor-conversation{height:calc(var(--visual-height,100dvh) - 172px);min-height:460px!important;gap:10px!important}
 body[data-app=portal] .mentor-conversation>header{padding:12px}
 body[data-app=portal] .mentor-conversation h1{font-size:18px;line-height:1.5}
 body[data-app=portal] .mentor-conversation #mentor-thread{min-height:100px;max-height:none!important;padding:12px}
 body[data-app=portal] .mentor-conversation #mentor-send{flex-shrink:0;gap:10px;padding:12px}
 body[data-app=portal] .mentor-conversation #mentor-text{min-height:52px!important}
 body[data-app=portal] .mentor-conversation .hint{font-size:12px;line-height:1.6}
 body[data-app=portal] .mentor-file{max-width:100%;overflow-wrap:anywhere}
 body[data-app=portal].keyboard-open .mentor-conversation{min-height:360px!important;height:calc(var(--visual-height,100dvh) - 100px)}
 body[data-app=join],body[data-app=reset]{padding:16px max(16px,env(safe-area-inset-right,0px)) calc(24px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px));min-height:100dvh}
 body[data-app=join] .body{padding:24px 20px}
 body[data-app=join] .head{padding:24px 20px}
 body[data-app=join] .foot{padding:18px 20px}
 body[data-app=join] .brand{flex-wrap:wrap}
 body[data-app=join] .pw button{min-height:44px}
 body[data-app=reset] .card{padding:26px 20px;min-width:0}
 body[data-app=reset] .brand{width:fit-content;padding:12px 16px;background:#0e2a4e;border-radius:14px}
}
@media(max-width:359px){
 body[data-app=events] .top .brand svg{max-width:132px}
 body[data-app=portal] .mobile-brand svg{max-width:144px}
 body[data-app=portal] .tiles{gap:8px}
 body[data-app=portal] .card{padding:16px 12px}
 body[data-app=portal] .tabbar a{font-size:11px}
}
@media(max-height:500px) and (orientation:landscape){
 body[data-app=portal] .login{grid-template-columns:minmax(0,1fr);grid-template-rows:auto 1fr}
 body[data-app=portal] .login .art{min-height:130px;padding-block:18px}
 .sheet,.sheet .sh{max-height:calc(100dvh - 16px)}
}
