.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.auth-layout {
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  padding: clamp(1rem, 3vw, 1.5rem);
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.sidebar-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 1.25rem 1rem;
}

.sidebar-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: auto 0 0;
}

.sidebar-bottom form {
  margin: 0;
}

.mobile-footer {
  display: none;
}

.brand {
  font-size: 1.25rem;
  font-weight: normal;
  text-decoration: none;
}

.sidebar-tags {
  display: block;
  grid-column: 1 / -1;
}

.sidebar-new {
  justify-self: end;
}

.sidebar-tags h2 {
  margin: 0;
  font-size: 1rem;
}

.sidebar-tags h2 + ul {
  margin-top: 0.5rem;
}

.sidebar-tags ul {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.sidebar-tags a {
  color: var(--text);
  font-style: italic;
  text-decoration: none;
}

.sidebar-empty {
  color: var(--text);
  font-style: italic;
}

.page {
  width: 100%;
  margin: 0;
  padding: var(--page-padding);
}

@media (max-width: 720px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .sidebar {
    position: static;
    display: block;
    min-height: 0;
    height: auto;
    padding: 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-top {
    gap: 0.6rem 1rem;
  }

  .sidebar-tags ul {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
  }

  .sidebar-tags li:not(:last-child)::after {
    content: ",";
    margin-right: 0.35rem;
  }

  .sidebar-bottom {
    display: none;
  }

  .page {
    flex: 1;
  }

  .mobile-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-top: 1px solid var(--line);
  }

  .mobile-footer form {
    margin: 0;
  }
}
