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

.account-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    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(280px, 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;
}

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

details.account-widget {
    top: 9px;
    right: 15px;
    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;
}

.account-card .account-language-form {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.account-language-label {
    display: block;
    margin-bottom: 4px;
    color: #64748b;
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.account-language-picker {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.account-language-picker::after {
    content: '';
    position: absolute;
    right: 5px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.account-card .account-language-form select,
.welcome-languages select {
    appearance: none;
    -webkit-appearance: none;
    width: auto;
    max-width: 100%;
    min-width: 0;
    min-height: 32px;
    margin: 0;
    padding: 4px 25px 4px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.account-card .account-language-form select:focus-visible,
.welcome-languages select:focus-visible {
    outline: 2px solid #278ca7;
    outline-offset: 3px;
}

.account-card .account-logout-form {
    display: block;
    margin: 12px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}


.account-card .account-logout {
    display: inline-block;
    width: auto;
    min-width: 0;
    min-height: 30px;
    margin: 0;
    padding: 5px 12px;
    border: 0;
    border-radius: 8px;
    color: white;
    background: linear-gradient(180deg, #2489ff, #0068df);
    box-shadow: inset 0 1px 0 #ffffff50, 0 3px 8px #007aff20;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
}

.account-card .account-logout:hover {
    background: linear-gradient(180deg, #147cf0, #005dc8);
}

.account-card .account-logout:active {
    box-shadow: inset 0 2px 4px #003a8030;
}

.account-email {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.account-login-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: #111827;
}

.account-email-text {
    min-width: 0;
    overflow-wrap: anywhere;
}
