/* The app frame: a sticky 232px sidebar carrying real navigation, and the
   scrolling column beside it. Collapses to a top bar under --bp-md. */

.app {
  display: flex;
  min-height: 100vh;
}

.app__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.navbar {
  width: var(--nav-width);
  flex-shrink: 0;
  background: var(--surface-card);
  border-right: var(--border-width) solid var(--border-default);
  position: sticky;
  top: 0;
  height: 100vh;
}

.navbar__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-md);
  height: 100%;
  overflow-y: auto;
}

/* The wordmark: Inter Tight 700 preceded by a mint dot. There is no logo. */
.navbar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-sm);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-display);
  color: var(--text-primary);
  flex-shrink: 0;
}

.navbar__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mint-500);
  box-shadow: var(--halo-win);
  flex-shrink: 0;
}

.navbar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.navbar__group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.navbar__group-title {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-tertiary);
  padding: 0 var(--space-smd) var(--space-xs);
}

.navbar__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 9px var(--space-smd);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--ink-700);
  transition: var(--transition-control);
}

.navbar__item:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.navbar__item--active {
  background: var(--surface-hover);
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

/* The only mint in the sidebar: a dot marking where you are. */
.navbar__item--active::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint-500);
  flex-shrink: 0;
}

.navbar__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-smd);
  padding-top: var(--space-md);
  border-top: var(--border-width) solid var(--border-default);
  flex-shrink: 0;
}

.navbar__email {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  word-break: break-all;
  padding: 0 var(--space-sm);
}

.navbar form {
  margin: 0;
}

.navbar__foot .button {
  width: 100%;
}

/* Mobile: the sidebar becomes a top bar and the nav a scrolling strip of
   chips. Group titles are dropped — there is no room for them. (--bp-md) */
@media (max-width: 767px) {
  .app {
    flex-direction: column;
  }

  .navbar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: var(--border-width) solid var(--border-default);
  }

  .navbar__inner {
    gap: var(--space-smd);
    padding: var(--space-smd) var(--space-md);
    overflow: visible;
  }

  .navbar__brand {
    padding: 0;
  }

  .navbar__nav {
    flex-direction: row;
    gap: var(--space-xs);
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 calc(-1 * var(--space-md));
    padding: 0 var(--space-md) 2px;
  }

  .navbar__nav::-webkit-scrollbar {
    display: none;
  }

  .navbar__group {
    flex-direction: row;
    gap: var(--space-xs);
  }

  .navbar__group-title {
    display: none;
  }

  .navbar__item {
    padding: 7px var(--space-smd);
    border: var(--border-width) solid var(--border-default);
    border-radius: var(--radius-pill);
    white-space: nowrap;
    font-size: var(--text-sm);
  }

  .navbar__item--active {
    border-color: var(--text-primary);
  }

  .navbar__foot {
    margin-top: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding-top: var(--space-smd);
  }

  .navbar__foot .button {
    width: auto;
  }
}
