@layer components {
  .skip-link {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    z-index: 20;
    padding: var(--space-sm) var(--space-md);
    font-weight: var(--weight-emphasis);
    color: var(--navy);
    background: var(--surface);
    border-radius: var(--radius-md);
    transform: translateY(-200%);

    &:focus {
      transform: none;
    }
  }

  .app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    color: var(--on-navy);
    background: var(--navy);
  }

  .app-header__bar {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    height: var(--header-height);
  }

  .app-header__brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
  }

  .app-header__logo {
    height: 34px;
    width: auto;
  }

  .app-header__context {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    min-width: 0;
    padding-left: var(--space-lg);
    border-left: 1px solid var(--on-navy-hairline);
  }

  .app-header__separator {
    font-size: var(--text-md);
    color: var(--on-navy-dim);
  }

  .switcher {
    position: relative;
    min-width: 0;
  }

  .switcher__trigger {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    max-width: 100%;
    min-height: var(--control-height);
    padding: var(--space-xs) var(--space-sm);
    font-weight: var(--weight-emphasis);
    color: var(--on-navy);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);

    &:hover,
    &[aria-expanded="true"] {
      background: var(--on-navy-field);
    }
  }

  .switcher__name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .switcher:first-child {
    flex: none;
  }

  .switcher:first-child .switcher__name {
    font-weight: var(--weight-display);
    letter-spacing: 0.04em;
  }

  .switcher__chevron {
    flex: none;
    width: 1rem;
    height: 1rem;
    color: var(--on-navy-dim);
  }

  .app-header__spacer {
    flex: 1;
  }

  .app-header__account {
    position: relative;
    flex: none;
  }

  .app-header__account-button {
    display: grid;
    place-items: center;
    width: var(--control-height);
    height: var(--control-height);
    border-radius: var(--radius-pill);
    transition: background var(--transition-fast);

    &:hover,
    &[aria-expanded="true"] {
      background: var(--on-navy-field);
    }
  }

  .app-header__avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    font-size: var(--text-label);
    font-weight: var(--weight-display);
    color: var(--navy);
    background: var(--periwinkle-soft);
    border-radius: var(--radius-pill);
  }

  @media (max-width: 720px) {
    .app-header__bar {
      gap: var(--space-md);
    }

    .app-header__context {
      padding-left: 0;
      border-left: 0;
    }

    .switcher:last-child .menu {
      right: 0;
      left: auto;
    }
  }
}
