/* The process designer (AW-28): swimlanes, semi-BPMN shapes and the node detail pane, for design.html and demo step 2.
   Built from the tokens in site.css only. A charcoal canvas with a faint dot grid, dark cards with thin borders, the
   selected node in pink, AI in dashed cyan: the look of the founder's reference. */

.pd {
  --m-0: var(--charcoal); --m-1: var(--panel); --m-2: var(--elev);
  container-type: inline-size; min-width: 0; color: var(--white); font: 400 14px/1.5 var(--sans); text-align: left;
}
.pd *, .pd *::before, .pd *::after { box-sizing: border-box; }
.pd :where(p) { margin: 0; }
.pd :where(ul) { list-style: none; margin: 0; padding: 0; }
.pd i { font-style: normal; }
.mockup .pd-split { padding: 16px; }

.pd-split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.pd-main { display: grid; gap: 12px; min-width: 0; }
@container (max-width: 760px) {
  .pd-split { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Canvas ---------- */
.pd-canvas { position: relative; overflow: auto; max-width: 100%; background: var(--charcoal); border: 1px solid var(--hair); border-radius: 12px; overscroll-behavior-x: contain; }
.pd-canvas:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.pd-stage { position: relative; }
/* The dots are a pseudo-element, so the text above them is still judged against the flat charcoal. */
.pd-stage::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--hair) 1px, transparent 1.4px); background-size: 20px 20px; pointer-events: none; }
.pd-lane { position: absolute; left: 0; right: 0; border-top: 1px solid var(--hair); }
.pd-lane:first-child { border-top: 0; }
.pd-lane-label {
  position: sticky; left: 0; z-index: 6; display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 44px; height: 100%; padding: 6px 0; background: var(--panel); border-right: 1px solid var(--hair);
  font: 600 11px/1.2 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft);
  writing-mode: vertical-rl; transform: rotate(180deg); text-align: center;
}
.pd-lane.is-pool { background: var(--veil); border-top-style: dashed; border-top-color: var(--edge); }
.pd-lane.is-pool .pd-lane-label { width: max-content; max-width: 90vw; writing-mode: horizontal-tb; transform: none; justify-content: flex-start; padding: 0 14px 0 12px; letter-spacing: 0.04em; border-right: 1px solid var(--hair); }
.pd-lane.is-pool .pd-lane-label i { font-size: 14px; line-height: 1; }

.pd-wires { position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none; overflow: visible; }
.pd-w { fill: none; stroke-width: 1.4; }
.pd-w-seq { fill: none; stroke: var(--soft); stroke-width: 1.4; }
.pd-w-msg { fill: none; stroke: var(--white); stroke-width: 1.4; stroke-dasharray: 6 4; }
.pd-w-call { fill: none; stroke: var(--edge); stroke-width: 1.4; stroke-dasharray: 2 4; }
.pd-arr { fill: var(--soft); stroke: none; }
.pd-arr-msg { fill: none; stroke: var(--white); stroke-width: 1.4; }

.pd-flow {
  position: absolute; z-index: 2; padding: 0 3px; background: var(--charcoal); color: var(--soft); white-space: nowrap;
  font: 500 11px/1.3 var(--sans); transform: translate(-50%, calc(-100% - 2px)); pointer-events: none;
}
.pd-flow.is-below { transform: translate(-50%, 3px); }
.pd-flow.is-v { transform: translate(8px, -50%); }
.pd-flow.is-left { transform: translate(calc(-100% - 8px), -50%); }
.pd-flow.is-right { transform: translate(8px, -50%); }

