.progression { width: min(1500px, calc(100% - 32px)); }
.progression-heading, .stage-actions, .stage-position { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.progression-heading { justify-content: space-between; }
.progression-heading h1 { margin: 0; }
.progression p { color: var(--muted); }
.progression a { color: var(--text); }
.progression-scroll { overflow: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); }
#progression-chart { position: relative; margin: auto; }
.progression-edges { position: absolute; inset: 0; pointer-events: none; color: var(--accent); }
.progression-stage { display: grid; place-items: center; box-sizing: border-box; text-align: center; position: absolute; font: 700 .86rem/1.2 system-ui, sans-serif; overflow-wrap: anywhere; }
.progression-stage, .progression-heading button, .stage-actions button {
  color: var(--text); background: var(--panel-hover); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px; cursor: pointer;
}
.progression-stage--coded { align-content: center; gap: 4px; }
.progression-stage-code { font-size: 1rem; }
.progression-stage-name { font-weight: 500; }
.progression-stage[data-kind="milestone"] { border-color: var(--accent); }
div.progression-stage { cursor: default; }
button.progression-stage:hover, button.progression-stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#stage-editor {
  width: min(440px, calc(100% - 32px)); max-height: 85dvh; overflow: auto;
  background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 14px; padding: 20px;
}
#stage-editor::backdrop { background: rgb(0 0 0 / .65); }
#stage-editor h2 { margin-top: 0; }
#stage-editor label { display: block; margin-block: 6px 10px; }
#stage-editor input:not([type="checkbox"]) {
  box-sizing: border-box; display: block; width: 100%; padding: 8px; font: inherit;
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px;
}
.stage-position label { flex: 1; }
#stage-connections { max-height: 200px; overflow: auto; border: 1px solid var(--border); }
#stage-connections input { margin-inline-end: 8px; }
#stage-error { color: var(--accent); }

.progression-stage[data-completion="done"] { background: #163e2a; border-color: #50b881; color: #e7fff0; }
html[data-theme="light"] .progression-stage[data-completion="done"] { background: #dbf5e4; border-color: #268151; color: #16442b; }
.progression-stage[data-completion="pending"] { border-style: dashed; }
.progression-completion { position: absolute; inset-block-start: 2px; inset-inline-end: 5px; font-size: .75rem; }
#personal-progress:empty { display: none; }
