.account-tools {
    position: relative;
    display: block;
    font-size: 14px;
}

.account-tools-wrap.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 0 1 auto;
}

.account-tools-wrap > .account-tools { flex: 0 0 44px; }
.topbar .account-tools-employee {
    display: block;
    min-width: 0;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #d7e4eb;
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 767px) {
    .account-tools-wrap.user-menu { gap: 6px; }
    .topbar .account-tools-employee { max-width: clamp(52px, 18vw, 90px); font-size: 12px; }
    .topbar > .brand { min-width: 0; flex: 1 1 0; }
    .topbar > .brand > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

.account-tools > .account-tools-trigger {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: 11px;
    color: #fff;
    background: rgb(255 255 255 / 7%);
    cursor: pointer;
    list-style: none;
}

.account-tools-trigger::-webkit-details-marker { display: none; }
.account-tools-trigger::marker { content: ''; }
.account-tools[open] > .account-tools-trigger,
.account-tools-trigger:hover { background: rgb(255 255 255 / 16%); }

.account-tools-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.account-tools-panel {
    position: absolute;
    inset-block-start: calc(100% + 8px);
    inset-inline-end: 0;
    z-index: 70;
    width: min(19rem, calc(100vw - 24px));
    max-height: 75vh;
    max-height: 75dvh;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: 0 16px 36px rgb(16 42 59 / 20%);
}

.account-tools:not([open]) > .account-tools-panel,
.account-tools [hidden] { display: none; }

.account-tools-name {
    margin: 0;
    padding: 5px 9px 10px;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.account-tools-action {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 8px 9px;
    border: 0;
    border-radius: 8px;
    color: var(--primary-dark);
    background: transparent;
    font-weight: 600;
    text-align: start;
}

.account-tools-action:hover { background: var(--surface-soft); }
.account-tools-trigger:focus-visible { outline: 3px solid #74d3f1; outline-offset: 2px; }
.account-tools-action:focus-visible,
.account-tools-choice:focus-within { outline: 2px solid var(--primary); outline-offset: 1px; }

.account-tools-hint {
    margin: 3px 9px 9px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.account-tools-installed { color: var(--success); }

.account-tools-layout {
    min-width: 0;
    margin: 10px 0;
    padding: 5px 8px 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
}

.account-tools-layout legend { padding-inline: 4px; font-weight: 600; }
.account-tools-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.account-tools-choice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 5px 7px;
    border-radius: 7px;
    background: var(--surface-soft);
    cursor: pointer;
}

.account-tools-choice input { margin: 0; accent-color: var(--primary); }
.account-tools-logout { margin: 0; padding-top: 6px; border-top: 1px solid var(--line); }
.account-tools-logout .account-tools-action { color: #9e3037; }
