#sidebar .sidebar-options {
  margin-top: auto;
  padding-bottom: 0;
}

#sidebar .sidebar-options .nav-item {
  width: calc(100% - 24px);
  height: 42px;
  margin: 4px 12px;
}

#sidebar .sidebar-footer {
  flex: 0 0 72px;
  height: 72px;
  min-height: 72px;
  display: grid;
  grid-template-rows: 1fr;
  align-items: center;
  gap: 4px;
  padding: 7px 13px;
}

.sidebar-footer-actions {
  display: flex;
  align-self: stretch;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

#sidebar .sidebar-footer .sidebar-legal-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}

#sidebar .sidebar-footer .sidebar-footer-actions .sidebar-policy-link {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--theme-muted, var(--muted));
  line-height: 1;
  text-align: right;
}

#sidebar .sidebar-footer .sidebar-footer-actions .sidebar-policy-link:hover,
#sidebar .sidebar-footer .sidebar-footer-actions .sidebar-policy-link:focus-visible {
  border: 0;
  color: var(--theme-highlight);
  text-decoration: underline;
}

.sidebar-download-footer {
  flex: 0 0 auto;
  min-width: 98px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--theme-secondary);
  border-radius: 5px;
  background: var(--theme-soft);
  color: var(--theme-highlight);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.sidebar-download-footer:hover,
.sidebar-download-footer:focus-visible {
  border-color: var(--theme-primary);
  outline: none;
}

.sidebar-download-footer svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#sidebar .sidebar-footer .sidebar-copyright {
  margin: 0;
  color: var(--theme-primary);
  line-height: 1;
  text-align: right;
}

@media (min-width: 761px) {
  .sidebar-compact #sidebar.sidebar:not(.peek) .sidebar-options .nav-item {
    width: calc(100% - 24px);
    height: 42px;
    margin: 4px 12px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  .sidebar-compact #sidebar.sidebar:not(.peek) .sidebar-footer {
    display: grid;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar-compact #sidebar.sidebar:not(.peek) .sidebar-footer .user-card,
  .sidebar-compact #sidebar.sidebar:not(.peek) .sidebar-legal-stack {
    display: none;
  }

  .sidebar-compact #sidebar.sidebar:not(.peek) .sidebar-footer-actions {
    grid-row: 1 / -1;
    justify-content: center;
    align-self: end;
  }

  .sidebar-compact #sidebar.sidebar:not(.peek) .sidebar-download-footer {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
  }

  .sidebar-compact #sidebar.sidebar:not(.peek) .sidebar-download-label {
    display: none;
  }
}