/* ---------- Nodes: buttons in the app, spans in the static copy ---------- */
.pd-node { position: absolute; z-index: 3; margin: 0; padding: 0; border: 0; background: none; color: var(--white); font: inherit; text-align: left; cursor: pointer; }
span.pd-node { cursor: default; }
.pd-node:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 10px; }
.pd-node[data-kind=user], .pd-node[data-kind=ai], .pd-node[data-kind=service] {
  display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 8px 10px;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 10px; box-shadow: var(--shadow-sm);
}
.pd-node[data-kind=user]:hover, .pd-node[data-kind=service]:hover { border-color: var(--soft); }
.pd-node[data-kind=ai] { border: 1px dashed var(--cyan); }
.pd-node[data-kind=ai]:hover { background: var(--elev); }
.pd-type { display: flex; align-items: center; gap: 6px; font: 500 10.5px/1.2 var(--sans); letter-spacing: 0.07em; text-transform: uppercase; color: var(--soft); }
.pd-type svg { flex: none; width: 12px; height: 12px; fill: currentColor; }
.pd-type svg.pd-stroke { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.pd-node[data-kind=ai] .pd-type { color: var(--cyan); }
.pd-type i { font-size: 12px; line-height: 1; }
.pd-name { display: block; font: 600 12.5px/1.3 var(--sans); color: var(--white); overflow-wrap: anywhere; }
.pd-tool { font: 500 11.5px/1.25 var(--mono); color: var(--cyan); }

/* Selected: pink outline, the raised surface. The shapes take the pink on their stroke. */
.pd-node[aria-pressed=true], .pd-node.is-selected { z-index: 4; }
.pd-node[aria-pressed=true][data-kind=user], .pd-node[aria-pressed=true][data-kind=ai], .pd-node[aria-pressed=true][data-kind=service],
.pd-node.is-selected[data-kind=user], .pd-node.is-selected[data-kind=ai], .pd-node.is-selected[data-kind=service] {
  background: var(--elev); outline: 2px solid var(--pink); outline-offset: 2px;
}
.pd-node[aria-pressed=true][data-kind=user], .pd-node.is-selected[data-kind=user] { border-color: var(--pink); }
.pd-node[aria-pressed=true] .pd-shape, .pd-node.is-selected .pd-shape { stroke: var(--pink); }
.pd-node[aria-pressed=true] .pd-shape path[fill=none], .pd-node.is-selected .pd-shape path[fill=none] { stroke: var(--pink); }
/* Focus on the selected node: the cyan ring outside, the pink mark kept on the card's edge. */
.pd-node[aria-pressed=true]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; }
.pd-node[aria-pressed=true]:is([data-kind=user], [data-kind=ai], [data-kind=service]):focus-visible { box-shadow: 0 0 0 2px var(--pink); }

/* Events and gateways: an SVG shape and, for some, a caption. */
.pd-shape { display: block; width: 100%; height: 100%; overflow: visible; fill: var(--panel); stroke: var(--soft); }
.pd-shape path[fill=none], .pd-shape rect[fill=none] { fill: none; }
.pd-node[data-kind=gateway] .pd-shape { stroke-linejoin: round; }
.pd-node:hover .pd-shape { stroke: var(--white); }
.pd-node[data-kind=timer], .pd-node[data-kind=message][data-node^=t] { z-index: 5; }
.pd-cap {
  position: absolute; left: 50%; top: 100%; margin-top: 4px; transform: translateX(-50%); width: 112px; text-align: center;
  font: 500 11px/1.25 var(--sans); color: var(--soft); pointer-events: none;
}
.pd-cap.is-top { top: auto; bottom: 100%; margin: 0 0 5px; }
.pd-cap.pd-rule.is-under { left: 50%; top: 100%; bottom: auto; margin: 2px 0 0; transform: translateX(-50%); text-align: center; }
.pd-cap.pd-rule.is-center { left: 50%; transform: translateX(-50%); text-align: center; }
.pd-cap.pd-rule { left: 70%; top: auto; bottom: 100%; margin: 0 0 -2px; transform: none; width: max-content; text-align: left; font: 500 10.5px/1.2 var(--mono); }

