/* 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. */
.member-nav__quick-add .icon {
  width: 1.1rem;
  height: 1.1rem;
}

/* The older phone rules draw a "+" glyph after the link; the plus is the icon now. */
.member-shell .member-nav__quick-add::after {
  content: none;
}

.member-nav__quick-add-label {
  white-space: nowrap;
}

/* 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;
  }
}

@media screen and (max-width: 55.99rem) {
  .member-shell .member-nav__quick-add-label {
    display: none;
  }

  .member-shell .member-nav__quick-add .icon {
    width: 1.25rem;
    height: 1.25rem;
  }
}

/* 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;
  }

  /* The bordered items (Quick add, and the menu button in the hamburger step) measure from inside their 1px border. */
  .member-shell .member-nav__links > a.member-nav__quick-add::before,
  .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 the page links only when the bar has folded them away (below 20rem, the last step of the bar's ladder in
   member_bar.css), and Quick add only when it has left the bar (below 30rem, or in that same last step). Otherwise they are not
   shown (the older rules force their display, so this states it with more weight). */
.member-shell .member-nav__profile-menu .member-nav__mobile-link {
  display: none !important;
}

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

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