.checklist-runner {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0 0 10px;
  padding: 14px;
  background: var(--surface-accent);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}

.checklist-runner-head {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.checklist-runner-head strong {
  display: block;
  color: #111827;
  font-size: 15px;
}

.checklist-runner-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.checklist-runner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.checklist-runner-head button {
  justify-self: start;
  min-height: 44px;
  padding: 0 12px;
  color: var(--blue-dark);
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.checklist-runner-head button:hover:not(:disabled),
.checklist-runner-head button:focus-visible {
  border-color: var(--blue);
  background: #eff6ff;
}

.checklist-runner-head button:disabled {
  color: #94a3b8;
  background: #f8fafc;
  border-color: var(--line);
  cursor: not-allowed;
}

.checklist-copy-status {
  margin: 0;
  padding: 9px 10px;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.checklist-copy-status[hidden],
.checklist-copy-fallback[hidden] {
  display: none;
}

.checklist-copy-status.is-error {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fed7aa;
}

.checklist-copy-fallback {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.checklist-copy-fallback label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 900;
}

.checklist-copy-fallback textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 132px;
  padding: 10px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  line-height: 1.55;
  resize: vertical;
}

.checklist-copy-fallback textarea:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

.checklist-print-sheet {
  display: none;
}

.checklist-progress-row {
  display: grid;
  gap: 7px;
}

.checklist-progress-row label {
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 900;
}

.checklist-progress-row progress {
  width: 100%;
  height: 9px;
  accent-color: var(--blue);
}

.checklist-view-row {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding-top: 2px;
}

.checklist-view-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.checklist-view-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.checklist-view-actions button {
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.checklist-view-actions button:hover:not(:disabled),
.checklist-view-actions button:focus-visible {
  color: var(--blue-dark);
  background: #fff;
  border-color: var(--blue);
}

.checklist-view-actions button[aria-pressed="true"] {
  color: #fff;
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

.checklist-view-actions button:disabled {
  color: #94a3b8;
  background: transparent;
  border-color: #dbe3ed;
  cursor: not-allowed;
}

.checklist-runner.is-complete {
  background: #f0fdf4;
  border-color: #86efac;
}

.checklist-runner.is-complete .checklist-progress-row label {
  color: #166534;
}

.page .interactive-checklist {
  display: grid;
  gap: 8px;
  margin-top: 0;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  list-style: none;
}

.interactive-checklist-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.checklist-item-control {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.checklist-item-copy {
  min-width: 0;
  color: var(--ink-soft);
}

.interactive-checklist-item.is-complete {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.interactive-checklist-item.is-complete .checklist-item-copy {
  color: #64748b;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.interactive-checklist-item.is-complete .checklist-item-copy a {
  color: #64748b;
}

.interactive-checklist.is-filtering-incomplete .interactive-checklist-item.is-complete {
  display: none;
}

.checklist-completion {
  display: grid;
  gap: 12px;
  align-items: center;
  min-width: 0;
  margin: 10px 0 18px;
  padding: 14px;
  color: #14532d;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
}

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

.checklist-completion strong {
  display: block;
  font-size: 15px;
}

.checklist-completion p {
  margin: 4px 0 0;
  color: #3f6212;
  font-size: 13px;
}

.page a.checklist-completion-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 44px;
  padding: 0 14px;
  color: #fff;
  background: #166534;
  border: 1px solid #166534;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.page a.checklist-completion-link:hover {
  background: #14532d;
  border-color: #14532d;
}

.page a.checklist-completion-link:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 3px;
}

@media (min-width: 700px) {
  .checklist-runner-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .checklist-runner-head button {
    justify-self: end;
  }

  .checklist-runner-actions {
    justify-self: end;
  }

  .checklist-view-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .checklist-view-actions {
    justify-self: end;
  }

  .checklist-completion {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .page a.checklist-completion-link {
    justify-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .checklist-runner *,
  .interactive-checklist *,
  .checklist-completion * {
    transition: none;
  }
}

@media print {
  @page {
    margin: 15mm;
  }

  html.has-checklist-print body {
    color: #111827;
    background: #fff;
  }

  html.has-checklist-print body > * {
    display: none !important;
  }

  html.has-checklist-print body > .checklist-print-sheet {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 0;
    color: #111827;
    background: #fff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  .checklist-print-kicker {
    margin: 0 0 6px;
    color: #334155;
    font-size: 10pt;
    font-weight: 700;
  }

  .checklist-print-sheet h1 {
    margin: 0;
    color: #111827;
    font-size: 20pt;
    line-height: 1.3;
  }

  .checklist-print-status {
    margin: 10px 0 16px;
    color: #334155;
    font-size: 10pt;
  }

  .checklist-print-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .checklist-print-list li {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 9px 0;
    border-bottom: 1px solid #cbd5e1;
    break-inside: avoid;
  }

  .checklist-print-item-status {
    color: #334155;
    font-size: 9pt;
    font-weight: 700;
  }

  .checklist-print-source {
    margin: 18px 0 0;
    color: #475569;
    font-size: 9pt;
    overflow-wrap: anywhere;
  }
}
