.app-header{display:flex;justify-content:space-between;gap:12px}
.app-header .app-brand{margin:0}
.app-header .header-actions{display:flex;align-items:center;gap:8px;flex:none}
.app-header .menu-btn{margin:0;border-radius:10px}
.app-header .square{border-radius:10px}
.app-header .app-menu{left:auto;right:max(40px,env(safe-area-inset-right,0px));border-radius:12px}
.app-menu .sync-state span{display:inline}
@media(max-width:1050px){.app-header .app-menu{right:max(24px,env(safe-area-inset-right,0px))}}
@media(max-width:700px){.app-header .app-menu{right:var(--gutter-r)}}

/* Drive mobile header: safe area is added once, including standalone windows. */
@media(max-width:420px){
 body:not(.auth-shell){--gutter-l:calc(16px + env(safe-area-inset-left,0px));--gutter-r:calc(16px + env(safe-area-inset-right,0px));padding-top:calc(env(safe-area-inset-top,0px) + 24px)}
 body:not(.auth-shell)>.app-header{--mobile-tool-edge:#b7b7b7;min-height:0;padding:0 var(--gutter-r) 20px var(--gutter-l);border-bottom:0;gap:12px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}
 body:not(.auth-shell)>.app-header .app-brand{flex:1;min-width:0;gap:12px;height:44px}
 body:not(.auth-shell)>.app-header .app-brand h1{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:20px;font-weight:700;letter-spacing:-.6px;line-height:1.15}
 body:not(.auth-shell)>.app-header .header-actions{gap:10px}
 body:not(.auth-shell)>.app-header :is(.square,.menu-btn){width:44px;height:44px;padding:0;margin:0;border:1px solid var(--mobile-tool-edge);border-radius:12px;background:var(--panel)}
 :root[data-theme=dark] body:not(.auth-shell)>.app-header{--mobile-tool-edge:#555}
}
@media(max-width:420px) and (prefers-color-scheme:dark){:root:not([data-theme=light]) body:not(.auth-shell)>.app-header{--mobile-tool-edge:#555}}
