/* The nav-rail user menu (not drawn in the design; built from .card, .divider, .toggle and .btn). */
.app-nav-user {
  position: relative;
}

.app-user-menu {
  position: absolute;
  bottom: calc(100% + var(--space-1));
  left: var(--space-2);
  right: var(--space-2);
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: var(--pad-1) 0;
  box-shadow: var(--shadow-3);
}

.app-user-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--pad-row);
  font-size: var(--text-table);
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-user-menu-action {
  width: 100%;
}

/* A flash notice ("Password changed.") shows as a toast at the bottom of the main column. */
.app-flash {
  position: fixed;
  bottom: var(--space-5);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
}

/* At 1280 px and below (80em of the frame), the nav rail is icon-only (DESIGN_HANDOFF › Global; part 5 §4): 56 px
   wide (the control height plus its padding), labels visually hidden but still read out, each entry's label as its
   tooltip, and a draft count as its dot. A container query on the app frame, so the rail drawn alone (the Nav
   board) keeps its full width. The inline indent padding is design markup, hence !important. */
@container app (max-width: 80em) {
  .app-nav {
    --app-nav-w: calc(var(--control-h) + var(--pad-6));
  }

  .app-nav .app-nav-text {
    position: absolute;
    width: 0.0625rem;
    height: 0.0625rem;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .app-nav .nav-item {
    position: relative;
    justify-content: center;
    padding: 0 !important;
  }

  .app-nav .nav-item .nav-tail {
    position: absolute;
    top: var(--space-1);
    right: var(--space-1);
  }

  .app-nav .nav-group {
    padding: var(--pad-2) 0 0;
    border-top: thin solid var(--color-border);
    margin-top: var(--space-2);
  }

  .app-nav > div:first-child,
  .app-nav-user {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .app-nav-user {
    flex-direction: column;
    gap: var(--space-1);
  }

  .app-nav-user > .btn {
    margin-left: 0 !important;
  }

  .app-user-menu {
    left: 0;
    right: auto;
    width: var(--app-rail-w);
  }
}
