/* Runbook checklists (je-checklist, je-runbook-controls). Loaded only on pages that use them,
   after resources.css; uses its tokens and the site's own fonts (no extra font loads). */

.je-checklist {
  margin: 1.4em 0 1.8em;
  padding: 16px 18px 18px;
  border: 1px solid var(--je-line);
  border-radius: var(--je-radius);
  background: var(--je-surface);
}
.je-checklist legend {
  float: none;
  width: auto;
  margin: 0;
  padding: 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--je-ink);
}
.je-checklist ul {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.je-checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--je-soft);
}
.je-checklist li:last-child {
  border-bottom: 0;
}
.je-checklist input[type="checkbox"] {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15em;
  accent-color: var(--je-teal-dark);
}
.je-checklist label {
  margin: 0;
  color: var(--je-body);
  cursor: pointer;
}
.je-checklist input:checked + label {
  color: var(--je-muted);
}
.je-checklist input:focus-visible {
  outline: 3px solid var(--je-teal);
  outline-offset: 2px;
}
.je-checklist li.is-danger {
  padding-left: 8px;
  border-left: 4px solid #c53030;
}
/* Text label, not color alone: "Changes production". */
.je-danger-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 8px;
  border: 1px solid #c53030;
  border-radius: 999px;
  color: #9b2c2c;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}

.je-checklist-notes {
  margin-top: 12px;
}
.je-checklist-notes label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: var(--je-ink);
}
.je-checklist-notes textarea {
  width: 100%;
  min-height: 4.5em;
  padding: 8px 10px;
  border: 1px solid var(--je-line);
  border-radius: 8px;
  font: inherit;
  font-size: 16px; /* no zoom-on-focus on phones */
  resize: vertical;
}
.je-checklist-notes-print {
  display: none;
}

.je-runbook-controls {
  position: sticky;
  top: 8px;
  z-index: 5;
  margin: 1.2em 0 1.8em;
  padding: 14px 18px;
  border: 1px solid var(--je-line);
  border-radius: var(--je-radius);
  background: var(--je-soft);
}
.je-runbook-controls[hidden] {
  display: none;
}
.je-runbook-progress-text {
  margin: 0 0 6px;
  font-weight: 600;
  color: var(--je-ink);
}
.je-runbook-controls progress {
  width: 100%;
  height: 10px;
  accent-color: var(--je-teal-dark);
}
.je-runbook-save {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.je-runbook-save input {
  width: 1.2rem;
  height: 1.2rem;
}
.je-runbook-save label {
  margin: 0;
  font-weight: 600;
}
.je-runbook-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .je-runbook-controls {
    position: static;
  }
  .je-checklist {
    padding: 12px 12px 14px;
  }
  .je-runbook-actions .je-btn-outline {
    width: 100%;
  }
}

@media print {
  .je-runbook-controls {
    display: none !important;
  }
  .je-checklist {
    break-inside: avoid;
    border-color: #999;
  }
  .je-checklist input[type="checkbox"] {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .je-checklist-notes textarea {
    display: none;
  }
  .je-checklist-notes-print {
    display: block;
    min-height: 3em;
    padding: 6px 8px;
    border: 1px solid #999;
    white-space: pre-wrap;
  }
  .je-danger-tag {
    border-color: #000;
    color: #000;
  }
}
