@layer components {
  /* The menu of the sidebar's foot: open above it on the desktop, loose rows on the phone's Vous screen. */
  .sidebar-foot { position: relative; }
  .profile-menu { display: none; }
  .sidebar-foot[data-open] .profile-menu {
    position: absolute; z-index: 20; left: 8px; right: 8px; bottom: calc(100% + 4px);
    display: flex; flex-direction: column; gap: 2px; padding: 6px;
    background: var(--popover); color: var(--popover-foreground);
    border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm);
  }
  .profile-menu form { margin: 0; display: block; }
  .profile-menu-item {
    width: 100%; min-height: 36px; align-items: center; gap: 10px; padding: 6px 10px;
    border: 0; border-radius: 8px; background: transparent; color: inherit;
    font: inherit; text-align: start; text-decoration: none; cursor: pointer;
  }
  /* Not the install entry: .install-when keeps it hidden until the page knows the app can be installed. */
  .profile-menu-item:not(.install-when) { display: flex; }
  .profile-menu-item svg { flex: none; width: 18px; height: 18px; color: var(--muted-foreground); }
  .profile-menu-item:is(:hover, :active), .profile-menu-item[aria-current="page"] {
    background: var(--sidebar-accent); text-decoration: none;
  }
  .profile-menu-item:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--jx-accent); }
  .profile-menu-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .profile-menu-label { font-weight: 600; }
  .profile-menu-hint { font-size: 13px; color: var(--muted-foreground); }
  .profile-menu-install { background: var(--jx-accent-soft); }
  .profile-menu-install:is(:hover, :active) { background: var(--sidebar-accent); }
  .profile-menu-install svg { color: var(--jx-accent); }
  .profile-menu-sep { height: 1px; margin: 4px 6px; border: 0; background: var(--border); }
  /* The theme row sits in the menu as a label and its choices; the menu stays open as one is picked. */
  .profile-menu-theme { display: flex; justify-content: space-between; cursor: default; }
  .profile-menu-theme:is(:hover, :active) { background: transparent; }
  .profile-menu-theme .profile-menu-label { font-weight: 400; }
  .profile-menu-releases .release-new { margin-left: auto; }

  /* Only above the phone layout: below it the card at the top of Vous does this job, a second entry would double it. */
  @media (min-width: 1100px) {
    html[data-install] .profile-menu-install:not([hidden]) { display: flex; }
  }

  /* The phone's Vous screen keeps the sign-out button; the other entries belong to the desktop menu. */
  @media (max-width: 1099px) {
    .profile-menu, .sidebar-foot[data-open] .profile-menu { display: contents; position: static; }
    .profile-menu :is(.profile-menu-install, [data-testid=profile-menu-profile], .profile-menu-theme, .profile-menu-releases,
                      .profile-menu-sep) { display: none; }
    .sidebar-sign-out {
      padding-block: 0; border: 1px solid var(--border); border-radius: var(--radius-md);
      font-weight: 500; line-height: 1; text-align: center;
    }
    .sidebar-sign-out svg { width: 16px; height: 16px; color: inherit; }
    .sidebar-sign-out:is(:hover, :active) { background: var(--accent); color: var(--accent-foreground); }
  }

  @media (pointer: coarse) {
    .profile-menu-item { min-height: var(--tap); position: relative; }
  }
}
