/* version 4: processes and print approvals */
.p-bad { color: var(--bad); font-weight: 600; }
.p-progress { height: 8px; border-radius: 99px; background: #edf0f4; overflow: hidden; margin: 4px 0 2px; min-width: 90px; }
.p-progress i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.p-progress.thin { height: 5px; }
.p-progress-cell { min-width: 140px; }
.p-head-progress { min-width: 200px; text-align: right; }
.p-head-progress strong { font-size: 26px; letter-spacing: -0.02em; }
.p-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 24px; }
.p-library h3 { margin-top: 4px; }
.p-md p { margin: 0 0 8px; }
.p-md ul, .p-md ol { margin: 0 0 8px; padding-left: 20px; }
.p-md.small { color: #3d424b; }

/* template view and editor */
ol.p-tsteps { padding-left: 22px; margin: 6px 0 12px; }
ol.p-tsteps > li { padding: 10px 0; border-bottom: 1px solid var(--line); }
ol.p-tsteps > li:last-child { border-bottom: 0; }
ul.p-check-preview { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
ul.p-check-preview li { list-style: "☐  "; }
.p-tstep { padding-top: 14px; padding-bottom: 14px; }
.p-tstep h2 { margin: 0; display: flex; gap: 10px; align-items: center; }
.p-tstep .btns form { display: inline; }
.p-tstep details summary { color: var(--accent); font-size: 14px; margin-top: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* run page */
.p-num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  background: #eef0f3; color: #4a4f58; font-weight: 700; font-size: 13px; }
.p-step { padding: 16px 20px; }
.p-step-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.p-step-title { flex: 1; min-width: 0; }
.p-step-title h2 { margin: 2px 0 0; font-size: 16px; }
.p-step.done .p-num { background: var(--ok-bg); color: var(--ok); }
.p-step.awaiting { border-color: #f3dfb5; }
.p-step.awaiting .p-num { background: var(--warn-bg); color: var(--warn); }
.p-step.skipped { opacity: .7; }
.p-step.locked { background: #fafbfc; }
.p-step.locked .p-step-title h2 { color: var(--muted); }
.p-step:target { outline: 2px solid var(--accent); outline-offset: 2px; }
.p-checklist { margin: 8px 0; }
.p-checklist label.check { margin: 0 0 6px !important; gap: 8px; align-items: flex-start; font-size: 14px; }
.p-checklist label.check input { margin-top: 4px; }
ul.p-checklist.read { list-style: none; padding: 0; }
ul.p-checklist.read li { padding: 2px 0 2px 24px; position: relative; font-size: 14px; color: var(--muted); }
ul.p-checklist.read li::before { content: "☐"; position: absolute; left: 2px; }
ul.p-checklist.read li.on { color: var(--ink); }
ul.p-checklist.read li.on::before { content: "✓"; color: var(--ok); font-weight: 700; }
.p-decide { margin-top: 12px; }
.p-more { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.p-more summary { color: var(--accent); }
ul.p-files { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; }
ul.p-files li { padding: 2px 0; }
.p-note { background: #f7f8fa; border-radius: 8px; padding: 8px 10px; margin: 8px 0 0; font-size: 14px; white-space: pre-wrap; }
ul.p-history { list-style: none; padding: 0; margin: 0; font-size: 14px; }
ul.p-history li { padding: 8px 0; border-bottom: 1px solid var(--line); }
ul.p-history li:last-child { border-bottom: 0; }
.p-panel h2 { margin: 0; }
.p-panel ul.plain { margin-top: 8px; }

/* print approvals */
.pf-flow { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.pf-flow span { background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.pf-flow small { font-weight: 400; color: var(--muted); }
.pf-alert { border-color: #f3c27a; }
ol.pf-steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 0; margin: 0 0 18px; }
ol.pf-steps li { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-weight: 600; font-size: 14px; display: flex; flex-direction: column; }
ol.pf-steps li b { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: #eef0f3; align-items: center; justify-content: center; font-size: 11px; margin-bottom: 4px; }
ol.pf-steps li small { font-weight: 400; color: var(--muted); font-size: 12px; }
ol.pf-steps li.done { border-color: #c6ebd4; background: var(--ok-bg); }
ol.pf-steps li.done b { background: var(--ok); color: #fff; }
ol.pf-steps li.now { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
ol.pf-steps li.bad { border-color: #f5c8c8; background: var(--bad-bg); }
.pf-preflight label.check { gap: 10px; align-items: flex-start; margin-bottom: 8px !important; font-size: 14px; }
.pf-preflight label.check input { margin-top: 4px; }
ul.pf-list { list-style: none; padding: 0; margin: 0 0 6px; font-size: 14px; }
ul.pf-list li { padding: 3px 0 3px 24px; position: relative; color: var(--muted); }
ul.pf-list li::before { content: "☐"; position: absolute; left: 2px; }
ul.pf-list li.on { color: var(--ink); }
ul.pf-list li.on::before { content: "✓"; color: var(--ok); font-weight: 700; }
.pf-comment { display: inline-block; margin-top: 2px; background: var(--warn-bg); color: #7a5312; border-radius: 6px; padding: 2px 8px; font-size: 13px; }
.pf-evidence { background: #f7f8fa; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.pf-issue { padding: 10px 0; border-bottom: 1px solid var(--line); }
.pf-issue:last-of-type { border-bottom: 0; }
.pf-issue p { margin: 4px 0; }
.pf-finishes { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 8px; }
.pf-finishes label.check { margin: 0 !important; }
.pf-spec dd { overflow-wrap: anywhere; }
#current h3:first-of-type { margin-top: 10px; }

@media (max-width: 900px) {
  ol.pf-steps { grid-template-columns: 1fr 1fr; }
  .p-head-progress { text-align: left; width: 100%; }
  .p-step-head { flex-wrap: wrap; }
}
