.sidebar-bottom {
    position: relative;
    gap: 10px;
}

.sidebar nav .portal-site-link {
    margin-top: 10px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    border-radius: 0 0 9px 9px;
}

.account-menu {
    min-width: 0;
    flex: 1;
}

.account-menu summary {
    min-width: 0;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    list-style: none;
    border-radius: 10px;
    outline: none;
}

.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary::marker { content: ""; }

.account-menu summary:focus-visible {
    box-shadow: 0 0 0 2px var(--orange);
}

.account-menu .user-dot,
.account-menu .user-photo {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    display: grid;
    place-items: center;
    border: 2px solid rgba(255,255,255,.82);
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
}

.account-menu .user-dot {
    color: #fff;
    background: linear-gradient(145deg, #ff9b4a, #9b420d 62%, #202a3a);
}

.profile-photo-field {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
    padding: 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 11px;
}

.profile-photo-preview {
    width: 86px;
    height: 86px;
    flex: 0 0 86px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(145deg, #ff9b4a, #9b420d 62%, #202a3a);
    border: 3px solid rgba(255,255,255,.75);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    font: 700 24px Outfit, sans-serif;
}

.profile-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo-controls { min-width: 0; }
.profile-photo-controls strong { display: block; margin-bottom: 5px; }
.profile-photo-controls small { display: block; color: var(--muted); margin: 7px 0 12px; }
.profile-photo-controls input[type="file"] { max-width: 100%; padding: 8px; font-size: 12px; }

.account-identity { min-width: 0; }
.account-identity strong,
.account-identity small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-chevron {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    color: #b5c0d0;
    border: 1px solid #344155;
    border-radius: 7px;
    transition: transform .2s ease, border-color .2s ease, color .2s ease;
}

.account-menu[open] .account-chevron {
    transform: rotate(180deg);
    color: var(--orange2);
    border-color: rgba(255,155,74,.55);
}

.account-popover {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 11px);
    z-index: 30;
    padding: 8px;
    background: #101b2c;
    border: 1px solid #344761;
    border-radius: 11px;
    box-shadow: 0 14px 35px rgba(0,0,0,.42);
    transform-origin: bottom center;
    animation: account-popover-in .18s ease-out;
}

.account-popover a,
.account-popover button {
    width: 100%;
    min-height: 42px;
    padding: 10px 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e5eaf2;
    background: transparent;
    border: 0;
    border-radius: 8px;
    font: 600 13px 'DM Sans', sans-serif;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.account-popover a:hover,
.account-popover button:hover {
    color: #fff;
    background: rgba(255,255,255,.07);
}

.account-popover a span,
.account-popover button span {
    width: 17px;
    color: #afc8ec;
    text-align: center;
}

.account-popover form {
    margin-top: 5px;
    padding-top: 6px;
    border-top: 1px solid #304058;
}

.account-popover form button { color: #ffd4b4; }
.account-popover form button span { color: var(--orange2); }

@keyframes account-popover-in {
    from { opacity: 0; transform: translateY(7px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 650px) {
    .sidebar-bottom { padding-inline: 0; }
    .sidebar-bottom .notif-bell { display: none; }
    .account-menu summary { display: flex; justify-content: center; }
    .account-identity,
    .account-chevron { display: none; }
    .account-popover {
        position: fixed;
        left: 72px;
        right: auto;
        bottom: 16px;
        width: 205px;
    }
    .profile-photo-field { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    .account-popover { animation: none; }
}
