/* Narrow screens: account popovers and wallet stay within the viewport. */
@media(max-width:1100px){
 .header #menu-login.login-panel{position:fixed!important;left:auto!important;right:12px!important;top:var(--cm-account-menu-top,80px)!important;bottom:auto;width:min(380px,calc(100vw - 24px))!important;min-width:0!important;max-width:calc(100vw - 24px)!important;max-height:calc(100vh - var(--cm-account-menu-top,80px) - 12px);max-height:calc(100dvh - var(--cm-account-menu-top,80px) - 12px);box-sizing:border-box;padding:18px;border-radius:17px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;text-align:left}
 .header #menu-login>*{min-width:0;max-width:100%;box-sizing:border-box}
 .header #menu-login .button,.header #menu-login .outline-button{max-width:100%;white-space:normal;overflow-wrap:anywhere;box-sizing:border-box}
 .header #menu-login .header-credit-strip{display:flex;flex-wrap:wrap;gap:12px;padding:13px;box-sizing:border-box;width:100%;min-width:0}
 .header #menu-login .header-credit-strip>div{min-width:0;flex:1 1 70px;overflow-wrap:anywhere}
 .header #menu-login .header-credit-strip>div+div{padding-left:12px}
 .header #menu-login .header-credit-strip .button{flex:0 0 auto;min-width:0;margin-left:0;padding:9px 14px}
 .header #menu-login .menu-item{width:100%;min-width:0;min-height:44px;font-size:14px;line-height:1.4;padding:11px 8px}
 .header #menu-login .menu-item .icon{width:22px;height:22px;flex:none}
 .header #menu-login .menu-item>span:last-child{min-width:0;white-space:normal;overflow-wrap:anywhere}
 .header #menu-login .header-credit-note{font-size:12px;line-height:1.5;margin:12px 0}
 .header #menu-login .header-signout{min-height:44px;margin-top:14px}
 .header #menu-login .guest-login-link{font-size:13px;line-height:1.5;overflow-wrap:anywhere}
}
@media(max-width:850px){
 .header .nav-shell{width:calc(100% - 24px);max-width:100%;min-width:0;display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 0}
 .header .logo{flex:0 0 auto}.header .nav-actions{min-width:0;margin-left:auto;display:flex;align-items:center;gap:4px}
 .header .mobile-toggle{display:flex;order:3;flex:0 0 34px;width:34px;height:38px;align-items:center;justify-content:center;padding:5px}
 .header .nav-main{display:none!important;order:4;width:100%;min-width:0;flex-basis:100%;gap:4px;padding:6px 0}
 .header .nav-main.open{display:flex!important;flex-wrap:wrap}
 .header .nav-main>.dropdown{flex:1 1 40%;min-width:0}
 .header .nav-main .nav-button{width:100%;min-height:42px;justify-content:flex-start;font-size:14px;padding:9px 12px}
 .header .dropdown-panel:not(#menu-login){left:12px!important;right:12px!important;width:auto!important;min-width:0!important;max-width:calc(100vw - 24px)!important;box-sizing:border-box}
 .header .login-button [data-i18n=login]{display:none}
 .header .login-button{padding:4px;min-width:34px;min-height:38px}
}
@media(max-width:580px){
 .header .logo{font-size:24px;width:130px}.header .logo svg{max-width:130px}
 .header .nav-shell{gap:5px}.header .nav-actions{gap:2px}
 .header .post-button{font-size:0;gap:0;padding:8px;min-width:36px;min-height:38px}
 .header .post-button>span:not(.icon){display:none}.header .post-button .icon{width:22px;height:22px}
 .header #menu-login.login-panel{padding:16px}
}
@media(max-width:420px){
 .header .nav-shell{width:calc(100% - 16px)}.header .logo{width:112px;font-size:22px}.header .logo svg{max-width:112px}
 .header .compact-action{width:27px!important;padding:3px}.header .compact-action .icon{width:21px;height:21px}
 .header .language-button{padding:3px}.header .cm-language-flag{width:24px;height:24px}
 .header .mobile-toggle{flex-basis:30px;width:30px}.header .nav-actions{gap:0}
 .header #menu-login.login-panel{left:10px!important;right:10px!important;width:calc(100vw - 20px)!important;max-width:calc(100vw - 20px)!important;border-radius:15px}
 .header #menu-login .header-credit-strip .button{flex-basis:100%;width:100%;margin-top:2px;min-height:42px}
}
