@layer components {
  /* Top navigation bar */
  .nav {
    --nav-bg: var(--color-canvas);

    align-items: center;
    background-color: var(--nav-bg);
    border-block-end: var(--border);
    display: flex;
    gap: var(--inline-space);
    padding-inline: var(--inline-space);
    padding-top: var(--safe-inset-top);
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
    height: var(--nav-height);
  }

  .nav__brand {
    font-weight: 700;
    font-size: var(--text-medium);
    color: var(--color-ink);
    text-decoration: none;
    margin-inline-end: auto;
  }

  .nav__title {
    font-size: var(--text-normal);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-inline-size: 0;
  }

  .nav__actions {
    align-items: center;
    display: flex;
    gap: var(--inline-space-half);
    margin-inline-start: auto;
    flex-shrink: 0;
  }

  .nav__desktop-links {
    align-items: center;
    display: flex;
    gap: var(--inline-space-half);
  }

  /* Mobile drawer toggle buttons in nav */
  .nav__drawer-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4em;
    border-radius: var(--radius);
    color: var(--color-ink-secondary);
    transition: background-color var(--transition-fast);
  }

  .nav__drawer-toggle:hover {
    background-color: var(--color-surface);
  }

  /* Hide drawer toggles on desktop where drawers are always visible */
  @media (min-width: 800px) {
    .nav__drawer-toggle--mobile-only {
      display: none;
    }
  }

  /* Nav icon (SVG-based, inline) */
  .nav__icon {
    inline-size: 1.25rem;
    block-size: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}
