.page-checklist {
  position: relative;
}

.page-checklist-list {
  display: grid;
  gap: 8px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.page-checklist-item {
  background: var(--page-canvas);
}

.page-checklist-label {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 16px;
  cursor: pointer;
}

.page-checklist-input {
  width: 40px;
  height: 40px;
  margin: 0;
  accent-color: var(--page-orange);
}

.page-checklist-status {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--page-ink);
  color: var(--page-canvas);
  font-weight: 700;
}

.page-checklist-clear {
  min-width: 120px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--page-ink);
  border-radius: 8px;
  background: transparent;
  color: var(--page-ink);
  cursor: pointer;
  font-weight: 700;
}

.page-checklist-clear:hover {
  border-color: var(--page-orange-pressed);
  color: var(--page-orange-pressed);
}

.page-checklist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.page-confetti {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 12px;
  pointer-events: none;
  background: var(--page-orange);
  animation: page-confetti-pop 650ms cubic-bezier(.2, 1.3, .4, 1) forwards;
}

@keyframes page-confetti-pop {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--page-confetti-turn)) scale(1);
  }

  to {
    opacity: 0;
    transform: translate(var(--page-confetti-x), var(--page-confetti-y)) rotate(calc(var(--page-confetti-turn) + 180deg)) scale(.5);
  }
}

@media (prefers-color-scheme: dark) {
  .page-checklist-item {
    background: #272727;
  }

  .page-checklist-clear {
    border-color: var(--page-ink);
  }
}
