/* The email menu (Adam, 2026-11-06). It wears the host app's look: each app passes its own button and menu classes
   (account.js) or styles .acct-btn and .acct-menu in its own stylesheet. The looks here sit inside :where(), so they
   weigh no more than a bare element (button, a), so any class an app passes or writes wins, while a page's own plain
   link color doesn't leak in. They're only a fallback built from the app's tokens. Layout stays here. */
.acct-btn { display: inline-flex; align-items: center; gap: var(--space-2xs, 6px); cursor: pointer; }
.acct-btn .acct-email { max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-btn .acct-chev { width: 14px; height: 14px; flex: none; }
.acct-btn .acct-icon { display: none; width: 18px; height: 18px; flex: none; }
button:where(.acct-btn) { min-height: 36px; padding: 0 var(--space-xs, 10px); border: var(--border, 1px) solid transparent; border-radius: var(--r, 8px); background: transparent; color: var(--ink-2); font: inherit; }
:where(.acct-btn[aria-expanded="true"]) { color: var(--ink); }
:where(.acct-btn:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { :where(.acct-btn:hover) { color: var(--ink); } }

.acct-menu { position: fixed; inset: auto; margin: 0; }
:where(.acct-menu) { min-width: 14rem; padding: var(--space-3xs, 4px); background: var(--surface-3, var(--surface-2)); color: var(--ink); border: var(--border, 1px) solid var(--edge, var(--line)); border-radius: var(--r, 8px); box-shadow: var(--shadow-2, 0 16px 40px rgb(0 0 0 / 0.4)); font-size: var(--fs-ui, 0.9375rem); }
:where(.acct-menu:popover-open) { animation: acct-in var(--dur-fast, 120ms) ease-out; transform-origin: top right; }
@keyframes acct-in { from { opacity: 0; transform: scale(0.97) translateY(-4px); } }
.acct-item { display: flex; align-items: center; gap: var(--space-2xs, 8px); white-space: nowrap; text-decoration: none; }
.acct-item svg { width: 16px; height: 16px; flex: none; color: var(--ink-2); }
a:where(.acct-item) { min-height: calc(var(--tap, 44px) - 4px); padding-inline: var(--space-2xs, 8px); border-radius: var(--r-inner, 4px); color: var(--ink); }
:where(.acct-item:focus-visible) { outline: none; background: var(--lit, var(--surface-2)); }
@media (hover: hover) and (pointer: fine) { :where(.acct-item:hover) { background: var(--lit, var(--surface-2)); } }
button:where(.acct-item) { inline-size: 100%; min-height: calc(var(--tap, 44px) - 4px); padding-inline: var(--space-2xs, 8px); border: 0; border-radius: var(--r-inner, 4px); background: transparent; color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.acct-sub { margin-left: auto; padding-left: var(--space-xs, 12px); max-width: 16ch; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
/* Display Name, open: the field and Save in the item's place. */
.acct-name { display: flex; gap: var(--space-3xs, 4px); padding: var(--space-3xs, 4px); }
.acct-name[hidden], .acct-note[hidden] { display: none; }
.acct-name input { flex: 1; min-width: 0; min-height: 36px; padding: 0 var(--space-2xs, 8px); border: var(--border, 1px) solid var(--edge, var(--line)); border-radius: var(--r-inner, 4px); background: var(--surface, transparent); color: var(--ink); font: inherit; }
.acct-name input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
:where(.acct-save) { min-height: 36px; padding: 0 var(--space-xs, 12px); border: 0; border-radius: var(--r-inner, 4px); background: var(--accent, var(--ink)); color: var(--accent-ink, var(--surface)); font: inherit; font-weight: var(--w-strong); cursor: pointer; }
.acct-note { margin: 0; padding: 0 var(--space-2xs, 8px) var(--space-3xs, 4px); color: var(--danger, var(--ink-2)); font-size: var(--fs-small, 0.8125rem); white-space: normal; }
.acct-tag { margin-left: auto; padding: 1px 6px; border-radius: var(--r-inner, 4px); background: var(--accent, var(--ink)); color: var(--accent-ink, var(--surface)); font-size: var(--fs-badge, 0.6875rem); font-weight: var(--w-strong); }
.acct-rule { border: 0; border-top: var(--border, 1px) solid var(--line); margin: var(--space-3xs, 4px) calc(-1 * var(--space-3xs, 4px)); }
@media (prefers-reduced-motion: reduce) { .acct-menu:popover-open { animation: none; } }
/* Phone: the button keeps only the person icon, square like the theme toggle beside it. */
@media (max-width: 40rem) {
  .acct-btn .acct-email, .acct-btn .acct-chev { display: none; }
  .acct-btn .acct-icon { display: block; }
  .acct-btn.acct-btn { justify-content: center; min-width: 36px; padding-inline: var(--space-2xs, 8px); }
}

/* A round person button (compact: true), for headers with no room for the email; the email is its tooltip and label. */
/* It wears the theme toggle's circle beside it (theme-toggle.css), so the two read as a pair. */
.acct-btn.acct-compact { inline-size: 36px; block-size: 36px; min-width: 0; min-height: 0; padding: 0; justify-content: center; border: 1px solid color-mix(in srgb, currentColor 28%, transparent); border-radius: 50%; background: transparent; color: inherit; opacity: 0.86; }
@media (hover: hover) and (pointer: fine) { .acct-btn.acct-compact:hover { opacity: 1; border-color: color-mix(in srgb, currentColor 55%, transparent); } }
@media (pointer: coarse) { .acct-btn.acct-compact { inline-size: 44px; block-size: 44px; } }
.acct-btn.acct-compact .acct-email, .acct-btn.acct-compact .acct-chev { display: none; }
.acct-btn.acct-compact .acct-icon { display: block; }
