.site-header,
.account-page .site-header {
    box-sizing: border-box;
    width: calc(100% - 48px);
    max-width: 1200px;
    min-width: 0;
    margin: 0 auto;
    padding: 28px 0 18px;
    gap: 28px;
}
.site-header .logo,
.account-page .site-header .logo {
    width: 175px;
    flex: 0 0 175px;
    margin: 0;
}
.site-header .logo img,
.account-page .site-header .logo img { display: block; width: 100%; margin: 0; }
.site-header #user-panel,
.account-page .site-header #user-panel {
    display: flex;
    flex: 1 1 auto;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    position: relative;
    z-index: 10;
}
#user-panel .user-menu {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 22px;
    min-width: 0;
    max-width: 100%;
    padding: 8px 12px;
    border: 1px solid #dabc9e;
    border-radius: 12px;
    background: #fff6e9;
    box-shadow: 0 3px 12px #2d24240a;
}
#user-panel .user-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 240px;
    min-height: 44px;
    border-radius: 5px;
    color: #2d2424;
    text-decoration: none;
}
#user-panel .user-photo {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: 1px solid #b88660;
    border-radius: 50%;
    object-fit: cover;
    background: #fbe9d1;
    color: #5b3827;
}
#user-panel .user-initials { font-size: 13px; font-weight: 700; }
#user-panel .user-info {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #2d2424;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    user-select: text;
    -webkit-user-select: text;
}
#user-panel .user-identity:hover .user-info { text-decoration: underline; text-underline-offset: 4px; }
#user-panel .user-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding-left: 22px;
    border-left: 1px solid #b88c6970;
}
#user-panel .user-actions:only-child { padding: 0; border: 0; }
#user-panel .user-account-link,
#user-panel .btn-admin,
#user-panel .btn-logout,
#user-panel .btn-login {
    box-sizing: border-box;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    padding: 10px 11px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #533624;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
#user-panel .user-account-link:hover,
#user-panel .btn-admin:hover,
#user-panel .btn-logout:hover,
#user-panel .btn-login:hover {
    background: #fff4e5;
    color: #2d2424;
}
#user-panel .user-account-link:active,
#user-panel .btn-admin:active,
#user-panel .btn-logout:active,
#user-panel .btn-login:active { background: #eed1b0; }
#user-panel .logout-form { display: inline-flex; margin: 0; }
#user-panel .btn-logout,
#user-panel .btn-login { color: #75513c; font-weight: 500; }
#user-panel .user-access-note { padding: 10px 0; color: #63402d; font-size: 12px; font-weight: 600; }
.site-header .logo:focus-visible,
#user-panel :focus-visible { outline: 3px solid #895135; outline-offset: 4px; }
@media only screen and (max-width: 820px) {
    .site-header,
    .account-page .site-header { gap: 24px; padding: 24px 0 16px; }
    .site-header .logo,
    .account-page .site-header .logo { width: 150px; flex-basis: 150px; margin: 0; }
    #user-panel .user-menu { flex-direction: column; align-items: flex-end; gap: 8px; }
    #user-panel .user-identity { max-width: 100%; }
    #user-panel .user-actions { padding: 4px 0 0; border-left: 0; border-top: 1px solid #b88c6970; }
}
@media only screen and (max-width: 540px) {
    .site-header,
    .account-page .site-header {
        width: calc(100% - 32px);
        flex-direction: column;
        gap: 18px;
        padding: 24px 0 8px;
    }
    .site-header .logo,
    .account-page .site-header .logo { flex: 0 0 auto; }
    .site-header #user-panel,
    .account-page .site-header #user-panel { width: 100%; justify-content: center; margin: 0; }
    #user-panel .user-menu { width: 100%; align-items: center; gap: 9px; padding: 10px 12px; }
    #user-panel .user-identity { max-width: 100%; }
    #user-panel .user-actions { justify-content: center; gap: 5px; }
    #user-panel .user-account-link,
    #user-panel .btn-admin,
    #user-panel .btn-logout,
    #user-panel .btn-login { padding-right: 12px; padding-left: 12px; }
}
@media only screen and (max-width: 380px) {
    #user-panel .user-menu { padding-right: 8px; padding-left: 8px; }
    #user-panel .user-actions { gap: 4px; }
    #user-panel .user-account-link,
    #user-panel .btn-admin,
    #user-panel .btn-logout,
    #user-panel .btn-login { padding-right: 8px; padding-left: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    #user-panel .user-account-link,
    #user-panel .btn-admin,
    #user-panel .btn-logout,
    #user-panel .btn-login { transition: none; }
}
