.profile-menu-toggle{font:inherit;cursor:pointer}
.profile-menu{position:fixed;z-index:1200;top:68px;right:18px;display:none;width:min(310px,calc(100vw - 20px));padding:8px;border:1px solid var(--card-border);border-radius:14px;background:var(--surface);box-shadow:0 18px 50px rgba(4,32,51,.24)}
.profile-menu.is-open{display:grid;gap:4px}
.profile-menu-identity{display:grid;grid-template-columns:42px minmax(0,1fr);align-items:center;gap:10px;padding:10px 8px 12px;border-bottom:1px solid var(--card-border)}
.profile-menu-identity .avatar{width:38px;height:38px}
.profile-menu-identity>span:last-child{display:grid;min-width:0}
.profile-menu-identity strong{overflow:hidden;color:var(--text-main);font-size:.85rem;text-overflow:ellipsis;white-space:nowrap}
.profile-menu-identity small{color:var(--text-muted);font-size:.74rem}
.profile-menu>button{display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:8px;width:100%;min-height:44px;padding:9px 10px;border-radius:9px;color:var(--text-main);text-align:left}
.profile-menu>button:hover,.profile-menu>button:focus-visible{background:var(--surface-soft);outline:2px solid var(--secondary);outline-offset:-2px}
.profile-menu>button svg{width:18px;height:18px;color:var(--secondary)}
.profile-menu>button span{font-size:.84rem;font-weight:800}
.profile-menu>button small{padding:3px 7px;border-radius:999px;background:var(--surface-soft);color:var(--text-muted);font-size:.68rem;font-weight:800}
.profile-menu>button.is-danger,.profile-menu>button.is-danger svg{color:var(--danger)}
.app-modal:has(.change-password-form){width:min(540px,100%)}
.change-password-form{display:grid;gap:14px;width:100%}
.change-password-form h2,.change-password-form p{margin:0}
.change-password-form>p{color:var(--text-muted);line-height:1.45}
.change-password-form .change-password-actions{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}

@media (max-width:640px){
  .dashboard-header{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:8px;padding:8px 12px;min-height:58px}
  .header-screen{display:grid;grid-template-columns:28px minmax(0,1fr);gap:4px;overflow:visible}
  .header-screen .mobile-toggle{width:28px;min-width:28px;height:38px;padding:0}
  .header-screen .header-screen-icon{display:none}
  .header-screen:has(.header-back-action){grid-template-columns:28px 34px minmax(0,1fr);gap:4px}
  .header-screen .header-back-action{grid-column:2;width:34px;min-width:34px}
  .header-screen .header-back-action + .header-title{grid-column:3}
  .header-title{min-width:0}
  .header-title h2{display:-webkit-box;overflow:hidden;font-size:16px;line-height:1.1;overflow-wrap:normal;word-break:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}
  .navbar-actions{position:relative;gap:0}
  .navbar-actions>.push-notification-toggle,
  .navbar-actions>.push-notification-test,
  .navbar-actions>#themeToggle,
  .navbar-actions>.header-logout{display:none!important}
  .navbar-actions>.notification-trigger{display:grid!important;width:40px;min-width:40px;height:40px}
  .header-user.user-pill.profile-menu-toggle{display:grid;width:40px;min-width:40px;height:40px;padding:0;border-radius:12px;cursor:pointer}
  .profile-menu-toggle .avatar{width:34px;height:34px;margin:auto;font-size:1rem}
  .profile-menu{position:fixed;z-index:1200;top:calc(62px + env(safe-area-inset-top));right:10px;display:none;width:min(310px,calc(100vw - 20px));padding:8px;border:1px solid var(--card-border);border-radius:14px;background:var(--surface);box-shadow:0 18px 50px rgba(4,32,51,.24)}
  .profile-menu.is-open{display:grid;gap:4px}
  .profile-menu-identity{display:grid;grid-template-columns:42px minmax(0,1fr);align-items:center;gap:10px;padding:10px 8px 12px;border-bottom:1px solid var(--card-border)}
  .profile-menu-identity .avatar{width:38px;height:38px}
  .profile-menu-identity>span:last-child{display:grid;min-width:0}
  .profile-menu-identity strong{overflow:hidden;color:var(--text-main);font-size:.85rem;text-overflow:ellipsis;white-space:nowrap}
  .profile-menu-identity small{color:var(--text-muted);font-size:.74rem}
  .profile-menu>button{display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:8px;width:100%;min-height:44px;padding:9px 10px;border-radius:9px;color:var(--text-main);text-align:left}
  .profile-menu>button:hover,.profile-menu>button:focus-visible{background:var(--surface-soft);outline:2px solid var(--secondary);outline-offset:-2px}
  .profile-menu>button svg{width:18px;height:18px;color:var(--secondary)}
  .profile-menu>button span{font-size:.84rem;font-weight:800}
  .profile-menu>button small{padding:3px 7px;border-radius:999px;background:var(--surface-soft);color:var(--text-muted);font-size:.68rem;font-weight:800}
  .profile-menu>button.is-danger,.profile-menu>button.is-danger svg{color:var(--danger)}
}

html[data-theme="dark"] .profile-menu{border-color:#29465b;background:#101e2c;box-shadow:0 18px 50px rgba(0,0,0,.5)}
html[data-theme="dark"] .profile-menu>button:hover,
html[data-theme="dark"] .profile-menu>button:focus-visible,
html[data-theme="dark"] .profile-menu>button small{background:#172b3c}

@media (orientation:landscape) and (pointer:coarse) and (max-width:991px) and (max-height:650px){
  .dashboard-header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:8px;min-height:54px;padding:6px 12px}
  .header-screen{display:grid;grid-template-columns:30px 36px minmax(0,1fr);align-items:center;gap:6px;min-width:0;overflow:hidden}
  .header-screen .mobile-toggle{display:grid;width:30px;min-width:30px;padding:0}
  .header-screen .header-screen-icon{display:none}
  .header-screen .header-back-action{display:grid;place-items:center;grid-column:2;width:36px;min-width:36px;max-width:36px;min-height:36px;padding:0;font-size:0!important}
  .header-screen .header-back-action + .header-title{grid-column:3}
  .header-title{min-width:0}
  .header-title h2{overflow:hidden;font-size:17px;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}
  .navbar-actions{position:relative;display:flex;flex:0 0 auto;gap:5px;min-width:0}
  .navbar-actions>.push-notification-toggle,.navbar-actions>.push-notification-test,.navbar-actions>#themeToggle,.navbar-actions>.header-logout{display:none!important}
  .navbar-actions>.notification-trigger{display:grid!important;width:38px;min-width:38px;height:38px}
  .header-user.user-pill.profile-menu-toggle{display:grid;width:38px;min-width:38px;height:38px;padding:0;border-radius:12px;cursor:pointer}
  .profile-menu-toggle .user-info{display:none}
  .profile-menu-toggle .avatar{width:32px;height:32px;margin:auto;font-size:1rem}
  .profile-menu{position:fixed;z-index:1200;top:58px;right:10px;display:none;width:min(310px,calc(100vw - 20px));padding:8px;border:1px solid var(--card-border);border-radius:14px;background:var(--surface);box-shadow:0 18px 50px rgba(4,32,51,.24)}
  .profile-menu.is-open{display:grid;gap:4px}
}
