html{min-height:100%;-webkit-text-size-adjust:100%;scroll-padding-bottom:7rem}
body{min-height:100vh;min-height:100dvh;padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
header{padding-top:max(.8rem,env(safe-area-inset-top));flex-wrap:wrap}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
button{touch-action:manipulation;min-height:44px}
input,select,textarea{font-size:16px}
#install-app{font-size:.85rem;white-space:nowrap}
#connection-status,#pwa-update{padding:.8rem 1rem;background:#fff0b6;color:#452467;text-align:center;border-bottom:1px solid #e2c979}
#pwa-update button{margin-left:.6rem}#connection-status{position:sticky;top:0;z-index:120}
#install-help{border:1px solid var(--line);border-radius:1.4rem;max-width:min(90vw,28rem);padding:1.5rem;color:var(--ink);box-shadow:0 12px 60px #28214533}
#install-help::backdrop{background:#28214580}#install-help h2{margin-top:0}#install-help button{width:100%}
.offline-page{max-width:35rem;margin:8vh auto;text-align:center}.offline-page img{margin:0 auto 1.4rem;border-radius:1.4rem}.offline-page h1{font-size:2rem}.offline-retry{display:inline-block;margin-top:1rem;background:var(--purple);color:white;padding:.9rem 1.3rem;border-radius:1rem;text-decoration:none;font-weight:850}
.camera-choice{padding:.75rem;background:var(--lavender);border-radius:.8rem}.camera-choice input{background:white}
@media(max-width:640px){
 main{padding:1rem 1rem calc(7.5rem + env(safe-area-inset-bottom))}
 header{gap:.5rem;padding-left:1rem;padding-right:1rem}header strong{flex-basis:100%;font-size:1.15rem}
 header #sound-toggle{margin-left:auto;font-size:.8rem}header #mode{font-size:.85rem}
 .hero{display:grid;grid-template-columns:minmax(0,1fr);gap:1rem;padding:1.25rem;border-radius:1.4rem}
 .hero h1{font-size:clamp(1.8rem,8vw,2.5rem)}.hero .wallet{display:block;justify-self:center;width:auto;min-width:8.5rem}
 #tabs{position:fixed;bottom:0;left:0;right:0;z-index:80;margin:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.2rem;background:#fff;padding:.5rem max(.35rem,env(safe-area-inset-right)) calc(.5rem + env(safe-area-inset-bottom)) max(.35rem,env(safe-area-inset-left));border-top:1px solid var(--line);box-shadow:0 -4px 20px #2821450d}
 #tabs button{padding:.45rem .1rem;font-size:clamp(.6rem,2.7vw,.8rem);border-radius:.8rem;line-height:1.25;min-width:0;overflow-wrap:normal}
 #tabs button span{display:block}#tabs .tab-icon{font-size:1.25rem;margin-bottom:.2rem}
 .admin-nav{position:sticky;top:0;z-index:60;flex-wrap:nowrap;overflow-x:auto;max-width:100%;border-radius:.9rem;overscroll-behavior-x:contain}
 .admin-nav button{flex:none;font-size:.85rem;white-space:nowrap}
 .admin-section .grid form{grid-template-columns:minmax(0,1fr)}
 .mission-focus{margin:0 auto}.mission-actions{position:static}
 #login,#recovery,#reset-password{max-width:100%;margin:1rem auto;padding:1.2rem}
 .history-tabs button{font-size:.8rem}.history-panel li{font-size:.9rem}
}
