.checklist-tool {
  margin: 1.5rem 0 2.5rem;
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid var(--line);
}

.checklist-tool__setup {
  padding: 1.2rem 0;
}

.checklist-tool__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.checklist-field {
  display: grid;
  gap: 0.35rem;
}

.checklist-field label,
.checklist-options legend {
  color: var(--text);
  font-weight: 800;
}

.checklist-field input,
.checklist-field select,
.checklist-owner {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.checklist-options {
  margin: 1rem 0 0;
  padding: 0;
  border: 0;
}

.checklist-options__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.checklist-options label {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  min-height: 2.65rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  cursor: pointer;
}

.checklist-options label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.checklist-options input,
.checklist-done {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent-strong);
}

.checklist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.checklist-button {
  min-height: 2.8rem;
  padding: 0.65rem 1.05rem;
  border: 1px solid var(--accent-strong);
  border-radius: 2px;
  background: var(--accent-strong);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.checklist-button:hover {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}

.checklist-button--secondary {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--text);
}

.checklist-button--secondary:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.checklist-output {
  padding: 1.4rem 0 0;
  border-top: 4px solid var(--brand);
}

.checklist-output[hidden] {
  display: none;
}

.checklist-output:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.checklist-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  margin: 0.7rem 0 1.2rem;
}

.checklist-status__count {
  min-width: 7.5rem;
  color: var(--brand-strong);
  font-weight: 850;
}

.checklist-progress {
  height: 0.7rem;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line);
}

.checklist-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 160ms ease;
}

.checklist-stage {
  margin: 1.7rem 0 0;
}

.checklist-stage h3 {
  margin: 0;
  padding: 0 0 0.55rem 0.7rem;
  border-bottom: 2px solid var(--line);
  border-left: 4px solid var(--accent);
}

.checklist-items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(8.5rem, 0.3fr);
  gap: 0.75rem;
  align-items: start;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.checklist-item:has(.checklist-done:checked) .checklist-item__title {
  color: var(--muted);
  text-decoration: line-through;
}

.checklist-done {
  margin-top: 0.35rem;
}

.checklist-item__title {
  display: block;
  font-weight: 800;
}

.checklist-item__meta {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.checklist-item__late {
  color: #9a3f50;
  font-weight: 800;
}

.checklist-owner-label {
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.checklist-owner {
  min-height: 2.35rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.88rem;
}

.checklist-note {
  margin: 1rem 0;
  padding: 0.85rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .checklist-tool__fields,
  .checklist-item {
    grid-template-columns: 1fr;
  }

  .checklist-item {
    gap: 0.45rem;
  }

  .checklist-done {
    grid-row: 1;
  }

  .checklist-actions {
    align-items: stretch;
  }

  .checklist-button {
    width: 100%;
  }
}

@media print {
  .site-header,
  .breadcrumb,
  .site-sidebar,
  .site-footer,
  .ad-slot,
  .related-links,
  .checklist-tool__setup,
  .checklist-actions {
    display: none !important;
  }

  .content-layout {
    display: block;
  }

  .page-shell,
  .article {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .checklist-item {
    grid-template-columns: auto minmax(0, 1fr) 8rem;
    break-inside: avoid;
  }

  .checklist-owner {
    border: 0;
    appearance: none;
  }

  .checklist-progress {
    border: 1px solid #888;
  }
}
