/* The account widget of the site bar: a log in link, or a username menu when signed in, and the log in / sign up dialog.
   Every page loads it after the shared kit styles and theme.css. account.js builds the menu and the dialog. */
.site-bar__account-button { max-width: 45vw; }
.account-items :focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.account-icon { flex: none; width: 1rem; height: 1rem; fill: currentColor; }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: relative; }
.account-menu summary { list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-items {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 100%;
  margin-top: .25rem;
  padding: .25rem 0;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 4px 12px rgb(0 0 0 / .4);
}
.account-items a, .account-items button {
  display: block;
  width: 100%;
  padding: .5rem .75rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.account-items a:hover, .account-items button:hover { background: var(--hover); }

/* Log in / sign up dialog (a native <dialog>, built by account.js on first use). */
.account-dialog {
  width: min(24rem, calc(100vw - 2rem));
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
}
.account-dialog::backdrop { background: rgb(2 6 23 / .7); }
.account-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1rem; }
.account-tabs { display: flex; gap: .25rem; }
.account-tabs button, .account-close {
  padding: .25rem .625rem;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.account-tabs button:hover, .account-close:hover { background: var(--hover); color: var(--text-strong); }
.account-tabs button[aria-selected="true"] { background: var(--hover); color: var(--text-strong); }
.account-tabs button:focus-visible, .account-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.account-form { display: grid; gap: .75rem; }
.account-form label { display: grid; gap: .25rem; color: var(--text-muted); font-size: .875rem; }
.account-form input {
  width: 100%;
  padding: .5rem;
  border: 1px solid var(--border);
  border-radius: .125rem;
  background: transparent;
  color: var(--text-strong);
  font: inherit;
}
.account-form input:focus { outline: none; border-color: var(--accent); }
.account-form .account-hint { margin: 0; color: var(--text-muted); font-size: .75rem; }
.account-form .account-submit {
  padding: .5rem .75rem;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.account-form .account-submit:disabled { opacity: .5; cursor: default; }
.account-error { margin: 0; color: var(--danger); font-size: .875rem; }
