#process-grid {
  --spiral-accent: var(--accent, #cbf761);
  --spiral-white: #f1f2ed;
  --spiral-dim: #b5b8b1;
  --spiral-line: #30332f;
  --spiral-mono: var(--mono, ui-monospace, monospace);
  color: var(--spiral-white);
  isolation: isolate;
}
#process-grid *,#process-grid *::before,#process-grid *::after { box-sizing: border-box }
#process-grid button { font: inherit; cursor: pointer }
#process-grid button:focus-visible { outline: 2px solid var(--spiral-accent); outline-offset: 3px }
.spiral-explorer { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(295px,.8fr); background: #0c0e0d; border: 1px solid var(--spiral-line); overflow: hidden; border-radius: 5px }
.spiral-stage { position: relative; height: clamp(365px,33vw,465px); overflow:hidden; isolation:isolate; background: radial-gradient(ellipse at 49% 45%,#1a1d19 0,#101310 48%,#0b0d0b 85%); cursor: grab; touch-action: pan-y; user-select:none; -webkit-user-select:none; }
.spiral-stage.is-dragging,.spiral-stage.is-dragging button { cursor: grabbing }
.spiral-backdrop { position: absolute; inset: 0; background-image: radial-gradient(#8b91856a .65px,transparent 1px); background-size: 17px 17px; mask-image: radial-gradient(ellipse at 50% 50%,#000 0%,transparent 89%); }
.spiral-trace { width: 100%; height: 100%; position: absolute; inset: 0; fill: none; stroke: #bac2b5; stroke-opacity: .19; stroke-width: 1; stroke-dasharray: 2 5 }
.spiral-cards { position: absolute; inset: 0 }
#process-grid .spiral-card { position:absolute; top:50%; left:50%; width:var(--spiral-width,152px); height:var(--spiral-height,122px); padding:0; margin:0; border:1px solid #767b71; border-radius:4px; background:linear-gradient(140deg,#383d36,#1b1e1a); color:#d5d9cf; box-shadow: 0 10px 20px -12px #000; text-align:left; will-change:transform,opacity; touch-action:pan-y; cursor:pointer }
#process-grid .spiral-card:nth-child(2n) { background:linear-gradient(145deg,#484b45,#282b26); }
#process-grid .spiral-card.is-front { background:linear-gradient(135deg,#e4e6dc,#c8cabe); color:#20251e; border-color:#e7e9e0; }
#process-grid .spiral-card:hover {border-color: var(--spiral-accent)}
.spiral-card-id { position:absolute; top:7%; left:8%; font: .63rem/1 var(--spiral-mono); letter-spacing:.05em; }
.spiral-card-name { position:absolute; left:8%; bottom:8%; font-size:.72rem; line-height:1; font-weight:590; letter-spacing:-.022em; }
.spiral-glyph { position:absolute; inset:14% 7% auto; width:86%; height:65%; }
.spiral-info { display:flex; flex-direction:column; min-width:0; padding:clamp(1.45rem,2.8vw,2.65rem); border-left:1px solid var(--spiral-line); background:linear-gradient(130deg,#141613,#10120f 80%) }
.spiral-topline { display:flex; justify-content:space-between; gap:9px; align-items:center; color:var(--spiral-dim); font: .77rem/1.4 var(--spiral-mono); letter-spacing:.01em }
.spiral-count {white-space:nowrap;font-variant-numeric:tabular-nums}
.spiral-readout {margin:auto 0;padding:2.15rem 0}
.spiral-area,.spiral-modal-title>span {display:inline-flex;align-items:center;gap:.55rem;font:.77rem/1.4 var(--spiral-mono);color:var(--spiral-accent)}
.spiral-area::before,.spiral-modal-title>span::before {content:'';width:7px;height:7px;border:1px solid currentColor}
#process-grid .spiral-readout h3,#process-grid .spiral-modal-title h3 {font-family:inherit;font-weight:470;letter-spacing:-.056em;line-height:1.07;color:var(--spiral-white);margin:.7rem 0 0;font-size:clamp(1.8rem,3.6vw,3.9rem);text-wrap:balance;}
#process-grid .spiral-readout p {font-family:inherit;font-size:1rem;line-height:1.55;color:#b7bbb2;margin:1rem 0 0;max-width:37ch}
.spiral-actions {display:flex;align-items:center;justify-content:space-between;gap:12px}
.spiral-prevnext { display:flex;gap:6px }
#process-grid .spiral-prev,#process-grid .spiral-next,#process-grid .spiral-close {display:grid;place-items:center;border:1px solid #3c4138;border-radius:4px;color:#d3d9ce;background:transparent;padding:0;width:40px;height:40px}
#process-grid .spiral-prev:hover,#process-grid .spiral-next:hover,#process-grid .spiral-close:hover {border-color:#969d8e;background:#23271f}
#process-grid .spiral-open {display:inline-flex;align-items:center;gap:.55rem;min-height:40px;border:0;border-radius:4px;padding:.65rem .92rem;background:#e8ebe2;color:#171b14;font-size:.92rem;font-weight:570;line-height:1.15}
#process-grid .spiral-open:hover {background:#fff}
body.spiral-modal-open {overflow:hidden}
#process-grid .spiral-dialog {border:1px solid #4b4f47;background:#10120f;color:#ecede8;padding:0;border-radius:8px;width:min(970px,calc(100% - 36px));max-width:none;max-height:calc(100dvh - 48px);margin:auto;overscroll-behavior:contain;box-shadow:0 22px 90px #0009;}
.spiral-dialog::backdrop {background:#030403c9}
.spiral-dialog-bar {display:flex;justify-content:space-between;align-items:center;padding:12px clamp(17px,3vw,32px);border-bottom:1px solid var(--spiral-line);font:.79rem/1.4 var(--spiral-mono);color:#bbbeB7;}
#process-grid .spiral-close {width:34px;height:34px}
.spiral-dialog-content {padding:clamp(18px,3vw,32px);}
#process-grid .spiral-modal-title h3 {font-size:clamp(1.7rem,3.45vw,3.1rem);}
.spiral-diagram {display:block;margin:1.45rem 0 1.4rem}
.spiral-flow {width:100%;height:auto;display:block;font:13px/1.25 var(--spiral-mono);fill:#e1e4dc;text-anchor:middle}
.spiral-flow-mobile {display:none}
.flow-lanes {stroke:#40453b;fill:#0c0e0c;stroke-width:1}
.flow-rule{fill:none;stroke:#383c34;stroke-width:1}
.flow-task {fill:#1e231d;stroke:#959c8e;stroke-width:1.2}
.flow-event,.flow-gate,.flow-exclusive,.flow-line {fill:none;stroke:#c3c7bf;stroke-width:1.3}
.flow-event {stroke:#ccd9bb;stroke-width:1.6}.flow-end {stroke-width:3}
.flow-condition {fill:#d2d6cd;font-size:12.25px}.flow-lane-name {fill:#aeb6a8;font-size:12px}.flow-hint{fill:var(--spiral-accent);font-size:11px}
.spiral-facts {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(16px,2.6vw,30px);border-top:1px solid var(--spiral-line);padding:1.35rem 0 0;margin:0}
.spiral-facts dt {font:.77rem/1.4 var(--spiral-mono);color:#a7afa0;margin:0 0 .55rem}
.spiral-facts dd {font:inherit;font-size:.94rem;line-height:1.55;color:#e1e4dc;margin:0}
@media (max-width:790px) {
  .spiral-explorer{grid-template-columns:1.1fr .9fr}
  .spiral-info{padding:1.3rem}
  .spiral-stage{height:360px}
  .spiral-topline{font-size:.71rem}
  .spiral-readout{padding:1.4rem 0}
}
@media (max-width:640px){
  .spiral-explorer{display:flex;flex-direction:column}
  .spiral-stage{height:305px}
  .spiral-info{border-left:0;border-top:1px solid var(--spiral-line);padding:1.25rem}
  .spiral-readout {padding:1.25rem 0 1.45rem}
  #process-grid .spiral-readout h3{font-size:clamp(1.8rem,7vw,2.3rem)}
  #process-grid .spiral-readout p{margin-top:.55rem}
  #process-grid .spiral-open,#process-grid .spiral-prev,#process-grid .spiral-next{min-height:44px}
  #process-grid .spiral-prev,#process-grid .spiral-next{min-width:44px}
  #process-grid .spiral-dialog {width:calc(100% - 16px);max-height:calc(100dvh - 16px)}
  .spiral-dialog-bar{position:sticky;top:0;z-index:1;background:#10120f}
  .spiral-facts {grid-template-columns:1fr;gap:1.1rem}
  .spiral-flow-wide{display:none}.spiral-flow-mobile{display:block;max-width:430px;margin:0 auto}
}
@media (prefers-reduced-motion:reduce) { .spiral-card { will-change:auto } }
