/* CapitalRaise workspace navigation
   The sidebar is the information architecture. Keep module navigation in one
   vertical column and reserve the page canvas for the work itself. */

.app-shell {
  --sidebar-width: 256px;
}

.app-shell > .sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  min-width: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 18px 12px 14px;
  overflow: hidden;
  background: #fafafa;
  border-right: 1px solid var(--line, #e7e7e8);
}

.app-shell > .sidebar .brand {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 10px 18px;
}

.app-shell > .sidebar .workspace-switcher {
  flex: 0 0 auto;
  margin: 0 1px 16px;
}

.app-shell > .sidebar .sidebar-new-chat {
  flex: 0 0 auto;
  margin: 0 0 18px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line, #e7e7e8);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
}

.app-shell > .sidebar .sidebar-new-chat:hover,
.app-shell > .sidebar .sidebar-new-chat:focus-visible {
  background: var(--soft, #f7f7f8);
  border-color: #cfd1d5;
}

/* Bridge-owned wrapper. It lets primary navigation scroll while the account
   controls remain anchored at the bottom of the sidebar. */
.app-shell > .sidebar .sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1px 0 12px;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.app-shell > .sidebar .nav-group,
.app-shell > .sidebar .nav-group .nav-list,
.app-shell > .sidebar .nav-secondary,
.app-shell > .sidebar .sidebar-secondary-nav,
.app-shell > .sidebar .saved-audiences {
  display: block;
  min-width: 0;
  overflow: visible;
}

.app-shell > .sidebar .nav-group-label {
  margin: 0 11px 7px;
  color: #8a8d93;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  line-height: 1.4;
  text-transform: uppercase;
}

.app-shell > .sidebar .nav-list {
  display: grid;
  gap: 2px;
}

.app-shell > .sidebar .nav-list > a,
.app-shell > .sidebar .sidebar-secondary-nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #555b64;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.app-shell > .sidebar .nav-list > a:hover,
.app-shell > .sidebar .sidebar-secondary-nav a:hover {
  background: #f0f1f2;
  color: var(--ink, #1a1c1f);
}

.app-shell > .sidebar .nav-list > a.active,
.app-shell > .sidebar .sidebar-secondary-nav a.active {
  background: #ededee;
  border-color: #e1e2e4;
  color: var(--ink, #1a1c1f);
  font-weight: 650;
}

.app-shell > .sidebar .nav-list > a.active::before,
.app-shell > .sidebar .sidebar-secondary-nav a.active::before {
  position: absolute;
  left: -1px;
  width: 3px;
  height: 18px;
  border-radius: 99px;
  background: var(--brand-accent, #2563eb);
  content: '';
}

.app-shell > .sidebar .nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: #737982;
}

.app-shell > .sidebar .nav-list > a.active .nav-icon,
.app-shell > .sidebar .sidebar-secondary-nav a.active .nav-icon {
  color: var(--brand-accent, #2563eb);
}

.app-shell > .sidebar .sidebar-branch {
  display: none;
  margin: 3px 0 7px 31px;
  padding-left: 11px;
  border-left: 1px solid #dfe1e4;
}

.app-shell > .sidebar .sidebar-branch.is-active,
.app-shell > .sidebar .sidebar-branch[data-active="true"] {
  display: block;
}

.app-shell > .sidebar .sidebar-branch[hidden],
.app-shell > .sidebar .sidebar-context-level[hidden] {
  display: none !important;
}

.app-shell > .sidebar .sidebar-context-nav,
.app-shell > .sidebar .sidebar-context-level {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.app-shell > .sidebar .sidebar-context-item {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 36px;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #626873;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.app-shell > .sidebar .sidebar-context-item:hover,
.app-shell > .sidebar .sidebar-context-item:focus-visible {
  background: #f0f1f2;
  color: var(--ink, #1a1c1f);
}

.app-shell > .sidebar .sidebar-context-item.is-active {
  background: #f0f1f2;
  color: var(--ink, #1a1c1f);
  font-weight: 650;
}

.app-shell > .sidebar .sidebar-context-item.is-active::before {
  position: absolute;
  left: -12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-accent, #2563eb);
  content: '';
}

.app-shell > .sidebar .sidebar-context-level {
  margin: 0 0 3px 16px;
  padding-left: 9px;
  border-left: 1px solid #e2e4e7;
}

.app-shell > .sidebar .sidebar-context-level .sidebar-context-item {
  min-height: 33px;
  padding-block: 6px;
  font-size: 13px;
}

.app-shell > .sidebar .saved-audiences {
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--line, #e7e7e8);
}

.app-shell > .sidebar .saved-audiences .nav-group-label {
  margin-bottom: 6px;
}

.app-shell > .sidebar .saved-audience-list {
  max-height: none;
  overflow: visible;
}

.app-shell > .sidebar .saved-audience-link {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 13px;
}

.app-shell > .sidebar .nav-secondary {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line, #e7e7e8);
}

.app-shell > .sidebar .sidebar-bottom {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 14px 9px 0;
  border-top: 1px solid var(--line, #e7e7e8);
}

/* Settings is reached from the same primary sidebar; the old second menu
   would create a competing horizontal/secondary information architecture. */
.settings-page .settings-menu {
  display: none !important;
}

.settings-page .settings-shell {
  display: block;
  min-height: 0;
}

.settings-page .settings-panel {
  width: 100%;
  padding: 42px clamp(20px, 5vw, 88px) 80px;
}

@media (max-width: 800px) {
  .app-shell { --sidebar-width: min(280px, 85vw); }
  .app-shell > .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    height: 100dvh;
    transform: translateX(-100%);
    visibility: hidden;
    box-shadow: 18px 0 56px #0002;
    transition: transform .2s ease, visibility .2s ease;
  }
  .app-shell > .sidebar.open {
    transform: translateX(0);
    visibility: visible;
  }
  .settings-page .settings-panel {
    padding: 28px 18px 60px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell > .sidebar .nav-list > a,
  .app-shell > .sidebar .sidebar-secondary-nav a,
  .app-shell > .sidebar .sidebar-context-item,
  .app-shell > .sidebar {
    transition: none;
  }
}


.app-shell > .sidebar .sidebar-branch:not([hidden]){display:block}
[data-sidebar-source]{display:none!important}

/* Hide source bars from the first paint; their accessible copies live above. */
#view :is(.marketing-tabs,.audience-tabs,.module-audience-nav,[role="tablist"],.rl-social-tabs,.rl-webinar-tabs,.rl-readiness-tabs,.steps,.settings-navigation nav,.rl-social-view-switch,.rl-context-bar){display:none!important}

.app-shell > .sidebar .sidebar-home-context{margin:0 0 18px;padding:0;border:0}
/* The collapsed chat home still needs a way into the navigation. */
.app-shell.chat-home .workspace-bar #menu-btn{display:grid;place-items:center}
