/* Icons in the member navigation: icon + label (labels are never removed). Loads after the older header
   rules and the bar so the layout tweaks below win at equal specificity. */
.member-nav__links > a:not(.member-nav__quick-add) {
  gap: 0.45rem;
}

.member-nav__links > a .icon {
  width: 1.1rem;
  height: 1.1rem;
  vertical-align: baseline;
}

/* Quick add's plus icon; the words are a span beside it (hidden in the narrower bar steps). Sized in rem. */
/* Step 1 of the bar's collapse (member_bar.css): below 62rem the page links drop their icons and keep their labels.
   Below 56rem Quick add is icon only. The account icon stays until the very last step. */
@media screen and (max-width: 61.99rem) {
  .member-shell .member-nav__links > a:not(.member-nav__quick-add) .icon {
    display: none;
  }
}

/* Touch targets: below 1100px (or on any touch screen) every item in the bar has a 44px tall hit area. The items stay
   34px tall to look at; an invisible 5px of reach above and below them (inside the 46px box, so nothing overlaps its
   neighbours or leaves the box) makes up the rest. */
@media screen and (max-width: 68.74rem), screen and (pointer: coarse) {
  .member-shell .member-nav__links > a,
  .member-shell .member-nav__profile > summary {
    position: relative;
  }

  .member-shell .member-nav__links > a::before,
  .member-shell .member-nav__profile > summary::before {
    content: "";
    position: absolute;
    inset: -5px 0;
  }

  .member-shell .member-nav__profile > summary::before {
    inset: -6px -1px;
  }
}

.member-nav__profile summary {
  gap: 0.45rem;
}

/* The account menu's own colours. On the light/dark page surface it follows the theme; in the member bar
   (member_bar.css) it is a dark raised panel. The Appearance row reads these too. */
.member-nav__profile-menu {
  --menu-ink: var(--ink);
  --menu-muted: var(--muted);
  --menu-rule: var(--rule);
  --menu-edge: var(--hairline);
  --menu-hover: var(--tint);
  --menu-selected: var(--tint);
  --menu-focus: var(--focus-ring);
}

/* Sign out sits below a divider, after Profile & settings and the Appearance row. */
.member-nav__profile-menu form {
  margin: 0.25rem 0 0;
  padding-top: 0.25rem;
  border-top: 1px solid var(--menu-rule);
}

.member-nav__profile-menu a,
.member-nav__sign-out {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.member-nav__profile-menu .icon {
  width: 1.15rem;
  height: 1.15rem;
}

/* The menu repeats page links only when the bar has folded them away. */
.member-shell .member-nav__profile-menu .member-nav__mobile-link {
  display: none !important;
}

@media (max-width: 19.99rem) {
  .member-shell .member-nav__profile-menu .member-nav__mobile-link {
    display: flex !important;
  }
}

/* Earned items. Next up always keeps its calendar (it is the item's whole face on a phone). The group item and the groups
   menu drop their people icon with the other links, and get it back when the name goes (narrowest phones). */
.member-shell .member-nav__links > a.member-nav__next-up .icon {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
}

@media screen and (max-width: 61.99rem) {
  .member-shell .member-nav__libraries-summary .icon { display: none; }
}

@media screen and (max-width: 23.99rem) {
  .member-shell .member-nav__links > a.member-nav__group .icon,
  .member-shell .member-nav__libraries-summary .icon {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
  }
}
