/* DIAGRAMS SANDBOX */
.diagram-shell {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr 320px;
  min-height: 0;
}
.diagram-palette {
  border-right: 1px solid var(--line);
  padding: 14px;
  overflow-y: auto;
}
.diagram-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}
.diagram-palette-item {
  width: 100%;
  margin-bottom: 8px;
  text-align: left;
  cursor: grab;
}
.diagram-canvas-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.diagram-toolbar {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.diagram-save-state {
  font-size: 12px;
  color: var(--muted);
}
.diagram-canvas {
  position: relative;
  flex: 1;
  min-height: 0;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 18px 18px;
  background-color: rgba(255,255,255,.4);
  overflow: hidden;
}
html.dark .diagram-canvas { background-color: rgba(16,22,35,.5); }
.diagram-edge-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.diagram-edge {
  fill: none;
  stroke: #6b7f9e;
  stroke-width: 2;
  pointer-events: stroke;
  cursor: pointer;
}
.diagram-edge.selected { stroke: #2f8cff; stroke-width: 3; }
.diagram-edge-preview {
  fill: none;
  stroke: #2f8cff;
  stroke-width: 2;
  stroke-dasharray: 4 4;
}
.diagram-node {
  position: absolute;
  min-width: 140px;
  min-height: 54px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--card);
  user-select: none;
  cursor: move;
  z-index: 2;
}
.diagram-node.process { border-radius: 8px; }
.diagram-node.terminator { border-radius: 999px; }
.diagram-node.decision {
  width: 118px;
  height: 118px;
  transform: rotate(45deg);
  border-radius: 8px;
}
.diagram-node.decision .diagram-node-label { transform: rotate(-45deg); max-width: 88px; }
.diagram-node.selected { box-shadow: 0 0 0 2px rgba(35,118,229,.6); }
.diagram-node-input {
  width: 100%;
  max-width: 130px;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  text-align: center;
  font: inherit;
  padding: 0;
}
.diagram-node-input:focus { outline: none; }
.diagram-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid #7ea6ff;
  background: #e6f0ff;
  cursor: crosshair;
}
.diagram-handle.h-top { top: -6px; left: calc(50% - 5px); }
.diagram-handle.h-right { right: -6px; top: calc(50% - 5px); }
.diagram-handle.h-bottom { bottom: -6px; left: calc(50% - 5px); }
.diagram-handle.h-left { left: -6px; top: calc(50% - 5px); }
.diagram-props {
  border-left: 1px solid var(--line);
  padding: 14px;
  overflow-y: auto;
}
.diagram-empty-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
