/* ============================================================
   User Account menu (topbar entry: avatar + username)
   Colours come from the shared design tokens only — no literal
   colour values, so a token re-skin stays consistent.
   ============================================================ */

    #acct {
        position: relative;
        margin-left: auto;
        display: flex;
        align-items: center;
        flex: 0 0 auto
    }

    .acct-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        max-width: 190px;
        min-height: 40px;
        padding: 4px 10px 4px 4px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: var(--surface);
        color: var(--ink);
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        line-height: 1;
        cursor: pointer;
        transition: background var(--t-base) ease, border-color var(--t-base) ease
    }

    .acct-btn:hover {
        background: var(--surface-2);
        border-color: var(--line-strong)
    }

    .acct-btn:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px
    }

    .acct-avatar {
        position: relative;
        width: 28px;
        height: 28px;
        flex: 0 0 28px;
        border-radius: 50%;
        background: var(--accent-soft);
        color: var(--accent);
        display: inline-flex;
        align-items: center;
        justify-content: center
    }

    .acct-avatar svg {
        width: 17px;
        height: 17px
    }

    /* the dot says "keywords are set" — the old Preferences icon carried it */
    .acct-btn.has-profile .acct-avatar::after {
        content: "";
        position: absolute;
        top: -1px;
        right: -1px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: var(--accent);
        border: 2px solid var(--surface)
    }

    .acct-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100px
    }

    .acct-caret {
        width: 12px;
        height: 12px;
        flex: 0 0 12px;
        color: var(--muted-strong)
    }

    /* ---------------- dropdown ---------------- */

    .acct-menu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        z-index: 60;
        min-width: 200px;
        padding: 6px;
        display: flex;
        flex-direction: column;
        gap: 2px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--r-md);
        box-shadow: var(--sh-2)
    }

    /* `hidden` must win over the flex layout above */
    .acct-menu[hidden] {
        display: none
    }

    .acct-item {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 10px 12px;
        border: 0;
        border-radius: var(--r-sm);
        background: transparent;
        color: var(--ink);
        font-family: inherit;
        font-size: 14px;
        font-weight: 500;
        text-align: left;
        cursor: pointer
    }

    .acct-item:hover {
        background: var(--surface-2)
    }

    .acct-item:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: -2px
    }

    .acct-item-ico {
        width: 18px;
        height: 18px;
        flex: 0 0 18px;
        color: var(--muted-strong)
    }

    .acct-item-label {
        flex: 1
    }

    /* ---------------- narrow screens ---------------- */

    @media (max-width:420px) {
        .acct-name {
            max-width: 62px
        }

        .acct-btn {
            max-width: 140px
        }

        .acct-menu {
            min-width: 176px
        }
    }
