/*
 * Work → Processes. The canvas rules below are copied from public/process/process.css
 * (.intent-canvas … .intent-rubber-connector) so a process drawn here looks exactly like
 * the same process in Process Studio: same engine (intent-engine.js), same palette.
 * Copy it again from there if the Studio canvas changes.
 *
 * The editor CHROME (.wp-studio) mirrors Studio's editor too — topbar, Components palette,
 * canvas shell, AI rail, right-click menu, empty-canvas hint — using Studio's own class
 * names and literal values from process.css (v2 theme block, palette-icon, context-menu,
 * process-ai-*). Scoped under .wp-studio so none of it leaks into the rest of Work.
 */

/* List page: the AI box above the list. */
.wp-ai { display: flex; gap: 8px; flex-wrap: wrap; }
.wp-ai textarea { flex: 1 1 320px; min-height: 64px; font: inherit; padding: 8px 10px; border: 1px solid #d0d5dd; border-radius: 8px; resize: vertical; }

/* ── Studio editor shell ── */
.wp-studio { display: flex; flex-direction: column; height: max(480px, calc(100vh - 250px)); border: 1px solid #e4e7ec; border-radius: 12px; overflow: hidden; background: #fff; color: #27272a; }
.wp-studio .wp-topbar { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; padding: 0 16px; border-bottom: 1px solid #e4e7ec; box-shadow: 0 1px 0 rgba(16, 24, 40, .04); }
.wp-studio .process-title { display: flex; align-items: center; gap: 9px; min-width: 0; }
.wp-studio .breadcrumb { border: 0; background: transparent; color: var(--accent, #6254b9); font: inherit; font-size: 13px; font-weight: 600; padding: 6px 4px; border-radius: 7px; cursor: pointer; }
.wp-studio .breadcrumb:hover, .wp-studio .breadcrumb:focus-visible { background: #f4f7f7; }
.wp-studio .breadcrumb-separator { color: #98a2b3; }
.wp-studio .wp-title-input { border: 0; background: transparent; font: inherit; font-weight: 650; font-size: 14px; min-width: 210px; padding: 7px; border-radius: 7px; color: #27272a; }
.wp-studio .wp-title-input:hover, .wp-studio .wp-title-input:focus { background: #f4f7f7; outline: 0; }
.wp-studio .top-actions { display: flex; align-items: center; gap: 6px; }
.wp-studio .button { min-height: 0; height: 34px; border: 1px solid #e4e7ec; background: #fff; border-radius: 8px; padding: 0 12px; cursor: pointer; font: inherit; font-weight: 600; font-size: 13px; color: #344054; }
.wp-studio .button:hover:not(:disabled) { background: #f4f7f7; }
.wp-studio .button:disabled { opacity: .42; cursor: not-allowed; }
.wp-studio .button.primary { background: var(--accent, #6254b9); border-color: var(--accent, #6254b9); color: #fff; }
.wp-studio .button.primary:hover:not(:disabled) { background: var(--accent-pressed, #4e429c); }
.wp-studio .compact-action { display: inline-flex; gap: 6px; align-items: center; }
.wp-studio .canvas-control-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.wp-studio .save-state { min-width: 56px; margin-left: 6px; color: #667085; font-size: 11px; font-weight: 650; white-space: nowrap; }

.wp-studio .wp-workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: 198px minmax(0, 1fr) 300px; }

/* Components palette (process.css .palette / .palette-item / .palette-icon). */
.wp-studio .palette { border-right: 1px solid #e4e7ec; padding: 14px 10px; background: #fff; overflow-y: auto; }
.wp-studio .palette-heading { height: 34px; display: flex; align-items: center; padding: 0 8px 8px; font-size: 13px; font-weight: 650; color: #344054; }
.wp-studio .palette-group { margin: 12px 9px 5px; color: #98a2b3; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.wp-studio .palette-divider { height: 1px; margin: 10px 8px; background: #e4e7ec; }
.wp-studio .palette-item, .wp-palette-ghost { width: 100%; min-height: 38px; display: flex; align-items: center; gap: 10px; padding: 7px 9px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #344054; font: inherit; font-size: 12px; font-weight: 550; cursor: grab; touch-action: none; user-select: none; }
.wp-studio .palette-item:hover { background: #f3f5ff; border-color: #e0e5ff; color: #2446bd; }
.wp-palette-ghost { position: fixed; z-index: 1000; width: 160px; pointer-events: none; background: #fff; border-color: #e0e5ff; box-shadow: 0 10px 24px rgba(16, 24, 40, .16); opacity: .92; }
.wp-studio .palette-icon, .wp-palette-ghost .palette-icon { display: block; width: 32px; height: 32px; flex: 0 0 32px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.wp-studio .palette-icon.event-end, .wp-palette-ghost .palette-icon.event-end { color: #111; stroke-width: 3.3; }
.wp-studio .palette-icon.activity-icon, .wp-palette-ghost .palette-icon.activity-icon { width: 36px; height: 30px; flex-basis: 36px; color: #b5b5b5; stroke-width: 1.65; }
.wp-studio .palette-icon.gateway-icon, .wp-palette-ghost .palette-icon.gateway-icon { color: #b5b5b5; stroke-width: 1.8; }
.wp-studio .palette-icon.gateway-icon .gateway-mark, .wp-palette-ghost .gateway-mark { color: #5f5f5f; stroke-width: 2.3; }
.wp-studio .palette-icon.support-icon { color: #8c8c8c; stroke-width: 1.65; }
.wp-studio .palette-item:hover .palette-icon.activity-icon,
.wp-studio .palette-item:hover .palette-icon.support-icon { color: #3156d9; }

/* Canvas shell: grey surround, white rounded sheet on a dot grid. */
.wp-studio .canvas-shell { position: relative; overflow: hidden; background: #eef0f3; }
.wp-studio .canvas-viewport { position: absolute; inset: 62px 12px 12px; overflow: auto; border: 1px solid #dfe3e8; border-radius: 12px; background-color: #fbfcfd; background-image: radial-gradient(#d9dde5 .8px, transparent .8px); background-size: 18px 18px; box-shadow: 0 2px 8px rgba(16, 24, 40, .04); }
.wp-studio .canvas-viewport .intent-canvas { height: auto; min-height: 100%; overflow: visible; outline: 0; }
.wp-studio .intent-svg { touch-action: none; user-select: none; }
/* Studio's canvas view controls (process.css .canvas-toolbar / .canvas-zoom-group). */
.wp-studio .canvas-toolbar { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 6; display: flex; align-items: center; gap: 8px; }
.wp-studio .canvas-toolbar button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 11px; border: 1px solid #e0e7e5; border-radius: 8px; background: #fff; color: #42534f; font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.wp-studio .canvas-toolbar button:hover { background: #f7f6fd; border-color: #cfcbe9; color: var(--accent, #6254b9); }
.wp-studio .canvas-zoom-group { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid #e0e7e5; border-radius: 10px; background: #f5f6f8; }
.wp-studio .canvas-zoom-group button { height: 30px; width: 32px; padding: 0; border: 0; background: transparent; }
.wp-studio .canvas-zoom-group button[data-wp="zoom-reset"] { width: 54px; font-variant-numeric: tabular-nums; }
.wp-studio .canvas-toolbar .canvas-control-icon { width: 18px; height: 18px; }
.wp-studio .canvas-empty-state { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 24px; pointer-events: none; z-index: 5; color: #667085; font: 500 15px "Segoe UI", system-ui, sans-serif; text-align: center; }
.wp-rename { position: absolute; z-index: 6; font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid #3156d9; border-radius: 6px; background: #fff; box-shadow: 0 4px 12px rgba(16,24,40,.15); }
.intent-node.dragging { opacity: .75; }

/* AI rail (process.css .process-context-* / .process-ai-*). */
.wp-studio .process-context-rail { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid #e4e7ec; background: #fff; }
.wp-studio .process-ai-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.wp-studio .process-ai-messages { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; padding: 14px 12px; }
.wp-studio .process-ai-empty { margin: auto 0; text-align: center; color: #667085; }
.wp-studio .process-ai-empty > span { display: grid; place-items: center; width: 42px; height: 42px; margin: 0 auto 10px; border-radius: 13px; background: color-mix(in srgb, var(--accent, #6254b9) 12%, #fff); color: var(--accent, #6254b9); font-size: 20px; }
.wp-studio .process-ai-empty h3 { margin: 0 0 6px; color: #27272a; font-size: 15px; }
.wp-studio .process-ai-empty p { margin: 0 auto; max-width: 230px; font-size: 11px; line-height: 1.5; }
.wp-studio .process-ai-message { max-width: 92%; padding: 9px 11px; border-radius: 12px; font-size: 12px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.wp-studio .process-ai-message.user { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--accent, #6254b9); color: #fff; }
.wp-studio .process-ai-message.assistant { align-self: flex-start; border-bottom-left-radius: 4px; background: #f2f4f7; color: #273044; }
.wp-studio .process-ai-form { padding: 12px; border-top: 1px solid #e4e7ec; background: #fff; }
.wp-studio .process-ai-form textarea { width: 100%; box-sizing: border-box; min-height: 74px; resize: vertical; border: 1px solid #d0d5dd; border-radius: 11px; padding: 10px 11px; color: #27272a; font: inherit; font-size: 12px; line-height: 1.45; outline: none; }
.wp-studio .process-ai-form textarea:focus { border-color: #8da4ef; box-shadow: 0 0 0 3px rgba(49, 86, 217, .1); }
.wp-studio .process-ai-form-footer { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.wp-studio .process-ai-form-footer > span { flex: 1; color: #667085; font-size: 9px; }
.wp-studio .process-ai-form-footer .button { min-width: 66px; }

/* Right-click menu (process.css .context-menu) and the inline confirm card. */
.context-menu { position: fixed; z-index: 1000; width: 200px; padding: 6px; border: 1px solid #d9dce5; border-radius: 11px; background: #fff; box-shadow: 0 16px 38px rgba(20, 27, 45, .2); }
.context-menu button { display: flex; width: 100%; min-height: 34px; align-items: center; border: 0; border-radius: 7px; background: transparent; color: #273044; padding: 7px 10px; text-align: left; font: inherit; font-size: 12px; cursor: pointer; }
.context-menu button:hover, .context-menu button:focus-visible { background: #f1f3ff; color: #243ec0; outline: none; }
.context-menu button.danger { color: #b4232f; }
.context-menu button.danger:hover, .context-menu button.danger:focus-visible { background: #fff0f1; }
.context-menu .menu-separator { height: 1px; margin: 5px 4px; background: #e7e9ef; }
.wp-confirm { position: fixed; z-index: 1001; width: 320px; padding: 14px; border: 1px solid #d9dce5; border-radius: 11px; background: #fff; box-shadow: 0 16px 38px rgba(20, 27, 45, .2); font-size: 13px; }
.wp-confirm p { margin: 0 0 12px; color: #273044; line-height: 1.45; }
.wp-confirm div { display: flex; justify-content: flex-end; gap: 8px; }
.wp-confirm .button.danger { background: #b4232f; border-color: #b4232f; color: #fff; }

@media (max-width: 1100px) { .wp-studio .wp-workspace { grid-template-columns: 170px minmax(0, 1fr); } .wp-studio .process-context-rail { display: none; } }

.intent-canvas {
  height: calc(100% - 96px);
  min-height: 320px;
  overflow: auto;
}
.intent-svg {
  display: block;
  width: 100%;
  min-width: 760px;
  height: 100%;
  min-height: 360px;

  /* The canvas palette, in one place.
   *
   * "the process studio colour palette, design looks childish - want it to be more
   *  BIC where its greyscale with start being a green but not thick lines and end
   *  being black but bold"
   *
   * It was periwinkle boxes with drop shadows on a lavender band, cream diamonds with
   * orange borders, and a red end event. Six hues competing on a diagram whose whole
   * job is to be read, none of them meaning anything — colour was decoration, so it
   * carried no information and cost all of its authority.
   *
   * Greyscale here is not a preference, it is what makes the two exceptions legible.
   * START is the only colour on the canvas and it is a THIN ring: it marks where to
   * begin without shouting. END is not a colour at all, it is WEIGHT — black at more
   * than double the stroke of everything else. That pairing is the BPMN convention
   * every modelling tool uses, and it survives being printed, photocopied and read by
   * someone who cannot distinguish red from green, which a red end event does not.
   *
   * The accent is reserved for INTERACTION — selection, hover, drag. In a grey
   * picture one blue is unmistakably "you are touching this", which is the whole
   * reason to spend the only other colour there.
   *
   * WRITTEN AS LITERAL HEX, NOT CUSTOM PROPERTIES, AND THAT IS NOT A STYLE CHOICE.
   * This stylesheet is inlined into the captured SVG by intentCanvasSnapshot and
   * rasterised outside a browser, and that rasteriser does not resolve var(). The
   * first cut of this palette used custom properties, looked correct in the editor,
   * and rendered a SOLID BLACK RECTANGLE everywhere else - every AI visual review,
   * every controlled PDF, every exported case record - because an unresolved fill
   * falls back to black. Caught by rendering it; the stylesheet itself read fine.
   *
   * So: one palette, listed here, repeated as literals below. If you reach for
   * var() here, render the canvas and look at the PNG before believing it.
   *
   *   #2b2b2b  step names
   *   #5f5f5f  lane names, connector labels, event and gateway symbols
   *   #8c8c8c  connectors
   *   #b5b5b5  step and gateway borders
   *   #f7f7f7  step fill
   *   #ffffff  event and gateway fill, lane band
   *   #d4d4d4  lane divider
   *   #2f8f4e  START - the one colour, thin
   *   #111111  END - bold, not coloured
   *   #3156d9  interaction only: selection, hover, drag
   */
}
/* The typeface the canvas is READ in, stated on the SVG itself.
 *
 * In the browser this inherits from body. The server capture — what the AI visual
 * review looks at, what a share link renders, what the exported record shows — is
 * this same SVG rasterised by librsvg, which inherits nothing from any page: with no
 * font-family on the text it fell back to the rasteriser's default, a serif. The
 * reviewer was judging a Times New Roman diagram the customer never sees, and every
 * label measurement (LABEL_CHAR_WIDTH is a sans metric) was off. Named fonts first,
 * then the generic the server's fontconfig resolves (DejaVu Sans on the fleet). */
.intent-svg text {
  font-family: Inter, "Segoe UI", system-ui, -apple-system, "DejaVu Sans", Arial, sans-serif;
}
.intent-lane rect {
  fill: #ffffff;
  stroke: #d4d4d4;
}
.intent-lane {
  cursor: pointer;
  outline: none;
}
.intent-lane:hover rect,
.intent-lane:focus rect,
.intent-lane.selected rect {
  fill: #fafafa;
  stroke: #3156d9;
  stroke-width: 2;
}
.intent-lane text {
  fill: #5f5f5f;
  font-size: 12px;
  /* 750 was doing the shouting the lavender band used to do. A lane name is a
     caption, not a heading. */
  font-weight: 600;
}
/* The lane's name is its handle: drag it above or below another lane to reorder. */
.intent-lane > text {
  cursor: grab;
}
.intent-canvas.reordering-lane,
.intent-canvas.reordering-lane .intent-lane > text {
  cursor: grabbing;
}
.intent-lane.reorder-target rect {
  stroke: #3156d9;
  stroke-width: 2;
  stroke-dasharray: 6 4;
}
.inspector-section.lane-order {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.inspector-section.lane-order > span {
  flex-basis: 100%;
  font-size: 12px;
  color: #5f5f5f;
}
.inspector-section.lane-order .inspector-note {
  flex-basis: 100%;
}
.intent-lane-resize {
  cursor: ns-resize;
  outline: none;
}
.intent-lane-resize rect {
  fill: transparent;
  stroke: none;
}
.intent-lane-resize path {
  fill: none;
  stroke: #aeb9ce;
  stroke-linecap: round;
  stroke-width: 3;
  opacity: 0.45;
  transition:
    opacity 0.12s,
    stroke 0.12s;
}
.intent-lane:hover + .intent-lane-resize path,
.intent-lane-resize:hover path,
.intent-lane-resize:focus-visible path,
.intent-canvas.resizing-lane .intent-lane-resize path {
  opacity: 1;
  stroke: #4f6fdb;
}
.intent-lane-resize:focus-visible rect {
  stroke: #4f6fdb;
  stroke-width: 2;
}
.intent-canvas.resizing-lane {
  cursor: ns-resize;
  user-select: none;
}
.intent-edge {
  fill: none;
  marker-end: url(#intent-arrow);
  stroke: #8c8c8c;
  /* Thinner as well as greyer. "not thick lines" was about the whole canvas, and a
     connector at 2px against a 1.2px box border reads as the connector being the
     important part, which is backwards. */
  stroke-width: 1.6;
}
/* BPMN: a data association is a DOTTED line with an open arrowhead, and it is not part
 * of the sequence flow. Drawn solid, a data object looks like a step in the process.
 *
 * The rules that did this lived on `.edge`, which belonged to the DOM canvas that was
 * deleted — so on the canvas people actually use, an association was indistinguishable
 * from the flow itself. */
.intent-edge-group.association .intent-edge,
.intent-edge-group.data_association .intent-edge {
  stroke-dasharray: 4 4;
  stroke: #8a8a8a;
  marker-end: url(#intent-open-arrow);
}

.intent-edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  cursor: pointer;
}
/* The label's hit area. Invisible, exactly the box the placer reserved, and the only
   part of a caption that takes a pointer — the text above it stays pointer-events:none
   so a press between two glyphs still lands on the label rather than the line beneath. */
.intent-edge-label-hit {
  fill: transparent;
  pointer-events: all;
  cursor: grab;
}
.intent-edge-label-hit.dragging {
  cursor: grabbing;
}
.intent-edge-label {
  paint-order: stroke;
  pointer-events: none;
  fill: #5f5f5f;
  stroke: #ffffff;
  stroke-width: 5px;
  font-size: 12px;
  /* A branch label is a caption on a line, not a heading. At 700 against a 1.6px grey
     connector the words outweighed the route they describe. */
  font-weight: 500;
  text-anchor: middle;
}
/* Forward-loop and rework routes stay distinguishable but stop competing: these
   two carry real meaning, so they are muted rather than greyed away entirely. */
.intent-edge-group.forward-loop-route .intent-edge{stroke:#4a6b64;stroke-width:1.9}.intent-edge-group.forward-loop-route .intent-edge-label{fill:#3f5b55}.intent-edge-group.rework-route .intent-edge{stroke:#7a6449;stroke-width:1.9}.intent-edge-group.rework-route .intent-edge-label{fill:#6a5540}
/* No browser focus ring on canvas shapes.
 *
 * "when i click on the connector, a large box surrounds the connector - why do we need
 *  a large box when we select the connector? It already highlights in blue which is
 *  fine"
 *
 * Every shape on this canvas carries tabindex="0" so it can be reached by keyboard, and
 * the browser's default ring is a rectangle around the element's BOUNDING BOX. On a
 * connector that spans half the diagram that is an enormous box — measured in a real
 * browser as outline: auto 5px — drawn around a route that is already unmistakably
 * blue.
 *
 * Suppressed only for the pointer. Keyboard focus still shows, through the
 * :focus-visible rules below and on .intent-node: the blue stroke IS the indicator, and
 * it follows the shape instead of boxing it.
 */
.intent-edge-group:focus,
.intent-node:focus,
.intent-artifact:focus,
.intent-lane:focus {
  outline: none;
}

/* :focus-VISIBLE, not :focus.
 *
 * A connector group carries tabindex="0", so clicking it focuses it — and the drag
 * handlers call preventDefault, so clicking a STEP afterwards never moves focus away.
 * The connector therefore stayed blue for the rest of the session: "once that connector
 * is highlighted, it stays highlighted and i cant deslect - if i click on another
 * activity box, the activity box highlights but the connector doesnt deselect."
 *
 * :focus-visible keeps the ring for keyboard users, where it is the only way to tell
 * where you are, and drops it for a mouse click, where selection already says it. */
.intent-edge-group:hover .intent-edge,
.intent-edge-group:focus-visible .intent-edge,
.intent-edge-group.selected .intent-edge,
.intent-edge-group.drop-target .intent-edge {
  stroke: #3156d9;
  stroke-width: 3;
}
.intent-edge-group.drop-target .intent-edge {
  stroke-dasharray: 7 4;
}

/* Grab points on the selected connector ------------------------------------
 * A filled dot is a bend that exists; a hollow one is the middle of a segment,
 * where a bend appears if you drag it. Both are drawn only for the selected
 * connector — on every connector at once they bury a busy diagram in dots.
 * Sized against the 1.6px connector: big enough to hit, small enough that four
 * of them on one route still read as a line rather than a string of beads. */
.intent-edge-bend,
.intent-edge-ghost {
  cursor: grab;
  stroke: #3156d9;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.intent-edge-bend {
  fill: #3156d9;
}
.intent-edge-ghost {
  fill: #ffffff;
  /* Quiet until aimed at, so the route reads as a route and not as a control rig. */
  opacity: .55;
}
.intent-edge-ghost:hover,
.intent-edge-bend:hover {
  opacity: 1;
  r: 9;
}
.intent-edge-bend.dragging,
.intent-edge-ghost.dragging {
  cursor: grabbing;
  opacity: 1;
}

/* The two ends. Square, because they do something different from a bend: a bend
   moves the line, an end moves what the line MEANS. */
.intent-edge-endpoint {
  cursor: grab;
  fill: #ffffff;
  stroke: #3156d9;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.intent-edge-endpoint:hover,
.intent-edge-endpoint.dragging {
  fill: #3156d9;
  cursor: grabbing;
}
/* The step a dragged end would land on. Nothing else on the canvas is outlined
   this way, so there is no doubt about where releasing will attach it. */
.intent-node.endpoint-target .intent-node-shape,
.intent-node.endpoint-target rect:not(.intent-node-label-hit),
.intent-node.endpoint-target circle:not(.intent-anchor):not(.intent-anchor-hit) {
  stroke: #3156d9;
  stroke-width: 2.5;
}
.intent-node {
  cursor: grab;
  outline: none;
}
.intent-node:active {
  cursor: grabbing;
}
.intent-node:hover circle:not(.intent-anchor):not(.intent-anchor-hit),
.intent-node:hover rect:not(.intent-node-label-hit),
.intent-node:hover path,
.intent-node:focus-visible circle:not(.intent-anchor):not(.intent-anchor-hit),
.intent-node:focus-visible rect:not(.intent-node-label-hit),
.intent-node:focus-visible path,
.intent-node.selected circle:not(.intent-anchor):not(.intent-anchor-hit),
.intent-node.selected rect:not(.intent-node-label-hit),
.intent-node.selected path,
.intent-node.multi-selected circle:not(.intent-anchor):not(.intent-anchor-hit),
.intent-node.multi-selected rect:not(.intent-node-label-hit),
.intent-node.multi-selected path {
  stroke: #3156d9;
  stroke-width: 3.2;
}
.intent-node.dragging {
  opacity: 0.75;
}
.intent-node circle:not(.intent-anchor):not(.intent-anchor-hit),
.intent-node rect:not(.intent-node-label-hit),
.intent-node path {
  fill: #ffffff;
  stroke: #b5b5b5;
  stroke-width: 1.2;
  /* The drop shadow went with the periwinkle. A lifted card says "click me", which is
     wrong for every box on a diagram, and it is the single strongest contributor to
     the toy look. */
  filter: none;
}
/* Steps are the filled shape; events and gateways sit on white so their outline is
   the whole of what distinguishes them. */
.intent-node rect:not(.intent-node-label-hit) {
  fill: #f7f7f7;
}
.intent-node.start circle:not(.intent-anchor):not(.intent-anchor-hit) {
  stroke: #2f8f4e;
  /* Thin, deliberately. Green already carries it, and a heavy green ring next to a
     heavy black one would leave the two ends of the process arguing. */
  stroke-width: 1.8;
}
.intent-node.end circle:not(.intent-anchor):not(.intent-anchor-hit) {
  stroke: #111111;
  /* The only heavy stroke on the canvas. This is what the eye finds when it looks
     for where the process stops, and it works in a photocopy. */
  stroke-width: 4;
}
/* Review markup — what an external reviewer drew, sitting ABOVE the diagram and never
 * part of it. Warm orange because every colour the process itself uses is cool, so one
 * glance separates the process from somebody's opinion of it. */
.review-markup line,
.review-markup rect {
  fill: none;
  stroke: #c2410c;
  stroke-width: 2.4;
  stroke-linecap: round;
  pointer-events: none;
}
.review-markup rect { stroke-dasharray: 7 5; }
.review-markup .pin { fill: #c2410c; stroke: #fff; stroke-width: 2; pointer-events: none; }
/* A step that opens another process.
 *
 * The boxed plus is BPMN's collapsed sub-process marker, and it is the only thing that
 * distinguishes a door from a task. Grey like the rest of the canvas furniture — this is
 * a wayfinding mark, not a status, and the canvas spends its colour on start, end and
 * selection.
 */
.intent-node.subprocess .intent-subprocess-marker rect,
.intent-node.subprocess .intent-subprocess-marker path {
  fill: none;
  stroke: #5f5f5f;
  stroke-width: 1.4;
  stroke-linecap: round;
}
.intent-node.subprocess {
  cursor: pointer;
}
/* The door out of a sub-process step: appears when the step is approached, opens
   on a single click, previews on hover. The BPMN boxed-plus stays as the always-
   visible standard notation; this is the affordance that says "you can go there". */
.intent-subprocess-open circle { fill: #12707a; stroke: #fff; stroke-width: 1.6; cursor: pointer; }
.intent-subprocess-open path { fill: none; stroke: #fff; stroke-width: 1.8; pointer-events: none; }
.intent-subprocess-open { opacity: 0; transition: opacity 120ms ease; }
.intent-node.subprocess:hover .intent-subprocess-open,
.intent-node.subprocess.selected .intent-subprocess-open { opacity: 1; }

.intent-node circle.intent-event-inner,
.intent-node .intent-event-symbol {
  fill: none;
  filter: none;
  stroke: #5f5f5f;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.intent-node .intent-event-symbol.filled {
  fill: #5f5f5f;
}
.intent-node.start .intent-event-symbol,
.intent-node.end .intent-event-symbol,
.intent-node.start circle.intent-event-inner,
.intent-node.end circle.intent-event-inner {
  stroke: #5f5f5f;
  stroke-width: 1.8;
}
.intent-node text {
  /* THE GLYPHS ARE NOT THE TARGET. The caption's hit box is a SIBLING of this text, not
     its parent, so with the default `visiblePainted` a press landing on a letter has the
     text as its target — and `closest("[data-intent-node-label]")` walks straight past
     the rect to the node group, which then drags the whole shape. Which is the bug.
     `.intent-edge-label` has said this for the same reason for as long as connector
     captions have been draggable. */
  pointer-events: none;
  fill: #2b2b2b;
  font-size: 12px;
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: middle;
}
.intent-node.start text,
.intent-node.end text,
.intent-node.decision text {
  dominant-baseline: auto;
}
.intent-node.decision path {
  /* Was a cream diamond with an orange border — the loudest thing on the canvas, for
     a shape whose meaning is already carried by being a diamond. */
  fill: #ffffff;
  stroke: #b5b5b5;
}
.intent-node .intent-task-marker,
.intent-node.decision .intent-gateway-symbol {
  fill: none;
  filter: none;
  stroke: #5f5f5f;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}
.intent-node .intent-task-marker circle,
.intent-node .intent-task-marker rect,
.intent-node .intent-task-marker path,
.intent-node.decision circle.intent-gateway-symbol,
.intent-node.decision path.intent-gateway-symbol {
  fill: none;
  filter: none;
  stroke: #5f5f5f;
  stroke-width: 2;
}
.intent-node .intent-task-marker.send {
  fill: #5f5f5f;
}
.intent-node .intent-task-marker.send path {
  fill: #5f5f5f;
}
.intent-node .intent-task-marker.receive {
  fill: #fff;
}
.intent-artifact {
  cursor: grab;
  outline: none;
}
.intent-artifact:active {
  cursor: grabbing;
}
/* An artifact belongs to the same drawing as everything else: the canvas greys, not a
 * white card with a blue border. The renderer used to hard-code those inline, which beat
 * this rule and made every dropped shape look like it came from somewhere else. */
.intent-artifact rect,
.intent-artifact ellipse,
.intent-artifact path {
  fill: var(--artifact-fill, #f7f7f7);
  stroke: var(--artifact-stroke, #b5b5b5);
  stroke-width: var(--artifact-stroke-width, 1.2);
}
/* The turned-down corner of a page, the far edge of a cube, the top of a cylinder: an
 * internal line, never a second filled body. */
.intent-artifact .artifact-fold {
  fill: none;
  stroke: var(--artifact-stroke, #b5b5b5);
  stroke-width: var(--artifact-stroke-width, 1.2);
}
/* A group frames other things and a text annotation labels them. Neither contains ink. */
/* The mark inside a business object's card: a tick, a bar chart, a warning triangle. It
 * is drawn, never filled — the card is the filled part. */
.intent-artifact .artifact-glyph path {
  fill: none;
  stroke: var(--artifact-stroke, #b5b5b5);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.intent-artifact .artifact-frame {
  fill: none;
  stroke: var(--artifact-stroke, #b5b5b5);
  stroke-dasharray: 8 5;
}
.intent-artifact line {
  stroke: var(--artifact-stroke);
  stroke-width: var(--artifact-stroke-width);
}
.intent-artifact text {
  fill: #2b2b2b;
  font-size: 11px;
  font-weight: 650;
  text-anchor: middle;
  dominant-baseline: middle;
}
.intent-artifact:hover rect,
.intent-artifact:hover ellipse,
.intent-artifact:hover path,
.intent-artifact:hover line,
.intent-artifact:focus rect,
.intent-artifact:focus ellipse,
.intent-artifact:focus path,
.intent-artifact:focus line,
.intent-artifact.selected rect,
.intent-artifact.selected ellipse,
.intent-artifact.selected path,
.intent-artifact.selected line,
.intent-artifact.multi-selected rect,
.intent-artifact.multi-selected ellipse,
.intent-artifact.multi-selected path,
.intent-artifact.multi-selected line {
  stroke: #3156d9;
  stroke-width: 3;
}
.intent-anchor {
  fill: #ffffff !important;
  /*
   * Visible at rest, not merely on hover.
   *
   * Hover was the previous fix for "I don't think there's an option to connect", and it
   * was not enough — the same report came back. A handle you have to already know about
   * before you can see it is not discoverable: you cannot hover a thing you have no
   * reason to point at. The asymmetry is what makes it read as missing, because deleting
   * a connector is a visible action and drawing one was an invisible gesture.
   *
   * Faint enough to stay out of the way of the diagram, solid the moment you approach.
   *
   * Hidden at rest, shown on hover or selection of the step (or its connector).
   * History, so nobody flips this back and forth: hover-only was tried early and
   * one customer reported "I don't think there's an option to connect"; the
   * visible-at-rest fix then drew "Can the dots disappear if you are not hovering
   * over them?" from the next customer, and the owner's call (2026-09-01) is
   * hover/selection only. Discoverability now comes from the cursor (crosshair on
   * a step) and from the handles a hovered connector shows, not from dots on
   * every box at rest.
   */
  /*
   * TWO locks, not one, and both !important.
   *
   * `opacity: 0` on its own is a single unweighted declaration: any rule that reaches
   * this element with more specificity, from anywhere in the cascade, silently wins and
   * the dots come back. That is not hypothetical — a customer reported them visible on
   * 2026-09-04 while this file, the engine and a scripted browser check all said hidden,
   * and nothing in the served CSS or JS could be found setting opacity. Whatever wins
   * there, `visibility` is a separate property and an override of one does not defeat
   * the other.
   *
   * Keep both in step with the reveal rule below.
   */
  opacity: 0 !important;
  /* Always hit-testable: the drop handler resolves the anchor under the pointer via
   * elementFromPoint, and `pointer-events: none` made that return the node instead — so
   * the port you aimed at was discarded and the router picked its own. */
  pointer-events: auto;
  stroke: #3156d9 !important;
  stroke-width: 2 !important;
  cursor: crosshair;
  filter: none !important;
  transition: opacity 120ms ease;
}
/*
 * Hover as well as selection.
 *
 * "I don't think there's an option to connect." The handles were only ever revealed
 * on a SELECTED node, so someone who deleted a connector and looked for a way to
 * redraw it saw nothing — the step they pointed at looked like it had no connection
 * points at all. A handle you cannot find is the same as a handle that is not there,
 * and it made the editor look incapable of the most basic edit there is.
 *
 * Hover is where every other diagram tool puts this, and it costs nothing: the
 * anchors are already drawn on every node.
 */
.intent-node.selected .intent-anchor,
.intent-node:hover .intent-anchor,
.intent-node.endpoint-target .intent-anchor,
.intent-node.connect-target .intent-anchor {
  /* Both locks released together — see the pair set on .intent-anchor above. */
  opacity: 1 !important;
  pointer-events: auto;
}
/*
 * The target around the dot: invisible, always hit-testable, roughly a fingertip.
 * "the anchor points are way too small from a UI point of view to hover and select."
 * Hovering the target lights its dot, so the grab point announces itself before the
 * pointer is on the dot itself.
 */
/*
 * The target around the dot: invisible, and hit-testable ONLY while its shape is
 * hovered or selected — exactly when the dots are visible.
 *
 * "the anchor points are stupid big now, dont hide" (2026-09-03). A target that is
 * always hit-testable extends past the shape, so hovering one lit its anchor while
 * the pointer sat in the gap between two boxes — the dots appeared to stop hiding —
 * and it could take a pointer-down meant for the box itself. Tying the target to the
 * same condition as the dot means nothing invisible is ever in the way.
 */
/*
 * The invisible half of a connection point, and the reason it kept being visible.
 *
 * This circle is the 22px target you aim at; the 10px dot beside it is the part you see.
 * It is invisible by PAINT, not by opacity — fill: transparent, stroke: none — because it
 * has to stay hit-testable at rest for the drop handler to resolve a port under the
 * pointer.
 *
 * That makes it defenceless against any rule that paints shapes inside a node. The node
 * shape rules were written as bare descendants — `.intent-node circle`, `.intent-node.start
 * circle`, `.intent-node.end circle` — which match every circle in the group, anchors
 * included, and at (0,1,1) they outrank this (0,1,0). So every hit target was painted white
 * with a grey ring, green on a start, black on an end: "the giant anchor points are still
 * there, still visible", reported five times while the dot beside it was correctly hidden
 * and every check I ran looked at the dot.
 *
 * Those selectors now exclude both anchor classes. Keep it that way: a node-shape rule must
 * never match a bare `circle`, or this comes straight back.
 */
.intent-anchor-hit {
  fill: transparent;
  stroke: none;
  pointer-events: none;
  cursor: crosshair;
}
.intent-node.selected .intent-anchor-hit,
.intent-node:hover .intent-anchor-hit,
.intent-node.endpoint-target .intent-anchor-hit,
.intent-node.connect-target .intent-anchor-hit {
  pointer-events: auto;
}
.intent-guides line {
  pointer-events: none;
  /* Magenta alignment guides on a grey canvas were the loudest thing in the editor,
     for something that exists for the half-second of a drag. */
  stroke: #3156d9;
  stroke-dasharray: 4 4;
  stroke-width: 1.5;
}
.intent-ghost {
  pointer-events: none;
}
.intent-ghost rect {
  fill: rgba(255, 255, 255, 0.88);
  stroke: #3156d9;
  stroke-dasharray: 7 4;
  stroke-width: 2;
}
.intent-ghost.insert rect {
  fill: rgba(237, 246, 255, 0.94);
  stroke: #3156d9;
}
.intent-ghost text {
  fill: #3156d9;
  font-size: 10px;
  font-weight: 750;
  text-anchor: middle;
}
.intent-rubber-connector {
  fill: none;
  marker-end: url(#intent-arrow);
  pointer-events: none;
  stroke: #3156d9;
  stroke-dasharray: 6 4;
  stroke-width: 2;
}
.intent-node-label-hit{fill:transparent;stroke:none;pointer-events:all;cursor:move}
.intent-node-label-hit:hover{fill:rgba(49,86,217,.08)}
.intent-node-label-hit.dragging{fill:rgba(49,86,217,.16)}
