/* The node canvas is code-native and entirely local. */
.dialog.workflow-dialog { width:min(1240px,96vw); max-width:1240px; max-height:94dvh; padding:28px; overflow:auto; }
.wf-workspace { --wf-bg:#f2f4ee; --wf-card:#fffef9; --wf-ink:#253b36; --wf-muted:#677a71; --wf-line:#cdd8cf; --wf-accent:#14766b; --wf-tint:#e3f1e8; --wf-gold:#bd7b20; color:var(--wf-ink); text-align:left; font-family:inherit; }
.wf-workspace *, .wf-workspace *::before, .wf-workspace *::after { box-sizing:border-box; }
.wf-workspace button { color:var(--wf-ink); font-family:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
.wf-workspace button:focus-visible { outline:3px solid var(--wf-accent); outline-offset:4px; }
.wf-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; margin:0 32px 20px 0; }
.wf-eyebrow { display:block; color:var(--wf-accent); font-size:10px; font-weight:800; letter-spacing:1.4px; line-height:1.6; }
.wf-heading h2 { font-size:clamp(25px,2.4vw,34px); letter-spacing:-.7px; line-height:1.15; margin:7px 0 10px; }
.wf-heading p { margin:0; color:var(--wf-muted); font-size:13px; line-height:1.5; max-width:590px; }
.wf-mode-nav { display:flex; flex-shrink:0; gap:4px; padding:4px; border:1px solid var(--wf-line); border-radius:14px; background:var(--wf-bg); }
.wf-mode-nav button { min-height:48px; padding:10px 13px; border:0; border-radius:10px; font-size:12px; line-height:1.35; font-weight:750; background:transparent; }
.wf-mode-nav button[aria-pressed="true"] { background:var(--wf-accent); color:#fff; box-shadow:0 3px 7px #153e2720; }
.wf-context { display:flex; gap:20px; justify-content:space-between; align-items:center; padding:16px 20px; background:var(--wf-tint); border:1px solid var(--wf-line); border-radius:19px; }
.wf-context-copy { display:flex; align-items:center; gap:15px; min-width:0; max-width:670px; }
.wf-context-copy p { font-size:15px; font-weight:650; line-height:1.45; margin:4px 0 7px; }
.wf-context-copy strong { font-size:12px; color:var(--wf-accent); }
.wf-picture { display:block; background-color:#ecece7; background-size:300% 300%; background-repeat:no-repeat; aspect-ratio:1; border-radius:11px; flex-shrink:0; }
.wf-context-picture { width:77px; height:77px; border:1px solid #253b3610; }
.wf-picture-fallback { display:grid; place-items:center; color:#197a71; }
.wf-picture-fallback svg { width:48%; height:48%; }
.wf-demo { display:grid; grid-template-columns:1fr; gap:6px; flex:0 0 178px; }
.wf-demo>span { font-weight:750; font-size:11px; color:var(--wf-accent); }
.wf-demo>div { display:flex; gap:8px; }
.wf-demo-choice { padding:4px; display:flex; align-items:center; gap:7px; min-height:52px; flex:1; background:var(--wf-card); border:1px solid var(--wf-line); border-radius:10px; text-align:left; }
.wf-demo-choice .wf-picture { width:37px; border-radius:7px; }
.wf-demo-choice span:last-child { font-size:11px; font-weight:750; }
.wf-demo-choice[aria-pressed="true"] { outline:2px solid var(--wf-accent); outline-offset:1px; }
.wf-demo small { font-size:10px; color:var(--wf-muted); line-height:1.45; }
.wf-tour { display:flex; justify-content:space-between; align-items:center; gap:15px; margin:18px 0 12px; }
.wf-tour>div { display:flex; gap:10px; align-items:center; }
.wf-tour [role="status"] { font-size:12px; color:var(--wf-muted); }
.wf-tour strong { color:var(--wf-ink); }
.wf-tour-count { font-size:11px; font-weight:800; color:var(--wf-accent); background:var(--wf-tint); border:1px solid var(--wf-line); border-radius:8px; padding:7px 10px; white-space:nowrap; }
.wf-tour button { min-height:46px; border:0; border-radius:10px; padding:10px 15px; font-size:12px; font-weight:750; }
.wf-tour .wf-reset { color:var(--wf-muted); background:transparent; }
.wf-tour .wf-next { display:flex; gap:9px; align-items:center; background:var(--wf-accent); color:#fff; }
.wf-next svg { width:18px; height:18px; }
.wf-graph { position:relative; height:434px; border:1px solid var(--wf-line); border-radius:20px; background-color:var(--wf-bg); background-image:radial-gradient(var(--wf-line) .85px,transparent .85px); background-size:15px 15px; overflow:visible; }
.wf-wires { position:absolute; inset:0; width:100%; height:100%; overflow:visible; color:var(--wf-muted); pointer-events:none; }
.wf-wire { fill:none; stroke:var(--wf-line); stroke-width:2; vector-effect:non-scaling-stroke; }
.wf-wire-past { stroke:var(--wf-accent); }
.wf-wires text { fill:var(--wf-muted); font-size:11px; font-weight:650; font-family:inherit; letter-spacing:.1px; }
.wf-node { position:absolute; top:4.185%; width:15%; height:37.21%; border:1px solid var(--wf-line); border-radius:13px; background:var(--wf-card); padding:13px 12px 11px; text-align:left; display:flex; flex-direction:column; gap:7px; box-shadow:0 3px 0 #20382d08; z-index:1; transition:border-color .18s,box-shadow .18s,transform .18s; }
.wf-node:hover { transform:translateY(-2px); border-color:var(--wf-accent); box-shadow:0 5px 12px #23422e12; }
.wf-node[aria-pressed="true"] { border:2px solid var(--wf-accent); padding:12px 11px 10px; box-shadow:0 0 0 4px #26816d17; }
.wf-node[data-stage="current"] { background:var(--wf-tint); }
.wf-node[data-stage="past"] .wf-node-number { color:var(--wf-accent); }
.wf-node-top { display:flex; align-items:center; justify-content:space-between; gap:5px; }
.wf-node-icon { display:grid; place-items:center; width:29px; height:29px; background:var(--wf-tint); border-radius:8px; color:var(--wf-accent); }
.wf-node-icon svg { width:19px; height:19px; }
.wf-node-number { color:var(--wf-muted); font-family:ui-monospace,Consolas,monospace; font-size:10px; font-weight:750; }
.wf-node>strong { font-size:12px; line-height:1.25; letter-spacing:-.15px; }
.wf-node-copy { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; font-size:10px; line-height:1.45; color:var(--wf-muted); }
.wf-node-badge { align-self:flex-start; margin-top:auto; max-width:100%; padding:3px 6px; border:1px solid var(--wf-line); border-radius:5px; color:var(--wf-accent); font-size:9px; line-height:1.25; font-weight:800; }
.wf-port { display:block; position:absolute; z-index:2; width:9px; height:9px; border:2px solid var(--wf-card); background:var(--wf-accent); box-shadow:0 0 0 1px var(--wf-line); border-radius:2px; top:calc(50% - 4px); }
.wf-port-in { left:-5px; }
.wf-port-out { right:-5px; }
.wf-node-bank { left:1%; }
.wf-node-deck { left:17.6%; }
.wf-node-choice { left:34.2%; }
.wf-node-rules { left:50.8%; }
.wf-node-stats { left:67.4%; }
.wf-node-report { left:84%; }
.wf-node-local { left:34.2%; top:57.21%; }
.wf-node-online { left:50.8%; top:57.21%; }
.wf-node-ranking { left:84%; top:57.21%; }
.wf-node-bank .wf-port-in { display:none; }
.wf-node-report .wf-port-out, .wf-node-local .wf-port-out { top:auto; bottom:-5px; right:calc(50% - 4px); }
.wf-node-local .wf-port-in, .wf-node-online .wf-port-in { top:-5px; left:calc(50% - 4px); }
.wf-node-ranking .wf-port-out { top:auto; bottom:-5px; right:calc(50% - 4px); }
.wf-node-online .wf-node-icon, .wf-node-online .wf-node-badge { color:var(--wf-gold); }
.wf-branches { display:contents; }
.wf-branch-label { display:none; }
.wf-detail { display:flex; gap:15px; margin-top:18px; padding:21px; background:var(--wf-card); border:1px solid var(--wf-line); border-radius:17px; }
.wf-detail-icon { display:grid; place-items:center; width:44px; height:44px; flex-shrink:0; background:var(--wf-tint); border-radius:12px; color:var(--wf-accent); }
.wf-detail-icon svg { width:25px; height:25px; }
.wf-detail-body { flex:1; min-width:0; }
.wf-detail-title { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; }
.wf-detail h4 { margin:0; font-size:17px; line-height:1.35; }
.wf-detail code { font-size:11px; line-height:1.4; color:var(--wf-accent); border:1px solid var(--wf-line); border-radius:6px; padding:4px 7px; white-space:normal; overflow-wrap:anywhere; }
.wf-detail p { color:var(--wf-muted); font-size:13px; line-height:1.7; margin:10px 0 0; }
.wf-question { margin:16px 0 0; padding:14px 17px; border-left:3px solid var(--wf-accent); background:var(--wf-tint); font-size:14px; line-height:1.5; }
.wf-question strong { display:block; font-size:12px; margin-top:6px; color:var(--wf-accent); }
.wf-rule-result { display:flex; align-items:center; flex-wrap:wrap; gap:13px; margin-top:14px; color:var(--wf-gold); }
.wf-rule-result strong { font-size:25px; font-weight:800; }
.wf-rule-result span { color:var(--wf-muted); font-size:12px; }
.wf-rule-good { color:var(--wf-accent); }
.wf-metrics { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; margin-top:17px; }
.wf-metric { background:var(--wf-bg); border:1px solid var(--wf-line); border-radius:10px; padding:11px 9px; }
.wf-metric>span { display:block; min-height:29px; font-size:10px; line-height:1.4; color:var(--wf-muted); }
.wf-metric strong { display:block; font-size:25px; line-height:1.4; }
.wf-metric strong small { font-size:10px; font-weight:500; margin-left:2px; color:var(--wf-muted); }
.wf-delta { font-size:10px; font-style:normal; color:var(--wf-accent); }
.wf-delta-down { color:var(--wf-gold); }
.wf-detail .wf-model-note { margin-top:9px; font-size:11px; color:var(--wf-accent); }
.wf-ending-preview { display:grid; gap:6px; margin-top:15px; padding:15px 17px; border-radius:12px; background:var(--wf-tint); }
.wf-ending-preview>span { font-size:10px; text-transform:uppercase; letter-spacing:1px; color:var(--wf-accent); }
.wf-ending-preview strong { font-size:21px; }
.wf-ending-preview small { color:var(--wf-muted); font-size:11px; line-height:1.6; }
.wf-footnote { color:var(--wf-muted); margin:13px 2px 0; font-size:11px; line-height:1.6; }
body[data-theme="expert"] .wf-workspace { --wf-bg:#15201e; --wf-card:#202e2a; --wf-ink:#edf3e9; --wf-muted:#a7b9ae; --wf-line:#3c5146; --wf-accent:#b9e885; --wf-tint:#2a3c30; --wf-gold:#ebbe79; }
body[data-theme="expert"] .wf-mode-nav button[aria-pressed="true"], body[data-theme="expert"] .wf-tour .wf-next { color:#17251d; }
body[data-theme="expert"] .wf-node[aria-pressed="true"] { box-shadow:0 0 0 4px #b9e88518; }
@media (max-width:1080px) {
  .wf-heading { flex-direction:column; gap:15px; }
  .wf-mode-nav { width:fit-content; }
  .wf-graph { height:auto; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:27px 20px; padding:20px; }
  .wf-wires { display:none; }
  .wf-node { position:relative; inset:auto; width:100%; min-height:153px; height:auto; padding:15px; }
  .wf-node[aria-pressed="true"] { padding:14px; }
  .wf-node>strong { font-size:15px; }
  .wf-node-copy { font-size:12px; line-height:1.5; }
  .wf-node-badge { font-size:10px; margin-top:5px; }
  .wf-node-bank, .wf-node-deck, .wf-node-choice, .wf-node-rules, .wf-node-stats, .wf-node-report { grid-column:1/-1; min-height:111px; padding-left:66px; }
  .wf-node-bank[aria-pressed="true"], .wf-node-deck[aria-pressed="true"], .wf-node-choice[aria-pressed="true"], .wf-node-rules[aria-pressed="true"], .wf-node-stats[aria-pressed="true"], .wf-node-report[aria-pressed="true"] { padding-left:65px; }
  .wf-node:not(.wf-node-local):not(.wf-node-online):not(.wf-node-ranking) .wf-node-top { position:absolute; left:16px; top:15px; flex-direction:column; gap:7px; }
  .wf-node:not(.wf-node-local):not(.wf-node-online)::after { content:'↓'; position:absolute; left:calc(50% - 7px); bottom:-26px; color:var(--wf-accent); font-size:19px; font-weight:800; }
  .wf-node-ranking { grid-column:1/-1; }
  .wf-node-ranking::after { display:none; }
  .wf-port-in, .wf-node-local .wf-port-in, .wf-node-online .wf-port-in { top:-5px; left:calc(50% - 4px); }
  .wf-port-out { top:auto; bottom:-5px; right:calc(50% - 4px); }
  .wf-branches { grid-column:1/-1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding:14px; border:1px dashed var(--wf-accent); border-radius:15px; background:var(--wf-tint); }
  .wf-branch-label { display:block; grid-column:1/-1; font-size:11px; color:var(--wf-accent); font-weight:750; margin:0 0 3px; }
  .wf-node-local::after, .wf-node-online::after { content:'↓'; position:absolute; left:calc(50% - 6px); bottom:-43px; color:var(--wf-accent); font-size:19px; font-weight:800; }
  .wf-metrics { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media (max-width:620px) {
  .dialog.workflow-dialog { width:96vw; padding:21px 14px; }
  .wf-heading { margin-right:25px; }
  .wf-heading h2 { font-size:25px; }
  .wf-mode-nav { width:100%; }
  .wf-mode-nav button { flex:1; padding:9px; }
  .wf-context { flex-direction:column; align-items:stretch; gap:17px; padding:15px; }
  .wf-context-copy { gap:10px; }
  .wf-context-picture { width:59px; height:59px; }
  .wf-context-copy p { font-size:13px; }
  .wf-demo { flex-basis:auto; grid-template-columns:1fr 180px; align-items:center; column-gap:12px; }
  .wf-demo small { grid-column:1/-1; }
  .wf-tour { align-items:stretch; flex-direction:column; gap:10px; }
  .wf-tour>div:last-child { justify-content:flex-end; }
  .wf-tour [role="status"] { font-size:11px; }
  .wf-graph { padding:16px; }
  .wf-branches { padding:11px; }
  .wf-branches .wf-node { padding:11px; }
  .wf-branches .wf-node[aria-pressed="true"] { padding:10px; }
  .wf-branches .wf-node>strong { font-size:13px; }
  .wf-branches .wf-node-copy { font-size:11px; }
  .wf-detail { padding:16px; gap:11px; }
  .wf-detail-icon { width:32px; height:32px; border-radius:9px; }
  .wf-detail-icon svg { width:20px; height:20px; }
  .wf-detail h4 { font-size:16px; }
  .wf-detail p { font-size:12px; }
  .wf-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:380px) {
  .wf-demo { grid-template-columns:1fr; }
  .wf-branches { grid-template-columns:1fr; gap:14px; }
  .wf-node-local::after, .wf-node-online::after { display:none; }
  .wf-detail { display:block; }
  .wf-detail-icon { margin-bottom:12px; }
}
@media (prefers-reduced-motion:reduce) {
  .wf-workspace *, .wf-workspace *::before, .wf-workspace *::after { transition:none!important; animation:none!important; scroll-behavior:auto!important; }
}
