.process-workspace { padding: 22px; }
.process-nav { border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 18px; }
.process-nav span { color: var(--muted); font-size: 14px; }
.process-workspace .card-heading { align-items: flex-start; }
.process-workspace .card-heading > div { display: block; }
.process-workspace .card-heading .field-help { margin-top: 8px; }
.process-workspace .card-heading h2 { max-width: 820px; }
.process-toolbar { margin: 18px 0 12px; }
.process-zoom-button { min-width: 40px; font-size: 20px; padding: 6px 12px; }
#process-zoom-value { min-width: 50px; text-align: center; font-variant-numeric: tabular-nums; }
.process-edit-tools { padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; }
.process-viewport { width: 100%; height: min(660px, 66vh); min-height: 340px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 10px; background: #fafafa; touch-action: pan-x pan-y; }
.process-viewport:focus-visible { outline: 3px solid #d71a5d; outline-offset: 3px; }
#process-size { position: relative; }
.process-canvas { position: absolute; left: 0; top: 0; transform-origin: top left; background-image: radial-gradient(var(--line) .7px, transparent .7px); background-size: 18px 18px; }
.process-node { position: absolute; z-index: 2; border: 1px solid #777; background: #fff; color: var(--ink); padding: 15px; text-align: center; font-size: 15px; line-height: 1.35; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; overflow-wrap: anywhere; }
.process-node:hover { border-color: var(--ink); box-shadow: 0 0 0 2px var(--line); }
.process-node span { font-weight: 550; }
.process-node small { font-size: 12px; color: var(--muted); }
.process-overview .process-node { font-size: 19px; }
.process-overview .process-node small { font-size: 16px; }
.process-overview .process-viewport { height: 440px; }
.process-type-start, .process-type-end { border-width: 2px; border-radius: 24px; }
.process-node.process-type-decision { background: transparent; padding: 20px 29px; border: 0; isolation: isolate; }
.process-type-decision::before { content: ''; position: absolute; inset: 0; z-index: -1; clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); background: #e7e7e7; }
.process-type-decision:focus-visible { outline: 3px solid #d71a5d; }
.process-type-reference { border-left: 5px double var(--ink); border-right: 5px double var(--ink); }
.process-edges { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; color: var(--muted); }
.process-edges > path { fill: none; stroke: currentColor; stroke-width: 1.5px; }
.process-edges > path.uncertain { stroke-dasharray: 5 4; }
.process-edges text { font-size: 12px; fill: var(--ink); paint-order: stroke; stroke: #fafafa; stroke-width: 4px; stroke-linejoin: round; }
.process-lane { position: absolute; left: 12px; background: #ffffffa8; border: 1px solid var(--line); }
.process-lane strong { position: sticky; left: 20px; display: block; width: 145px; padding: 16px; font-size: 13px; overflow-wrap: anywhere; }
.process-map-note { position: absolute; border: 1px dashed var(--muted); background: #fff; padding: 9px 14px; font-size: 13px; max-width: 600px; }
.process-meta, .process-support { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.process-meta summary, .process-support summary { font-weight: 550; padding: 8px 0; }
.process-meta p, .process-meta h3, .process-meta .hr-actions { margin-top: 14px; }
.process-support .hr-actions { margin: 12px 0; }
.process-support .button { white-space: normal; text-align: left; }
.process-legend { margin-top: 12px; }
.process-dialog { width: min(760px, calc(100% - 30px)); max-height: 88vh; overflow-y: auto; }
.process-dialog label { margin: 14px 0; }
.process-dialog .hr-actions { margin-top: 20px; }
.process-dialog textarea { min-height: 90px; }
#process-dialog-error { color: var(--danger); white-space: pre-wrap; margin-top: 12px; }
.process-source { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 14px; max-height: 55vh; overflow-y: auto; padding: 14px; background: var(--paper); }
html[data-theme="dark"] .process-viewport { background: #171717; }
html[data-theme="dark"] .process-node, html[data-theme="dark"] .process-map-note { background: #242424; }
html[data-theme="dark"] .process-type-decision::before { background: #383838; }
html[data-theme="dark"] .process-lane { background: #1c1c1ca8; }
html[data-theme="dark"] .process-edges text { stroke: #171717; }
@media(max-width:700px) { .process-workspace { padding: 14px; } .process-toolbar .button, .process-edit-tools .button { white-space: normal; } .process-workspace .card-heading { flex-wrap: wrap; } .process-viewport { height: 480px; } .process-dialog { padding: 18px; } }

/* Compact controls leave more room for the process itself. */
.process-workspace .process-nav { margin-bottom: 12px; padding-bottom: 10px; }
.process-workspace .process-toolbar { margin-top: 10px; gap: 8px; }
.process-workspace .process-viewport { height: clamp(340px, 64vh, 760px); }
.process-workspace .card-heading .field-help { margin-bottom: 0; }
