/* The collapsed sidebar: a slim rail of icons that opens the full sidebar over the page.
   .sidebar-peek is the open state. Rail and open sidebar share one grid (40px icon cells, labels
   from 44px), so the icons stay where they are when it opens. Desktop only: shell.js never
   collapses the sidebar on smaller screens, where it's a drawer. */
@media (min-width: 1025px) {
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .sidebar {
    justify-self: start;
    width: 100%;
    padding: 16px 11px 12px;
    transition: width 0.2s var(--ease), box-shadow 0.2s ease;
  }
  /* Wider than its column, so the page behind doesn't move. */
  .dashboard-page .app-shell.sidebar-collapsed.sidebar-peek:not(.is-setup) .sidebar,
  html[data-theme="dark"] .dashboard-page .app-shell.sidebar-collapsed.sidebar-peek:not(.is-setup) .sidebar {
    z-index: 40;
    width: 280px;
    box-shadow: 0 18px 60px #00000033;
  }
  html[data-theme="dark"] .dashboard-page .app-shell.sidebar-collapsed.sidebar-peek:not(.is-setup) .sidebar {
    box-shadow: 0 18px 60px #00000059;
  }

  /* Logo, and the button that pins the sidebar open (only reachable once it's open). */
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .sidebar > .brand {
    align-self: stretch;
    gap: 7px;
    height: 28px;
    margin: 0 0 14px;
    padding-left: 7px;
    overflow: hidden;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .brand-mark {
    flex: none;
    width: 26px;
    height: 26px;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .brand-wordmark {
    flex: none;
    width: auto;
    height: 28px;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) #sidebar-collapse svg {
    transform: rotate(180deg);
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup):not(.sidebar-peek) #sidebar-collapse {
    display: none;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) :is(#create-project, .sidebar-section-label) {
    display: none;
  }

  /* Project */
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .project-picker {
    margin-bottom: 21px;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .project-picker::after,
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .profile-footer::before {
    content: "";
    position: absolute;
    left: 8px;
    width: 24px;
    height: 1px;
    background: var(--panel-line);
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .project-picker::after {
    bottom: -11px;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .profile-footer::before {
    top: 0;
  }
  .dashboard-page .app-shell.sidebar-collapsed.sidebar-peek:not(.is-setup) .project-picker::after,
  .dashboard-page .app-shell.sidebar-collapsed.sidebar-peek:not(.is-setup) .profile-footer::before {
    left: 0;
    width: 100%;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .project-picker-trigger,
  html[data-theme="dark"] .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .project-picker-trigger {
    gap: 8px;
    height: 40px;
    min-height: 40px;
    padding: 0 10px 0 4px;
    overflow: hidden;
    border-radius: 10px;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.sidebar-peek):not(.is-setup) .project-picker-trigger,
  html[data-theme="dark"] .dashboard-page .app-shell.sidebar-collapsed:not(.sidebar-peek):not(.is-setup) .project-picker-trigger {
    background: transparent;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .project-switch-copy {
    gap: 1px;
    line-height: 1.2;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) :is(.project-switch-copy small, .profile-copy small) {
    font-size: 12px;
  }

  /* Links */
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) #main-nav {
    gap: 2px;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.sidebar-peek):not(.is-setup) #main-nav {
    scrollbar-width: none;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.sidebar-peek):not(.is-setup) #main-nav::-webkit-scrollbar {
    display: none;
  }
  /* Open, a long list scrolls with its bar in the sidebar's padding, so the rows keep their width. */
  .dashboard-page .app-shell.sidebar-collapsed.sidebar-peek:not(.is-setup) #main-nav {
    margin-right: -11px;
    padding-right: 5px;
    scrollbar-gutter: stable;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) :is(.nav-link, .sidebar-help a) {
    gap: 0;
    justify-content: flex-start;
    height: 40px;
    min-height: 40px;
    padding: 0;
    overflow: hidden;
  }
  /* Open, counts and dots sit clear of the chevron, as they do in the pinned sidebar. */
  .dashboard-page .app-shell.sidebar-collapsed.sidebar-peek:not(.is-setup) .nav-link {
    padding-right: 12px;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) :is(.nav-link, .sidebar-help a) > svg {
    flex: none;
    width: 19px;
    height: 19px;
    margin: 0 10.5px;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) :is(.nav-link, .sidebar-help a) .nav-text {
    padding-left: 4px;
    white-space: nowrap;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .nav-sub {
    /* The line runs straight down from the icon, as it does in the pinned sidebar. */
    margin: 2px 0 4px 20px;
    padding-left: 12px;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.sidebar-peek-subs):not(.is-setup) .nav-sub {
    display: none;
  }

  /* On the rail the labels go, and counts and badges become dots on the icon. */
  .dashboard-page .app-shell.sidebar-collapsed:not(.sidebar-peek):not(.is-setup) :is(
    .brand-wordmark,
    .project-picker-trigger > svg,
    .project-switch-copy,
    .nav-text,
    .nav-chevron,
    .nav-expand,
    .nav-chevron-space,
    .docs-arrow,
    .setup-compact-label,
    .setup-compact-count,
    .profile-copy,
    .profile-chevron
  ) {
    display: none;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.sidebar-peek):not(.is-setup) .nav-link .nav-count {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 0;
    width: 8px;
    height: 8px;
    padding: 0;
    font-size: 0;
    box-shadow: 0 0 0 2px var(--panel);
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.sidebar-peek):not(.is-setup) .nav-link .nav-badge {
    display: block;
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 0;
    background: none;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.sidebar-peek):not(.is-setup) .nav-link .nav-badge i {
    display: block;
    width: 7px;
    height: 7px;
    box-shadow: 0 0 0 2px var(--panel);
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.sidebar-peek):not(.is-setup) .nav-badge-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  /* Setup, docs and account */
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .project-setup-card {
    padding: 0;
    border: 0;
    background: none;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .setup-sidebar-full {
    display: none;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .setup-sidebar-compact {
    display: flex;
    align-items: center;
    width: 100%;
    height: 40px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--ink);
    font-size: var(--text-sm);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .setup-sidebar-compact:hover {
    background: var(--menu-hover);
  }
  .setup-ring {
    flex: none;
    width: 22px;
    height: 22px;
    margin: 0 9px;
    transform: rotate(-90deg);
  }
  .setup-ring circle {
    fill: none;
    stroke: var(--line);
    stroke-width: 3.4;
  }
  .setup-ring circle.is-done {
    stroke: var(--blue);
  }
  .setup-compact-label {
    padding-left: 4px;
    white-space: nowrap;
  }
  .setup-compact-count {
    margin-left: auto;
    padding-right: 10px;
    color: var(--muted);
    font-weight: 450;
    white-space: nowrap;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .sidebar-help {
    padding: 2px 0 0;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .sidebar-help .docs-arrow {
    margin-left: auto;
    padding-right: 10px;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .profile-footer {
    padding-top: 11px;
    border-top: 0;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .profile-trigger {
    gap: 7px;
    height: 40px;
    min-height: 40px;
    padding: 0 10px 0 3px;
    overflow: hidden;
  }
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .profile-copy {
    gap: 1px;
    line-height: 1.2;
  }

  /* Labels fade in as the panel opens. */
  .dashboard-page .app-shell.sidebar-peek-opening:not(.is-setup) :is(
    .brand-wordmark,
    .project-switch-copy,
    .nav-text,
    .nav-chevron,
    .docs-arrow,
    .setup-compact-label,
    .setup-compact-count,
    .profile-copy,
    .profile-chevron,
    #sidebar-collapse
  ) {
    animation: rail-label-in 0.18s ease both;
  }
}
@keyframes rail-label-in {
  from {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-page .app-shell.sidebar-collapsed:not(.is-setup) .sidebar {
    transition: none;
  }
  .dashboard-page .app-shell.sidebar-peek:not(.is-setup) .sidebar * {
    animation: none !important;
  }
}
