/* The account menu (account-menu.js) in the site's top bar, with its tokens (site.css), so it follows the light and
   dark themes. Rhino Sync's server styles its copy the same way with its own tokens. */

.account-menu { position: relative; flex: none; }

.account-menu-button {
    display: flex; align-items: center; gap: 8px;
    max-width: 260px;
    min-height: 34px;
    padding: 3px 10px 3px 3px;
    font: inherit; font-weight: 600;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}
.account-menu-button:hover, .account-menu.open .account-menu-button { border-color: var(--blue); }
.account-menu-button:focus-visible, .account-menu-item:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.account-menu-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-button > svg {
    flex: none; width: 14px; height: 14px;
    fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
    color: var(--ink-3);
    transition: transform .15s;
}
.account-menu.open .account-menu-button > svg { transform: rotate(180deg); }

.account-avatar {
    flex: none;
    display: grid; place-items: center;
    width: 28px; height: 28px;
    overflow: hidden;
    font-size: 13px; font-weight: 700; line-height: 1;
    color: #fff;
    background: var(--blue);
    border-radius: 50%;
    user-select: none;
}
.account-avatar.large { width: 40px; height: 40px; font-size: 17px; }
.account-avatar.picture { background: var(--blue-wash); }
.account-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }

.account-menu-panel {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
    width: 288px; max-width: calc(100vw - 24px);
    padding: 6px;
    text-align: left;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--blue);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.account-menu-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; }
.account-menu-names { min-width: 0; }
.account-menu-name { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.account-menu-email { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }

.account-menu-facts {
    display: grid; gap: 4px;
    margin: 0 4px 6px; padding: 10px 6px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.account-menu-facts > div { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; }
.account-menu-facts dt { color: var(--ink-2); font-size: 12px; font-weight: 600; line-height: 20px; text-transform: uppercase; letter-spacing: 0.04em; }
.account-menu-facts dd { margin: 0; overflow-wrap: anywhere; }
.account-menu-facts dd.quiet { color: var(--ink-3); }

.account-menu-actions { display: flex; flex-direction: column; gap: 1px; }
.account-menu-actions hr { margin: 4px 6px; border: 0; border-top: 1px solid var(--line); }

.account-menu-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 8px 10px;
    font: inherit;
    color: var(--ink);
    text-align: left; text-decoration: none;
    background: none;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}
.account-menu-item:hover { background: var(--blue-wash); }
.account-menu-item > span { flex: 1; }
.account-menu-item svg {
    flex: none; width: 16px; height: 16px;
    fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
    color: var(--ink-2);
}
.account-menu-item svg.account-menu-external { width: 13px; height: 13px; color: var(--ink-3); }
.account-menu-sign-out, .account-menu-sign-out svg { color: var(--error); }

@media (pointer: coarse) {
    .account-menu-item { padding: 11px 10px; }
}

/* Narrow: the initial (or picture) alone */
@media (max-width: 600px) {
    .account-menu-button { padding: 3px; gap: 4px; }
    .account-menu-label, .account-menu-button > svg { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .account-menu-button > svg { transition: none; }
}
