.favorite-form {
  flex-shrink: 0;
  margin: 0;
}

.favorite-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  min-width: 76px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.favorite-button .nav-icon {
  width: 18px;
  height: 18px;
}

.favorite-button:hover {
  background: var(--green-pale);
  color: var(--green);
}

.favorite-button[aria-pressed="true"] {
  background: var(--green-pale);
  color: var(--green);
}

.favorite-button[aria-pressed="true"] svg {
  fill: currentColor;
}

.question-meta .favorite-form {
  margin-left: auto;
}

.list-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.favorite-notice:not(:empty) {
  position: fixed;
  z-index: 100;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  width: max-content;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 28px #2438311a;
}

@media (max-width: 640px) {
  .sidebar nav {
    overflow-x: auto;
    gap: 12px;
  }

  .sidebar nav a {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .review-question summary {
    grid-template-columns: 25px minmax(0, 1fr) auto auto;
  }

  .review-question summary > .favorite-form {
    grid-column: 3;
    grid-row: 2;
    align-self: center;
  }

  .review-question summary > .review-toggle {
    grid-column: 4;
    align-self: center;
  }

  .favorite-button {
    min-height: 44px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .favorite-button {
    transition: none;
  }
}
