:root{color-scheme:light;--bg:#edf1f6;--surface:#fff;--ink:#1f2c42;--muted:#637289;--line:#dce3ed;--accent:#255fdb;--accent-soft:#eaf1ff;--danger:#b83e47;--radius:12px;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Noto Sans JP",sans-serif;font-size:14px;color:var(--ink);background:var(--bg)}
*{box-sizing:border-box}body{margin:0;overflow:hidden}button,input,select,textarea{font:inherit}button{height:34px;border:1px solid var(--line);border-radius:7px;background:var(--surface);padding:0 12px;color:var(--ink);cursor:pointer;white-space:nowrap;transition:background .12s,border-color .12s}button:hover:not(:disabled){background:#f0f4fa;border-color:#bdc9da}button:disabled{opacity:.4;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:2px solid var(--accent);outline-offset:2px}button.primary{background:var(--accent);border-color:var(--accent);color:#fff}button.primary:hover:not(:disabled){background:#1a4cbb}.danger{color:var(--danger)}button.active,button[aria-pressed=true]{background:var(--accent-soft);color:var(--accent);border-color:#b6caf4}[hidden]{display:none!important}.secondary{color:var(--muted);font-size:12px}.appbar,.graph-toolbar,.output-toolbar,.toolbar-group,.toolbar-end,.header-end,.canvas-footer,.zoom-controls,.pager,.dialog-header,.dialog-footer{display:flex;align-items:center;gap:8px}.appbar{height:58px;padding:0 20px;gap:28px}.brand{font-size:16px;font-weight:650;letter-spacing:-.3px;display:flex;align-items:center;gap:9px}.brand-icon{display:grid;place-items:center;background:var(--ink);color:white;border-radius:8px;width:29px;height:29px;font-size:23px}.header-end,.toolbar-end{margin-left:auto}.header-end{gap:14px}.icon-button{width:36px;padding:0;font-size:22px}.segmented{display:flex;padding:3px;border:1px solid var(--line);border-radius:9px;background:#e4eaf2;gap:2px}.segmented button{border:0;height:29px;min-width:64px;background:transparent}.segmented button.active{background:#fff;box-shadow:0 1px 4px #24385115;color:var(--accent);font-weight:600}
#app{height:100dvh;display:grid;grid-template-rows:58px minmax(0,1fr) clamp(180px,25vh,270px);gap:12px;padding:0 16px 16px}.appbar{margin:0 -16px}.graph-panel,.output-panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);min-height:0;overflow:hidden;position:relative}.graph-panel{display:flex;flex-direction:column}.graph-toolbar{height:55px;padding:10px 14px;border-bottom:1px solid var(--line);flex-shrink:0;background:#fff;z-index:2}#canvas{min-height:0;flex:1;position:relative;overflow:hidden;touch-action:none;background-color:#fafcfe;background-image:radial-gradient(#cdd6e4 .8px,transparent .8px);background-size:20px 20px;cursor:grab}#canvas.dragging{cursor:grabbing}#canvas.connecting{cursor:crosshair}#graph{display:block;width:100%;height:100%;overflow:hidden;user-select:none}.canvas-footer{height:35px;padding:0 12px;border-top:1px solid #edf0f5;flex-shrink:0}.zoom-controls{margin-left:auto;gap:2px}.zoom-controls button{border:0;height:27px;width:31px;padding:0;font-size:17px}.zoom-controls span{width:49px;text-align:center;font-size:12px;font-variant-numeric:tabular-nums}#emptyGraph{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;color:var(--muted)}.node{cursor:grab}.node .box{fill:white;stroke:#bac8dc;stroke-width:1.6;filter:drop-shadow(0 3px 4px #1f2c420b)}.node:hover .box{stroke:#678ec6}.node.current .box{fill:#e4efff;stroke:#255fdb;stroke-width:3}.node.current .halo{fill:#255fdb12;stroke:none}.node.invalid .box{stroke:var(--danger);stroke-width:2.4}.node.connect-source .box{stroke:var(--accent);stroke-width:2.5;stroke-dasharray:5 3}.node text{font-size:16px;fill:var(--ink);pointer-events:none}.node .port{fill:white;stroke:#9baeca;stroke-width:1.5;cursor:crosshair}.node .port:hover{fill:var(--accent);stroke:var(--accent)}.edge{cursor:pointer}.edge-line{fill:none;stroke:#8a9db8;stroke-width:1.7}.edge:hover .edge-line{stroke:var(--accent);stroke-width:2.5}.edge-hit{stroke:transparent;stroke-width:20;fill:none}.edge-label rect{fill:#fafcfe;stroke:#d8e1ed;stroke-width:1}.edge-label text{font-size:13px;fill:#465c7c;text-anchor:middle;dominant-baseline:central}.state-dot{stroke:#fff;stroke-width:2;fill:#23a386}.end-dot{fill:#d6883d}
.output-panel{display:flex;flex-direction:column}.output-toolbar{height:49px;padding:6px 14px;border-bottom:1px solid var(--line);flex-shrink:0;gap:16px}.tabs{display:flex;gap:4px}.tabs button{background:transparent;border-color:transparent;min-width:58px}.tabs button.active{color:var(--accent);background:var(--accent-soft);font-weight:600}#runSelect{max-width:245px;height:31px;font-size:12px;border-color:transparent;background:#f3f6fa}.pager{gap:2px;margin-left:5px}.pager button{width:26px;height:29px;padding:0;font-size:19px}.pager span{font-size:12px;min-width:53px;text-align:center;font-variant-numeric:tabular-nums}#outputArea{position:relative;min-height:0;flex:1;margin:12px 20px 14px;overflow:hidden}#outputText,#measureText{font-family:inherit;font-size:18px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-all;margin:0;width:100%;letter-spacing:.025em}#outputText{height:100%;overflow:hidden}#measureText{position:absolute;top:0;left:0;height:auto;visibility:hidden;pointer-events:none}#emptyOutput{position:absolute;top:4px;left:0;font-size:14px}.history-row{height:30px;display:grid;grid-template-columns:55px 120px minmax(0,1fr);gap:14px;align-items:center;border-bottom:1px solid #eff2f7}.history-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-row span:first-child{color:var(--muted);font-size:12px}.history-row code{font-family:ui-monospace,monospace;font-size:13px;color:var(--muted)}#status{font-size:13px;color:var(--accent)}
dialog{width:520px;max-width:calc(100vw - 40px);border:1px solid var(--line);border-radius:14px;padding:0;color:var(--ink);background:var(--surface);box-shadow:0 18px 80px #17274330;overflow:hidden;max-height:calc(100dvh - 40px)}dialog::backdrop{background:#1c2e4b2e;backdrop-filter:blur(2px)}dialog.inspector{width:390px;margin:0;inset:90px 30px auto auto}.dialog-header{height:61px;padding:0 22px;border-bottom:1px solid var(--line);justify-content:space-between}h2{font-size:16px;margin:0;font-weight:650}.close-button{border:0;font-size:23px;width:30px;padding:0;color:var(--muted)}dialog>.tabs,form>.tabs{padding:12px 18px 0}.dialog-body{padding:20px 22px;min-height:228px}.dialog-footer{padding:13px 22px;border-top:1px solid var(--line);justify-content:space-between;min-height:62px}.field{display:flex;flex-direction:column;gap:7px;margin-bottom:16px}.field:last-child{margin-bottom:0}.field label,.field>span{font-size:14px;font-weight:500}.field small{font-size:12px;color:var(--muted)}input:not([type=checkbox]),select,textarea{border:1px solid #cdd7e5;border-radius:7px;padding:8px 10px;min-width:0;color:var(--ink);background:#fff}input[type=number]{width:100%}input[type=range]{padding:0}textarea{resize:none;line-height:1.6;scrollbar-width:none}textarea::-webkit-scrollbar{display:none}.row{display:flex;align-items:center;gap:18px}.row>.field{flex:1;min-width:0}.check-label{display:flex;align-items:center;gap:7px;font-weight:500}.check-label input{accent-color:var(--accent);width:16px;height:16px}.form-error{color:var(--danger);font-size:12px;line-height:1.5;margin:0;padding:0 22px 10px;min-height:12px}.edge-field{display:grid;grid-template-columns:minmax(0,1fr) 108px;align-items:center;gap:12px;margin-bottom:9px}.edge-field label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.edge-field input{height:34px}.compact-note{font-size:12px;color:var(--muted);line-height:1.6;margin:10px 0 0}.file-name{font-size:12px;color:var(--muted);word-break:break-all;max-height:40px;overflow:hidden}.file-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px}.file-actions button{height:43px}.confirm-dialog{width:390px}.confirm-dialog p{padding:8px 22px;font-size:14px;line-height:1.7;white-space:pre-line}#toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);padding:12px 19px;border-radius:9px;color:white;background:#23334c;box-shadow:0 5px 24px #23334c22;font-size:14px;z-index:10;max-width:80vw}.error-item{display:block;width:100%;height:auto;min-height:40px;text-align:left;white-space:normal;line-height:1.5;margin-bottom:8px;padding:9px 12px}.error-item:hover{color:var(--accent)}
@media(max-height:760px){.dialog-body{padding-top:15px;padding-bottom:15px;min-height:200px}.field{margin-bottom:12px}.inspector .dialog-body{min-height:210px}.appbar{height:52px}#app{grid-template-rows:52px minmax(0,1fr) 184px;gap:9px;padding-bottom:12px}.graph-toolbar{height:50px}}@media(max-width:1000px){.brand{font-size:14px}.appbar{gap:12px}#counts,#saveState{display:none}.output-toolbar{gap:6px;padding-inline:8px}#runSelect{max-width:150px}.output-toolbar button{padding-inline:8px}#stepCount{display:none}}

.inspector{max-height:calc(100dvh - 110px)}.dialog-header h2{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.error-item{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-height:68px}

.node.selected .box{stroke:#7750b5;stroke-width:2.6}.edge.selected .edge-line{stroke:#7750b5;stroke-width:2.6}.edge.selected .edge-label rect{stroke:#7750b5;fill:#f4effc}.node.connect-target .box{stroke:#255fdb;stroke-width:2.5;fill:#eef4ff}.connection-preview{fill:none;stroke:#255fdb;stroke-width:2;opacity:.4;stroke-dasharray:6 4}.node-label .label-hit{pointer-events:all}.node .port{r:7;stroke-width:2}.node .port:hover{r:9}#canvas.connecting .node,#canvas.connecting .node *{cursor:pointer}#canvas.invalid-connection .node,#canvas.invalid-connection .node *{cursor:no-drop}#canvas.dragging .node,#canvas.dragging .node *{cursor:grabbing}#canvas:not(.editing) .node,#canvas:not(.editing) .edge{cursor:default}.editing .selected .node-label,.editing .selected .edge-label{cursor:text}#inlineEditor{position:absolute;z-index:3;background:white;border:2px solid var(--accent);border-radius:9px;padding:7px;box-shadow:0 6px 24px #23334c22;cursor:default}#inlineEditor textarea,#inlineEditor input{display:block;width:100%;max-height:140px;border:0;outline:none;padding:4px;font-size:16px}#inlineError{color:var(--danger);font-size:12px;line-height:1.5}#inlineError:empty{display:none}
.edge.traversed .edge-line{stroke:var(--accent);stroke-width:3.5}.edge.traversed .edge-label rect{fill:var(--accent-soft);stroke:var(--accent)}
.output-toolbar{gap:8px}.output-toolbar .toolbar-group{gap:5px}#runSelect{min-width:100px;max-width:205px}#playbackNote{white-space:nowrap}.output-toolbar button{padding-inline:9px}
@media(max-width:1150px){#stepCount{display:none}#runSelect{max-width:155px}.output-toolbar{flex-wrap:wrap;height:auto;min-height:49px}.output-toolbar .toolbar-end{gap:4px}}
