#app-nav {
  align-items: center;
  background: var(--surface-nav);
  border-bottom: 1px solid var(--line-subtle);
  display: flex;
  gap: 24px;
  height: var(--nav-height);
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav__tabs {
  align-items: stretch;
  display: flex;
  gap: 36px;
  height: 100%;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav__tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-top: 3px solid transparent;
  color: #999ea6;
  cursor: pointer;
  flex: none;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 18px;
  padding: 0;
  text-transform: uppercase;
  transition: color 0.12s;
  white-space: nowrap;
}
.nav-tab:hover { color: #fff; }
.nav-tab--active { border-bottom-color: var(--accent-tab); color: #fff; font-weight: 600; }

.nav-tab--brand { letter-spacing: 0.04em; }
.nav-tab--brand.nav-tab--active { border-bottom-color: transparent; }

/* The project's name is always shown strong, as the heading of the tabs that follow it. */
.nav-tab--project {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
}
.nav-tab--project.nav-tab--active { border-bottom-color: transparent; }

/* Avatar and account menu */
.nav__user { flex: none; position: relative; }

.nav-avatar {
  align-items: center;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  display: flex;
  gap: 8px;
  padding: 0;
}
.nav-avatar__circle {
  align-items: center;
  background: var(--surface-strong);
  border-radius: 50%;
  color: #a3a3a3;
  display: flex;
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 600;
  height: 40px;
  justify-content: center;
  transition: background-color 0.12s, color 0.12s;
  width: 40px;
}
.nav-avatar:hover .nav-avatar__circle { color: #fff; }
.nav-avatar.is-open .nav-avatar__circle { background: var(--accent-strong); color: #fff; }
.nav-avatar__caret { transition: transform 0.15s; }
.nav-avatar.is-open .nav-avatar__caret { transform: rotate(180deg); }

.nav-menu {
  background: var(--surface-card);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  position: absolute;
  right: -12px;
  top: calc(100% + 10px);
  width: 220px;
  z-index: 50;
}
.nav-menu__who { border-bottom: 1px solid var(--line-card); margin-bottom: 4px; padding: 6px 8px 10px; }
.nav-menu__name { color: #fff; font-size: 15px; font-weight: 600; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-menu__role { color: var(--text-dim); font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-menu__item {
  align-items: center;
  background: none;
  border: 0;
  border-radius: var(--radius);
  color: var(--text-soft);
  cursor: pointer;
  display: flex;
  font-size: 14px;
  gap: 12px;
  padding: 8px;
  text-align: left;
  width: 100%;
}
.nav-menu__item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav-menu__item.nav-tab--active { color: #fff; }
.nav-menu__item--danger { color: var(--status-red); }
.nav-menu__item--danger:hover { background: var(--status-red-soft); color: var(--status-red); }

#workspace-root {
  min-height: calc(100vh - var(--nav-height));
}

/* The pages that are not built yet. */
.workspace-placeholder {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height) - 120px);
  padding: 40px 24px;
  text-align: center;
}
.workspace-placeholder__icon {
  align-items: center;
  background: var(--surface-card);
  border: 1px solid var(--line-card);
  border-radius: 14px;
  color: var(--accent-tab);
  display: flex;
  height: 56px;
  justify-content: center;
  width: 56px;
}
.workspace-placeholder__title { color: #fff; font-size: 20px; font-weight: 700; margin: 4px 0 0; }
.workspace-placeholder__text { color: var(--text-secondary); font-size: 14px; line-height: 20px; margin: 0; max-width: 30rem; }

/* Messages for the user that no workspace is left to show, e.g. a save that failed after they moved on. */
#app-notices {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(32rem, calc(100vw - 2.5rem));
}

.app-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem 0.65rem 1rem;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-status-important);
  border-radius: var(--radius-sharp);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  color: var(--color-text);
  font-size: 0.875rem;
}

.app-notice--error { border-color: var(--color-status-error); }

.app-notice__message { flex: 1; overflow-wrap: anywhere; }

.app-notice__dismiss {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0;
}

.app-notice__dismiss:hover { color: var(--color-text); }