/* ---------- Legend ---------- */
.pd-legend { padding: 12px 14px 14px; border: 1px solid var(--hair); border-radius: 12px; background: var(--panel); }
.pd-legend ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 8px 18px; margin: 8px 0 10px; }
.pd-legend li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--soft); }
.pd-legend li b { color: var(--white); font-weight: 600; }
.pd-leg-ic { flex: none; display: grid; place-items: center; width: 40px; height: 24px; }
.pd-leg-ic svg { width: 24px; height: 24px; fill: var(--panel); stroke: var(--soft); }
.pd-leg-ic svg.pd-stroke { fill: none; stroke: var(--white); stroke-width: 1.5; stroke-linecap: round; width: 16px; height: 16px; }
.pd-leg-ic svg.pd-fillic { fill: var(--white); stroke: none; width: 16px; height: 16px; }
.pd-leg-ic svg[viewBox="0 0 40 10"] { width: 40px; height: 10px; fill: none; }
.pd-leg-ic svg path[fill=none] { fill: none; }
.pd-leg-ic .pd-w-call { stroke: var(--soft); }
.pd-leg-ic .pd-arr { fill: var(--soft); }
.pd-star { color: var(--cyan); font-size: 16px; line-height: 1; padding: 2px 8px; border: 1px dashed var(--cyan); border-radius: 6px; }
.pd-note { color: var(--soft); font-size: 12.5px; }

/* ---------- Pane ---------- */
.pd-pane { min-width: 0; padding: 16px 16px 6px; background: var(--panel); border: 1px solid var(--hair); border-radius: 12px; }
.pd-fl { font: 500 10.5px/1.3 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft); margin-bottom: 6px; }
.pd-kicker { margin-bottom: 4px; }
.pd-h { font: 600 19px/1.25 var(--display); letter-spacing: -0.01em; color: var(--white); overflow-wrap: anywhere; }
.pd-chips { margin-top: 8px; }
.pd-f { padding: 12px 0; border-top: 1px solid var(--hair); margin-top: 12px; }
.pd-h + .pd-f, .pd-chips + .pd-f { margin-top: 12px; }
.pd-f > p:not(.pd-fl), .pd-f .pd-list { font-size: 13.5px; line-height: 1.6; color: var(--white); }
.pd-f .m-sub { font-size: 12.5px; margin-top: 2px; }
.pd-f .m-meta { font-size: 13px; }
.pd-list li { padding-left: 14px; position: relative; }
.pd-list li::before { content: "\2022"; position: absolute; left: 2px; color: var(--soft); }
.pd-caps { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-capchip { display: inline-block; padding: 1px 8px; border: 1px solid var(--cyan-line); border-radius: 6px; background: var(--cyan-veil); font: 500 12px/1.6 var(--mono); }
.pd-mono { font: 400 12.5px/1.5 var(--mono); }
.pd-rows { display: grid; gap: 8px; }
.pd-rows li { padding: 10px 12px; border: 1px solid var(--hair); border-radius: 10px; background: var(--charcoal); display: grid; gap: 2px; }
.pd-rows .pd-fl { margin: 4px 0 0; }
.pd-rows .pd-fl:first-child { margin-top: 0; }
.pd-rows p:not(.pd-fl) { font-size: 13px; line-height: 1.5; }
.pd-then { font-weight: 600; }
.pd-f .m-code { font-size: 12px; max-height: 220px; overflow: auto; }
.pd-f .m-role { white-space: normal; }
.pd-more { border-top: 1px solid var(--hair); }
.pd-link { appearance: none; background: none; border: 0; padding: 0; font: 500 13.5px/1.4 var(--sans); color: var(--cyan); cursor: pointer; text-align: left; }
button.pd-link:hover { text-decoration: underline; }
.pd-link:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

/* ---------- Zoom bar (the app only; the static copy has none) ---------- */
.pd-bar { display: flex; align-items: center; gap: 6px; }
.pd-btn {
  appearance: none; min-width: 34px; height: 30px; padding: 0 12px; border: 1px solid var(--edge); border-radius: 8px;
  background: var(--panel); color: var(--white); font: 500 13px/1 var(--sans); cursor: pointer;
}
.pd-btn:hover:not([aria-disabled=true]) { border-color: var(--soft); background: var(--elev); }
.pd-btn[aria-disabled=true] { color: var(--soft); border-style: dashed; cursor: not-allowed; }
.pd-btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.pd-zoom { min-width: 48px; text-align: center; font: 500 12.5px/1 var(--mono); color: var(--soft); }
