/* @group User Bar */

#user_bar {
  z-index: var(--ui-layer-user-bar);
  display: flex;
  flex-flow: row nowrap;
  place-content: stretch center;
  align-items: center;
  box-sizing: border-box;
  height: 48px;
  -webkit-user-select: none;
  user-select: none;
}

#user_bar .user,
#user_bar .account,
#user_bar .log_out {
  display: flex;
  flex-flow: row nowrap;
  place-content: stretch center;
  align-items: center;
  height: 48px;
  padding-inline-end: var(--ui-space-2);
  padding-inline-start: var(--ui-space-2);
  color: var(--color-header-text);
}

#user_bar .icon img {
  display: block;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  border: 2px solid var(--color-header-text);
  cursor: pointer;
}

@media (width >= 0) and (width <= 767px) {
  #user_bar .account {
    display: none;
  }
}

/* The account control is a bar item, as a navigation tab is: the header's
   full height. Its list then hangs from the header's bottom edge in the
   header's ink, with the navigation menus' rows (RULES §10.10). */
#user_bar .account {
  padding-inline: 0;
}

#user_bar .account select {
  --list-surface: var(--color-header-background);
  --list-text: var(--color-nav-text);
  --list-text-current: var(--color-header-text);
  --list-edge: var(--color-header-raised);
  --list-highlight: var(--color-header-raised);
  --list-highlight-text: var(--color-header-text);
  --list-shadow: var(--shadow-menu);
  --list-offset: 0;

  height: 100%;
  margin: 0;
  padding-block: 0;
  padding-inline: var(--ui-space-4) var(--ui-space-8);
  color: var(--color-header-text);
  font-size: var(--ui-font-size-label);
  background-color: var(--color-header-background);
  background-image: var(--select-icon-header);
  background-position: right var(--ui-space-4) center;
  background-repeat: no-repeat;
  background-size: 9px 9px;
  border-style: none;
  border-radius: 0;
  cursor: pointer;
  transition: background-color var(--ui-duration-feedback) var(--ui-ease-feedback);
}

@media (any-hover: hover) {
  #user_bar .account select:hover {
    background-color: var(--color-header-raised);
  }
}

#user_bar .account select:focus-visible {
  outline: 2px solid var(--color-header-text);
  outline-offset: -2px;
}

/* Open, the control and its list are one surface, joined at the header's
   edge. Behind @supports: an engine without :open or ::picker skips them. */
@supports selector(:open) {
  #user_bar .account select:open {
    background-color: var(--list-surface);
  }
}

@supports (appearance: base-select) {
  #user_bar .account select::picker(select) {
    max-height: min(calc(100dvh - 48px - var(--ui-space-4)), calc(var(--list-row) * 16.5 + 2 * var(--ui-space-1)));
    border-block-start: 0;
    border-radius: 0 0 var(--ui-radius-surface) var(--ui-radius-surface);
  }
}

#user_bar .log_out {
  z-index: var(--ui-layer-user-bar);
  -webkit-user-select: none;
  user-select: none;
}

#user_bar .log_out a {
  position: relative;
  display: block;
  width: var(--ui-touch-target);
  height: var(--ui-touch-target);
  overflow: hidden;
  text-indent: 100%;
  white-space: nowrap;

}

/* @end */


#open_user_details {
  display: flex;
  justify-content: center;
  align-items: center;
  width: var(--ui-touch-target);
  height: var(--ui-touch-target);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--ui-radius-control);
  cursor: pointer;
}
#open_user_details:focus-visible,
#user_bar .log_out a:focus-visible {
  outline: 2px solid var(--color-header-text);
  outline-offset: -2px;
}

#user_bar .log_out a::before {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--color-header-text);
  font: var(--ui-icon-weight) var(--ui-icon-size-large)/1 var(--ui-icon-font-family);
  text-indent: 0;
  content: var(--ui-icon-arrow-right-from-bracket) var(--ui-icon-alt,);
}
