.account-widget {
    position: fixed;
    top: 14px;
    right: 18px;
    z-index: 1000;
}

.account-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .95);
    border-radius: 50%;
    background: #e7eef9;
    color: #345581;
    cursor: pointer;
    list-style: none;
    box-sizing: border-box;
    box-shadow: 0 3px 12px rgba(30, 50, 80, .18);
}

.account-avatar::-webkit-details-marker {
    display: none;
}

.account-avatar:focus-visible {
    outline: 3px solid #74a9ef;
    outline-offset: 3px;
}

.account-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-initials {
    font-size: 13px;
    font-weight: 600;
}

.account-card {
    position: absolute;
    top: 52px;
    right: 0;
    width: min(340px, calc(100vw - 32px));
    max-height: calc(100dvh - 90px);
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    border: 1px solid rgba(120, 140, 170, .18);
    border-radius: 18px;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(18px);
    color: #334155;
    box-shadow: 0 10px 35px rgba(30, 50, 80, .16);
    font-size: 12px;
    line-height: 1.5;
}

.account-identity,
.account-access {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-wrap: anywhere;
}

.account-identity strong {
    font-size: 14px;
}

.account-identity > span,
.account-access > span {
    color: #64748b;
}

.account-section {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e8edf3;
}

.account-label {
    color: #64748b;
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.account-section p {
    margin: 6px 0;
}

.account-access {
    margin-top: 10px;
}

.account-card .account-logout {
    width: 100%;
    margin-top: 18px;
    padding: 9px 12px;
    border: 1px solid #dce5f0;
    border-radius: 10px;
    background: #f1f5fb;
    color: #365b8b;
    font-size: 12px;
    cursor: pointer;
}

/* Reserva espaço para que o avatar não cubra o cabeçalho. */
.workspace .topbar {
    padding-right: 82px;
}

details.account-widget {
    top: 6px;
    right: 12px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.account-widget > summary.account-avatar {
    margin: 0;
    border: none;
    border-radius: 50%;
    background: #e7eef9;
    box-shadow: 0 2px 8px rgba(30, 50, 80, .15);
}

.account-avatar img[hidden] {
    display: none;
}
