/* The account chip shared by the application and the administration.

   One definition in one place: both shells only add the placement around it. Colours and the name
   width come from tokens.css. */
.account-chip {
  display: inline-flex; align-items: center; gap: .5rem; padding: .2rem .75rem .2rem .2rem;
  color: var(--text); background: var(--background); border: 1px solid var(--line); border-radius: var(--radius-pill);
  text-decoration: none; transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.account-chip::after { content: "▾"; color: var(--muted); font-size: .75rem; }
.account-chip:hover, .account-chip:focus-visible {
  color: var(--accent-dark); background: var(--accent-soft); border-color: var(--accent);
}
.account-chip .avatar {
  flex: none; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-size: .8rem; font-weight: 600;
}
.account-chip .name { max-width: var(--user-name-max); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The chip is also the handle of a menu: profile and logout are one tap below it. */
.account { position: relative; }
.account > .account-chip { cursor: pointer; list-style: none; }
.account > .account-chip::-webkit-details-marker { display: none; }
.account[open] > .account-chip { color: var(--accent-dark); background: var(--accent-soft); border-color: var(--accent); }
.account[open] > .account-chip::after { content: "▴"; }
.account .menu {
  position: absolute; right: 0; top: calc(100% + .35rem); z-index: 20; min-width: 11rem; padding: .3rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-menu);
}
.account .menu form { margin: 0; }
.account .menu-item {
  box-sizing: border-box;  /* the application sets it globally, the administration does not */
  display: block; width: 100%; padding: .5rem .7rem; border: 0; border-radius: var(--radius-small);
  background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.account .menu-item:hover, .account .menu-item:focus-visible { color: var(--accent-dark); background: var(--accent-soft); }
