/* V6.2.3: fluid viewport, safe areas and intrinsic-width balance card. */
:root{--app-span:100vw;--app-left:0px;--app-width:min(460px,calc(var(--app-span) - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px)))}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-bottom:100px}
body{min-width:0}
#app{width:var(--app-width);max-width:none;margin-left:calc(var(--app-left) + env(safe-area-inset-left,0px) + (var(--app-span) - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px) - var(--app-width))/2);margin-right:0;min-height:100vh;min-height:100dvh;padding-top:env(safe-area-inset-top,0px);padding-bottom:calc(92px + env(safe-area-inset-bottom,0px))}
#app .nav{width:var(--app-width);max-width:none;left:calc(var(--app-left) + env(safe-area-inset-left,0px) + (var(--app-span) - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px))/2);padding-bottom:max(9px,env(safe-area-inset-bottom,0px))}
header.v61-home-head{height:auto;min-height:80px;gap:12px;padding:10px 16px}
.v61-home-head .v61-brand{min-width:0;max-width:none;flex:1 1 0;height:58px}
.v61-home-head .v61-brand img{max-height:58px;max-width:100%;height:auto;width:auto;object-fit:contain}
.v61-home-head .v61-account-bar{flex:0 1 auto;width:max-content;max-width:55%;min-width:0;justify-content:flex-end}
.v61-home-head .v61-wallet{display:inline-flex;flex-direction:column;align-items:center;width:max-content;min-width:0;max-width:100%;padding:8px 12px;text-align:center;border:1px solid #e8cd91;border-radius:15px;background:linear-gradient(#fffef8,#ffedbf);box-shadow:0 3px 0 #ead3a0,inset 0 1px #fff}
.v61-home-head .v61-wallet span{display:block;font-size:10px;line-height:1.4;letter-spacing:0;white-space:normal;text-align:center;max-width:100%;margin:0 0 4px;color:#a58a5a}
.v61-home-head .v61-wallet strong{display:block;font-size:18px;font-size:clamp(15px,4.3vw,19px);line-height:1.25;max-width:100%;text-align:center;overflow-wrap:anywhere;font-weight:800;letter-spacing:-.3px;color:#8c5d20}
.v5-home .reference-shortcuts.v62-shortcuts{padding:14px 7px 12px!important;gap:4px!important;align-items:center}
.v62-shortcuts button{padding:0!important;gap:7px;min-height:72px;justify-content:center}
.v62-shortcuts button>.reference-crop,.v62-shortcuts button>.v62-globe{width:51px!important;height:46px!important;flex:0 0 auto;align-self:center}
.v62-shortcuts button>span:last-child{font-size:12px;line-height:18px;white-space:nowrap;letter-spacing:0}
.v62-shortcuts button+button:before{top:14px;height:35px}
#app input:not([type=checkbox]):not([type=radio]):not([type=file]),#app select,#app textarea,#modal input:not([type=checkbox]):not([type=radio]),#modal select,#modal textarea{font-size:16px;max-width:100%;min-width:0}
#app .gold-input{min-width:0}#app .gold-input input{width:100%}
#app .finance-page,#app .v4-page,#app .member-page{min-width:0}
#app .v4-catalog>*,#app .v6-tabs>*,#app .member-numbers>*{min-width:0}
#app .gold-primary,#modal .gold-primary{white-space:normal;overflow-wrap:anywhere;line-height:1.4;min-height:44px}
#modal .overlay{left:var(--app-left);right:auto;width:var(--app-span);top:var(--visual-top,0px);bottom:auto;height:var(--visual-height,100vh);height:var(--visual-height,100dvh);padding:max(14px,env(safe-area-inset-top,0px)) max(14px,env(safe-area-inset-right,0px)) max(14px,env(safe-area-inset-bottom,0px)) max(14px,env(safe-area-inset-left,0px));overflow-y:auto}
#modal .dialog,#modal .dialog.v4-shell{max-width:min(390px,100%);max-height:100%;overflow-y:auto;overscroll-behavior:contain}
@media(max-width:359px){header.v61-home-head{padding:8px 12px;min-height:72px;gap:8px}.v61-home-head .v61-brand{height:54px}.v61-home-head .v61-brand img{max-height:54px}.v61-home-head .v61-wallet{padding:7px 9px;border-radius:12px}.v62-shortcuts button>.reference-crop,.v62-shortcuts button>.v62-globe{width:45px!important;height:41px!important}.v62-shortcuts button>span:last-child{font-size:11px}.v5-home{padding-left:10px;padding-right:10px}.v61-record-main{grid-template-columns:65px minmax(0,1fr)}.v61-record-art{width:65px}.v61-record-art img{max-width:60px}.v61-record-foot .gold-primary{min-width:0}.finance-page{padding-left:12px;padding-right:12px}.v61-points-bottom{gap:8px}}
@media(max-height:500px) and (orientation:landscape){.auth-simple{min-height:100dvh!important}.v5-home .wheel-stage{max-width:min(100%,300px)}#modal .overlay{align-items:flex-start}.v62-notice{padding-top:18px}}
/* Progressive enhancement: keep actions clear of a physical hinge. */
@media(horizontal-viewport-segments:2){:root{--app-span:env(viewport-segment-width 0 0,100vw);--app-left:env(viewport-segment-left 0 0,0px)}}
@media(horizontal-viewport-segments:3){:root{--app-span:env(viewport-segment-width 1 0,100vw);--app-left:env(viewport-segment-left 1 0,0px)}}
