.portal-sidebar {
  width: 15rem;
  height: 100vh;
  background: var(--color-sidebar-bg);
  border-right: 1px solid var(--color-sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
}

/* Logo block */
.portal-sidebar__logo {
  height: 3.1875rem; /* 51px */
  padding: 0 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--color-sidebar-divider);
}

/* Stirling brand mark (theme-switched in Sidebar.tsx) + product wordmark */
.portal-sidebar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.portal-sidebar__brand-mark {
  height: 1.375rem;
  width: auto;
  display: block;
}
.portal-sidebar__logo-suffix {
  font-family: var(--font-brand);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text-1);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* App switcher (down-arrow → Portal / Editor) */
.portal-sidebar__app-switch {
  margin-left: auto;
  display: flex;
}
.portal-sidebar__app-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--color-text-4);
  transition:
    background var(--motion-fast),
    color var(--motion-fast);
}
.portal-sidebar__app-switch-btn:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-2);
}
.portal-sidebar__app-icon {
  width: 1rem;
  height: 1.0625rem;
  display: block;
}

/* Nav body */
.portal-sidebar__nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.75rem 0.625rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.portal-sidebar__group {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.portal-sidebar__divider {
  height: 1px;
  background: var(--color-sidebar-divider);
  margin: 0.25rem 0;
}

/* Footer */
.portal-sidebar__footer {
  border-top: 1px solid var(--color-sidebar-divider);
  padding: 0.5rem 0.625rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.portal-sidebar__usage {
  padding: 0.5rem 0.625rem;
  font-size: 0.75rem;
  color: var(--color-usage-text);
}

.portal-sidebar__usage-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.portal-sidebar__usage-label {
  color: var(--color-text-4);
}

.portal-sidebar__usage-value {
  color: var(--color-usage-value);
  font-weight: 500;
}

.portal-sidebar__usage-track {
  margin-top: 0.5rem;
  height: 0.25rem;
  background: var(--color-usage-track);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.portal-sidebar__usage-fill {
  height: 100%;
  background: var(--grad-blue-btn);
  transition: width var(--motion-slow);
}

.portal-sidebar__plan {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--color-text-2);
  font-weight: 500;
}

.portal-sidebar__plan-dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: var(--color-green);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-green) 30%, transparent);
}
