.wrekt-workspace-mode-switch{display:flex;align-items:center;gap:2px;padding:2px;border:1px solid rgba(71,92,111,.72);border-radius:6px;background:rgba(8,14,20,.88)}
.wrekt-workspace-mode-switch button{min-height:24px;padding:0 8px;border:0;border-radius:4px;color:#708395;background:transparent;font:900 8px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.075em;cursor:pointer}
.wrekt-workspace-mode-switch button:hover{color:#dcecf6;background:#111d27}
.wrekt-workspace-mode-switch button.active{color:#f0fbff;background:linear-gradient(180deg,#173344,#10242f);box-shadow:inset 0 -2px 0 #72d6ef}

.wrekt-flow-workspace{position:absolute;inset:0;z-index:40;min-width:0;min-height:0;display:grid;grid-template-rows:36px minmax(0,1fr);overflow:hidden;color:#dce7ef;background:#060a0e;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.wrekt-flow-workspace[hidden]{display:none!important}
.wrekt-flow-workspace[data-patch-error]::after{content:attr(data-patch-error);position:absolute;z-index:200;left:50%;bottom:18px;transform:translateX(-50%);max-width:min(560px,80vw);padding:7px 12px;border:1px solid #a84352;border-radius:5px;color:#ffdce0;background:rgba(45,12,18,.96);font:800 9px/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;box-shadow:0 12px 32px rgba(0,0,0,.42)}

.wrekt-flow-toolbar{position:relative;z-index:80;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:3px 7px;border-bottom:1px solid #283a47;background:linear-gradient(180deg,#111b24,#0b1218)}
.wrekt-flow-brand{min-width:0;display:flex;align-items:center;gap:7px}
.wrekt-flow-brand img{width:24px;height:24px;object-fit:contain}
.wrekt-flow-brand span{min-width:0;display:grid;gap:1px}
.wrekt-flow-brand strong{color:#eff9ff;font:900 10px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.09em}
.wrekt-flow-brand small{color:#668095;font:800 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.055em}
.wrekt-flow-toolbar-actions{display:flex;align-items:center;gap:5px}
.wrekt-flow-toolbar-actions button{min-height:25px;padding:0 8px;border:1px solid #314858;border-radius:4px;color:#a9c0cf;background:#0d1820;font:900 8px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;cursor:pointer}
.wrekt-flow-toolbar-actions button:hover{color:#fff;border-color:#6ba8c3;background:#142632}
.wrekt-flow-toolbar-actions output{min-width:42px;padding:5px 6px;border:1px solid #273945;border-radius:4px;color:#7f9aac;background:#091117;font:900 8px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-align:center}
.wrekt-flow-scenario{display:flex;align-items:center;gap:4px;font-size:8px;letter-spacing:.08em}
.wrekt-flow-guide{position:absolute;right:14px;top:62px;z-index:10030;width:min(360px,calc(100vw - 28px));padding:12px;border:1px solid rgba(99,186,225,.36);border-radius:8px;background:rgba(5,14,20,.96);box-shadow:0 18px 50px rgba(0,0,0,.5)}
.wrekt-flow-guide[hidden]{display:none!important}
.wrekt-flow-guide-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.wrekt-flow-guide-progress{margin-top:5px;font:700 8px ui-monospace,monospace;letter-spacing:.1em;opacity:.5}
.wrekt-flow-guide-copy{font-size:11px;line-height:1.5;opacity:.82}
.wrekt-flow-guide-actions{display:flex;gap:6px;justify-content:space-between}
.wrekt-flow-envelope-actions{display:flex;gap:6px}

.wrekt-flow-library{position:absolute;z-index:120;top:32px;right:7px;width:300px;max-height:min(540px,75vh);overflow:auto;display:grid;gap:4px;padding:6px;border:1px solid #365064;border-radius:6px;background:rgba(7,14,20,.995);box-shadow:0 18px 48px rgba(0,0,0,.58)}
.wrekt-flow-library[hidden]{display:none!important}
.wrekt-flow-library button{min-height:48px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:6px 8px;border:1px solid #22333f;border-radius:5px;color:#d9e7ef;background:#0d171f;text-align:left;cursor:pointer}
.wrekt-flow-library button:hover{border-color:#43677b;background:#11232e}
.wrekt-flow-library button span{min-width:0;display:grid;gap:3px}
.wrekt-flow-library button strong{font-size:9px;letter-spacing:.04em}
.wrekt-flow-library button small{overflow:hidden;color:#71899a;font:800 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-overflow:ellipsis;white-space:nowrap}
.wrekt-flow-library button b{color:#72d6ef;font:900 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.05em}

.wrekt-flow-quick-add{position:fixed!important;z-index:10040!important;left:10px;top:10px;width:min(350px,calc(100vw - 20px));max-width:350px;max-height:min(430px,calc(100vh - 20px));margin:0!important;display:flex;flex-direction:column;overflow:hidden;border:1px solid #426479;border-radius:6px;background:#0a1117;box-shadow:0 20px 54px rgba(0,0,0,.72),0 0 0 1px rgba(114,214,239,.05);color:#dbe8ef;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.wrekt-flow-quick-add[hidden]{display:none!important}
.wrekt-flow-quick-add-head{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:34px;padding:5px 7px;border-bottom:1px solid #263b49;background:linear-gradient(180deg,#15222c,#0e171e)}
.wrekt-flow-quick-add-title{min-width:0;display:flex;align-items:baseline;gap:7px}
.wrekt-flow-quick-add-title strong{color:#edf8fd;font:900 9px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.08em}
.wrekt-flow-quick-add-title small{min-width:0;overflow:hidden;color:#6e8fa2;font:800 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.06em;text-overflow:ellipsis;white-space:nowrap}
.wrekt-flow-quick-add-close{flex:0 0 auto;width:24px;height:22px;padding:0;border:1px solid transparent;border-radius:4px;color:#7891a0;background:transparent;font:900 16px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;cursor:pointer}
.wrekt-flow-quick-add-close:hover{color:#fff;border-color:#3d5869;background:#13222c}
.wrekt-flow-quick-add-search{flex:0 0 auto;width:auto!important;min-width:0;margin:7px 7px 5px!important;padding:7px 8px!important;border:1px solid #314b5c!important;border-radius:4px!important;outline:none;color:#eaf7fd!important;background:#071017!important;font:800 9px/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important}
.wrekt-flow-quick-add-search:focus{border-color:#65b9d6!important;box-shadow:0 0 0 1px rgba(101,185,214,.18)}
.wrekt-flow-quick-add-list{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:2px 6px 7px;scrollbar-width:thin;scrollbar-color:#355364 #0a1117}
.wrekt-flow-quick-add-group{position:sticky;top:0;z-index:1;margin:4px -1px 3px;padding:5px 5px 4px;border-bottom:1px solid #1f303b;color:#66869a;background:#0a1117;font:900 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.12em}
.wrekt-flow-quick-add-list button{width:100%;min-height:38px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;margin:0 0 3px;padding:5px 7px;border:1px solid #1f303b;border-radius:4px;color:#d9e7ef;background:#0d171f;text-align:left;cursor:pointer}
.wrekt-flow-quick-add-list button:hover,.wrekt-flow-quick-add-list button:focus-visible{border-color:#4d778d;background:#132631;outline:none}
.wrekt-flow-quick-add-list button span{min-width:0;display:grid;gap:2px}
.wrekt-flow-quick-add-list button strong{overflow:hidden;color:#edf7fc;font:900 9px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.035em;text-overflow:ellipsis;white-space:nowrap}
.wrekt-flow-quick-add-list button small{overflow:hidden;color:#71899a;font:800 7px/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-overflow:ellipsis;white-space:nowrap}
.wrekt-flow-quick-add-list button b{color:#72d6ef;font:900 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.05em}
.wrekt-flow-quick-add-empty{padding:22px 10px;text-align:center;color:#587181;font:900 8px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.1em}

.wrekt-flow-viewport{--flow-grid-size:22px;--flow-grid-x:0px;--flow-grid-y:0px;position:relative;min-width:0;min-height:0;overflow:hidden;cursor:grab;outline:none;background-color:#070b10;background-image:radial-gradient(circle,rgba(86,113,133,.34) 1px,transparent 1.2px),linear-gradient(rgba(62,82,98,.10) 1px,transparent 1px),linear-gradient(90deg,rgba(62,82,98,.10) 1px,transparent 1px);background-size:var(--flow-grid-size) var(--flow-grid-size),calc(var(--flow-grid-size)*5) calc(var(--flow-grid-size)*5),calc(var(--flow-grid-size)*5) calc(var(--flow-grid-size)*5);background-position:var(--flow-grid-x) var(--flow-grid-y),var(--flow-grid-x) var(--flow-grid-y),var(--flow-grid-x) var(--flow-grid-y)}
.wrekt-flow-viewport.panning{cursor:grabbing}
.wrekt-flow-canvas-hint{position:absolute;z-index:2;left:10px;bottom:8px;padding:4px 7px;border:1px solid rgba(53,73,88,.5);border-radius:4px;color:#4e687a;background:rgba(5,10,14,.72);font:800 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.055em;pointer-events:none}

.wrekt-flow-wire-disconnect{position:absolute;z-index:70;transform:translate(-50%,-50%);min-height:24px;padding:0 8px;border:1px solid #80434f;border-radius:4px;color:#ffdce1;background:rgba(35,10,15,.96);font:900 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.045em;cursor:pointer;box-shadow:0 8px 22px rgba(0,0,0,.42)}
.wrekt-flow-wire-disconnect:hover{border-color:#ff687b;color:#fff;background:#38131a}
.wrekt-flow-wire-disconnect[hidden]{display:none!important}

.wrekt-flow-world{position:absolute;inset:0;z-index:20;overflow:visible;pointer-events:none}
.wrekt-flow-wires{position:absolute;inset:0;z-index:16;overflow:visible;pointer-events:none}
.wrekt-flow-wire{fill:none;stroke:#8297a8;stroke-width:3;stroke-linecap:round;opacity:.84;pointer-events:stroke;cursor:pointer;filter:drop-shadow(0 0 3px rgba(0,0,0,.7))}
.wrekt-flow-wire:hover{stroke-width:5;opacity:1}
.wrekt-flow-wire.selected{stroke-width:5;opacity:1;filter:drop-shadow(0 0 5px currentColor)}
.wrekt-flow-wire.preview{stroke-dasharray:7 5;opacity:.68;pointer-events:none}
.wrekt-flow-wire[data-flow-type="candles"],.wrekt-flow-wire[data-flow-type="market"]{stroke:#72d6ef}
.wrekt-flow-wire[data-flow-type="depth"]{stroke:#a88cff}
.wrekt-flow-wire[data-flow-type="trades"]{stroke:#ff9d5c}
.wrekt-flow-wire[data-flow-type="series"]{stroke:#f7c65b}
.wrekt-flow-wire[data-flow-type="signal"]{stroke:#48dfa6}
.wrekt-flow-wire[data-flow-type="calls"]{stroke:#d38ce5}
.wrekt-flow-wire[data-flow-type="order-intent"]{stroke:#ff687b}

.wrekt-flow-node{position:absolute;z-index:30;min-width:0;min-height:0;display:grid;grid-template-rows:31px minmax(0,1fr);overflow:visible;border:1px solid #314654;border-radius:7px;background:#091016;box-shadow:0 15px 36px rgba(0,0,0,.42),0 0 0 1px rgba(255,255,255,.012);pointer-events:auto}
.wrekt-flow-node[hidden]{display:none!important}
.wrekt-flow-node.moving{opacity:.9;box-shadow:0 22px 50px rgba(0,0,0,.58),0 0 0 1px #72d6ef}
.wrekt-flow-node[data-kind="source"],.wrekt-flow-node[data-kind="chart"]{border-color:#356077}
.wrekt-flow-node[data-kind="market"]{border-color:#5d4d82}
.wrekt-flow-node[data-kind="logic"]{border-color:#846e37}
.wrekt-flow-node[data-kind="calls"]{border-color:#6d4f78}
.wrekt-flow-node[data-kind="execution"]{border-color:#396b58}
.wrekt-flow-node-head{min-width:0;display:grid;grid-template-columns:12px minmax(0,1fr) auto;align-items:center;gap:5px;padding:0 4px 0 7px;border-bottom:1px solid #283b47;border-radius:6px 6px 0 0;background:linear-gradient(180deg,#14212b,#0e171e);cursor:move;user-select:none}
.wrekt-flow-node-mark{width:6px;height:6px;border-radius:50%;background:#72d6ef;box-shadow:0 0 10px rgba(114,214,239,.45)}
[data-kind="market"] .wrekt-flow-node-mark{background:#a88cff;box-shadow:0 0 10px rgba(168,140,255,.45)}
[data-kind="logic"] .wrekt-flow-node-mark{background:#f7c65b;box-shadow:0 0 10px rgba(247,198,91,.4)}
[data-kind="calls"] .wrekt-flow-node-mark{background:#d38ce5;box-shadow:0 0 10px rgba(211,140,229,.4)}
[data-kind="execution"] .wrekt-flow-node-mark{background:#48dfa6;box-shadow:0 0 10px rgba(72,223,166,.4)}
.wrekt-flow-node-title{min-width:0;display:flex;align-items:baseline;gap:8px;overflow:hidden}
.wrekt-flow-node-title strong{color:#edf7fc;font:900 9px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.075em;white-space:nowrap}
.wrekt-flow-node-title small{min-width:0;overflow:hidden;color:#60798a;font:800 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-overflow:ellipsis;white-space:nowrap}
.wrekt-flow-node-actions{display:flex;align-items:center;gap:1px}
.wrekt-flow-node-actions button{width:23px;height:23px;min-width:23px;padding:0;border:0;border-radius:3px;color:#8297a8;background:transparent;cursor:pointer}
.wrekt-flow-node-actions button:hover{color:#fff;background:#1b2c37}
.wrekt-flow-node-body{position:relative;min-width:0;min-height:0;overflow:hidden;border-radius:0 0 6px 6px;background:#080d12}
.wrekt-flow-node-body>#chat-panel{position:relative;inset:auto;width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;display:grid;border-left:0}
.wrekt-flow-node-resize{position:absolute;z-index:45;right:-2px;bottom:-2px;width:18px;height:18px;min-width:18px;padding:0;border:0;background:linear-gradient(135deg,transparent 47%,#526d7e 48%,#526d7e 56%,transparent 57%),linear-gradient(135deg,transparent 66%,#526d7e 67%,#526d7e 75%,transparent 76%);cursor:nwse-resize;opacity:.72}
.wrekt-flow-node-resize:hover{opacity:1}

.wrekt-flow-port-rail{position:absolute;z-index:55;top:48px;display:grid;gap:10px;pointer-events:none}
.wrekt-flow-port-rail.inputs{left:1px;transform:translateX(calc(-100% + 7px));justify-items:end}
.wrekt-flow-port-rail.outputs{right:1px;transform:translateX(calc(100% - 7px));justify-items:start}
.wrekt-flow-port{min-width:0;max-width:126px;height:22px;display:flex;align-items:center;gap:5px;padding:0;border:0;color:#8498a8;background:transparent;font:900 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.035em;pointer-events:auto;cursor:crosshair}
.wrekt-flow-port-rail.inputs .wrekt-flow-port{justify-content:flex-end}
.wrekt-flow-port-rail.outputs .wrekt-flow-port{justify-content:flex-start}
.wrekt-flow-port .label{max-width:96px;overflow:hidden;padding:4px 5px;border:1px solid rgba(50,70,84,.58);border-radius:3px;background:rgba(8,14,19,.94);text-overflow:ellipsis;white-space:nowrap;box-shadow:0 2px 8px rgba(0,0,0,.28)}
.wrekt-flow-port .socket{width:13px;height:13px;flex:0 0 13px;border:2px solid currentColor;border-radius:50%;background:#081016;box-shadow:0 0 0 2px rgba(0,0,0,.45)}
.wrekt-flow-port:hover .socket{background:currentColor;box-shadow:0 0 12px currentColor}
.wrekt-flow-port[data-flow-type="candles"],.wrekt-flow-port[data-flow-type="market"]{color:#72d6ef}
.wrekt-flow-port[data-flow-type="depth"]{color:#a88cff}
.wrekt-flow-port[data-flow-type="trades"]{color:#ff9d5c}
.wrekt-flow-port[data-flow-type="series"]{color:#f7c65b}
.wrekt-flow-port[data-flow-type="signal"]{color:#48dfa6}
.wrekt-flow-port[data-flow-type="calls"]{color:#d38ce5}
.wrekt-flow-port[data-flow-type="order-intent"]{color:#ff687b}

.wrekt-flow-market-source,.wrekt-flow-calls-source,.wrekt-flow-processor{height:100%;min-height:0;display:grid;align-content:start;gap:10px;padding:14px;background:linear-gradient(180deg,#0d151c,#090e13)}
.wrekt-flow-source-controls{display:grid;grid-template-columns:minmax(0,1fr) 74px;gap:7px}
.wrekt-flow-source-controls label,.wrekt-flow-processor-controls label{min-width:0;display:grid;gap:5px;color:#6e8494;font:900 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.045em}
.wrekt-flow-source-controls select,.wrekt-flow-processor-controls select,.wrekt-flow-processor-controls input{min-width:0;width:100%;height:29px;padding:0 7px;border:1px solid #344955;border-radius:4px;color:#e4eef4;background:#091117;font:800 9px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.wrekt-flow-processor-controls{display:grid;grid-template-columns:minmax(0,1fr) 90px;gap:7px}
.wrekt-flow-processor-controls select{color:#f7c65b;border-color:#5b4c27;background:#151208}
.wrekt-flow-source-status,.wrekt-flow-calls-summary,.wrekt-flow-processor-status{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.wrekt-flow-source-status span,.wrekt-flow-calls-summary span,.wrekt-flow-processor-status span{min-width:0;display:grid;gap:4px;padding:7px;border:1px solid #263843;border-radius:4px;background:#091117}
.wrekt-flow-source-status small,.wrekt-flow-calls-summary small,.wrekt-flow-processor-status small{color:#607787;font:900 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.wrekt-flow-source-status b,.wrekt-flow-calls-summary b,.wrekt-flow-processor-status b{overflow:hidden;color:#eaf5fa;font:900 11px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-overflow:ellipsis;white-space:nowrap}
.wrekt-flow-source-status b[data-tone="positive"]{color:#48dfa6}
.wrekt-flow-source-status b[data-tone="negative"]{color:#ff687b}
.wrekt-flow-source-status b[data-tone="flat"]{color:#91a4b1}
.wrekt-flow-market-source p,.wrekt-flow-calls-source p,.wrekt-flow-processor p{margin:0;color:#5e7484;font-size:8px;line-height:1.4}
.wrekt-flow-processor-meter{position:relative;min-height:175px;height:min(220px,45%);border:1px solid #273945;border-radius:5px;overflow:hidden;background:#071017}
.wrekt-flow-meter-canvas,.wrekt-flow-chart-canvas{display:block;width:100%;height:100%}
.wrekt-flow-chart-host{position:relative;width:100%;height:100%;min-width:0;min-height:0;background:#061019}
.wrekt-flow-chart-host .wrekt-flow-chart-canvas{position:absolute;inset:0}

/* Flow tool body: compact, readable, and isolated from port labels. */
.wrekt-flow-tool-body{box-sizing:border-box;width:100%;height:100%;min-width:0;min-height:0;display:grid;grid-template-rows:auto auto auto auto;align-content:start;gap:8px;padding:11px 14px 10px;overflow:auto;background:linear-gradient(180deg,#0a1117,#080d12);scrollbar-width:thin;scrollbar-color:#334b5b #080d12}
.wrekt-flow-tool-intro{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:8px;padding-bottom:2px}
.wrekt-flow-tool-intro p{min-width:0;margin:0;color:#a9bac5;font:700 8px/1.35 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.005em}
.wrekt-flow-tool-intro b{align-self:start;padding:3px 5px;border:1px solid #263945;border-radius:3px;color:#6f899a;background:#0b151c;font:900 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.06em;white-space:nowrap}
.wrekt-flow-tool-properties{min-width:0;display:grid;gap:6px}
.wrekt-flow-tool-property{min-width:0;display:grid;grid-template-columns:minmax(70px,104px) minmax(0,1fr) 22px;align-items:center;gap:7px}
.wrekt-flow-tool-property-label{min-width:0;overflow:hidden;color:#9fb1bd;font:800 8px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.025em;text-overflow:ellipsis;white-space:nowrap}
.wrekt-flow-tool-property-control{min-width:0;display:flex;align-items:center}
.wrekt-flow-tool-field{box-sizing:border-box;width:100%;min-width:0;height:27px;padding:0 8px;border:1px solid #334956;border-radius:4px;outline:0;color:#e7f1f6;background:#09131a;font:800 9px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;box-shadow:inset 0 1px 0 rgba(255,255,255,.015)}
.wrekt-flow-tool-field:hover{border-color:#496679}
.wrekt-flow-tool-field:focus{border-color:#69bfdc;box-shadow:0 0 0 1px rgba(105,191,220,.18)}
.wrekt-flow-tool-field[type="number"]{font-variant-numeric:tabular-nums}
.wrekt-flow-tool-checkbox{appearance:none;width:34px;height:19px;margin:0;border:1px solid #36505f;border-radius:10px;background:#0a141b;cursor:pointer;box-shadow:inset 0 0 0 2px #0a141b}
.wrekt-flow-tool-checkbox::before{content:"";display:block;width:13px;height:13px;margin:2px;border-radius:50%;background:#718897;transition:transform .12s ease,background .12s ease}
.wrekt-flow-tool-checkbox:checked{border-color:#3d876f;background:#113127}
.wrekt-flow-tool-checkbox:checked::before{transform:translateX(15px);background:#48dfa6}
.wrekt-flow-tool-promote,.wrekt-flow-tool-promote-spacer{width:22px;height:22px;min-width:22px}
.wrekt-flow-tool-promote{padding:0;border:1px solid #314956;border-radius:4px;color:#6f8797;background:#0a141b;font:900 10px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;cursor:pointer}
.wrekt-flow-tool-promote:hover{color:#72d6ef;border-color:#4b7a90;background:#10222c}
.wrekt-flow-tool-outputs{min-width:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;padding-top:7px;border-top:1px solid rgba(120,160,185,.16)}
.wrekt-flow-tool-output{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px;padding:5px 6px;border:1px solid #1e303b;border-radius:4px;background:#091219}
.wrekt-flow-tool-output small{min-width:0;overflow:hidden;color:#738c9c;font:800 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-overflow:ellipsis;white-space:nowrap}
.wrekt-flow-tool-output b{min-width:42px;color:#dbe8ef;font:900 8px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-align:right;font-variant-numeric:tabular-nums}
.wrekt-flow-tool-output b[data-tone="positive"]{color:#48dfa6}
.wrekt-flow-tool-output b[data-tone="negative"]{color:#ff687b}
.wrekt-flow-tool-output b[data-tone="flat"]{color:#8ea2af}
.wrekt-flow-tool-footer{display:flex;justify-content:flex-end;padding-top:1px}
.wrekt-flow-tool-reset{min-height:23px;padding:0 7px;border:1px solid #293d49;border-radius:4px;color:#768e9e;background:#0a1319;font:800 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.03em;cursor:pointer}
.wrekt-flow-tool-reset:hover{color:#d9e7ef;border-color:#49677a;background:#10202a}
.wrekt-flow-tool-empty{color:#667f90;font:800 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.05em}
.wrekt-flow-calls-list{min-height:0;display:grid;gap:5px;overflow:auto}
.wrekt-flow-calls-list>div{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0;padding:7px 8px;border:1px solid #273946;border-radius:4px;background:#0a1218}
.wrekt-flow-calls-list strong{color:#dce9f0;font:900 8px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.wrekt-flow-calls-list span{color:#9b7ba7;font:800 8px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.wrekt-flow-indicator-empty{padding:12px;border:1px dashed #314450;border-radius:4px;color:#5f7788;font:800 7px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-align:center}

body[data-wrekt-workspace-mode="advanced"] .workspace{display:block;position:relative;min-width:0;min-height:0;overflow:hidden}
body[data-wrekt-workspace-mode="advanced"] #workspace-resize-handle,
body[data-wrekt-workspace-mode="advanced"] #wrekt-dom-toggle,
body[data-wrekt-workspace-mode="advanced"] #wrekt-orders-toggle{display:none!important}

@media(max-width:850px){.wrekt-workspace-mode-switch,.wrekt-flow-workspace{display:none!important}}


/* Flow v5: uniform node zoom, marquee selection, envelopes and hover-to-snip wires. */
.wrekt-flow-node{transform-origin:0 0}
.wrekt-flow-node.selected{box-shadow:0 0 0 2px rgba(114,214,239,.78),0 18px 42px rgba(0,0,0,.48)}
.wrekt-flow-node[data-kind="envelope"]{z-index:12;border:1px dashed rgba(114,214,239,.55);background:rgba(8,20,28,.34);box-shadow:inset 0 0 0 1px rgba(114,214,239,.05)}
.wrekt-flow-node[data-kind="envelope"] .wrekt-flow-node-head{background:linear-gradient(180deg,rgba(22,52,67,.96),rgba(12,29,38,.92));border-bottom-color:rgba(114,214,239,.32)}
.wrekt-flow-node[data-kind="envelope"] .wrekt-flow-node-mark{background:#72d6ef;box-shadow:0 0 12px rgba(114,214,239,.5)}
.wrekt-flow-node[data-kind="envelope"] .wrekt-flow-node-body{background:rgba(5,13,18,.28)}
.wrekt-flow-envelope-body{height:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto 1fr;gap:10px;padding:14px 16px;color:#7890a1;pointer-events:auto}
.wrekt-flow-envelope-body label{display:grid;gap:5px;color:#6f8798;font:900 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.wrekt-flow-envelope-body input{height:28px;min-width:0;padding:0 8px;border:1px solid #355267;border-radius:4px;color:#edf8fd;background:rgba(7,16,22,.92);font:900 10px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.wrekt-flow-envelope-body button{align-self:end;min-height:28px;padding:0 10px;border:1px solid #4b6170;border-radius:4px;color:#a8bbc7;background:#0b161d;font:900 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;cursor:pointer}
.wrekt-flow-envelope-stats{grid-column:1/-1;display:flex;gap:6px}
.wrekt-flow-envelope-stats span{display:grid;gap:3px;min-width:72px;padding:6px 8px;border:1px solid rgba(61,86,103,.62);border-radius:4px;background:rgba(7,16,22,.7)}
.wrekt-flow-envelope-stats small{color:#60798a;font:900 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.wrekt-flow-envelope-stats b{color:#dceaf2;font:900 10px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.wrekt-flow-envelope-body p{grid-column:1/-1;align-self:end;margin:0;color:#587181;font-size:8px;line-height:1.4}

.wrekt-flow-selection-box{position:absolute;z-index:65;border:1px solid rgba(114,214,239,.85);background:rgba(63,156,193,.12);box-shadow:inset 0 0 0 1px rgba(255,255,255,.04);pointer-events:none}
.wrekt-flow-selection-box[hidden]{display:none!important}
.wrekt-flow-viewport.space-pan{cursor:grab}
.wrekt-flow-viewport.space-pan.panning{cursor:grabbing}
.wrekt-flow-wire.cut-ready{stroke-width:6;opacity:1;filter:drop-shadow(0 0 7px currentColor);cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='3'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Cpath d='M8.5 8.5L20 20M8.5 15.5L20 4'/%3E%3C/g%3E%3C/svg%3E") 12 12,crosshair}
.wrekt-flow-viewport.wire-cut-ready .wrekt-flow-canvas-hint{color:#ffdce1;border-color:rgba(255,104,123,.55)}

.wrekt-flow-node[data-kind="envelope"]{pointer-events:none}
.wrekt-flow-node[data-kind="envelope"] .wrekt-flow-node-head,
.wrekt-flow-node[data-kind="envelope"] .wrekt-flow-port,
.wrekt-flow-node[data-kind="envelope"] .wrekt-flow-node-resize,
.wrekt-flow-node[data-kind="envelope"] input,
.wrekt-flow-node[data-kind="envelope"] button{pointer-events:auto}
.wrekt-flow-node[data-kind="envelope"] .wrekt-flow-node-body,
.wrekt-flow-node[data-kind="envelope"] .wrekt-flow-envelope-body{pointer-events:none}
.wrekt-flow-node[data-kind="envelope"] .wrekt-flow-envelope-body input,
.wrekt-flow-node[data-kind="envelope"] .wrekt-flow-envelope-body button{pointer-events:auto}


/* App readability baseline v290
   WrektView had accumulated 6–9px UI text across the shell and Advanced Flow.
   BUILD is the intentional micro-label; ordinary interactive/meta text should remain readable. */
:root{
  --wrekt-readable-control:11px;
  --wrekt-readable-meta:10px;
  --wrekt-readable-body:12px;
}
body{
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:geometricPrecision;
}
body :where(button,input,select,textarea,output){
  font-size:var(--wrekt-readable-control)!important;
  line-height:1.2;
}
body :where(small){
  font-size:var(--wrekt-readable-meta)!important;
  line-height:1.25;
}
#wrekt-build-badge{
  font-size:8px!important;
  line-height:1!important;
  letter-spacing:.04em!important;
}

/* Global shell: ticker, account strip, chat/utility metadata and compact controls. */
.market-ticker-item,
.market-ticker-item strong,
.market-ticker-price,
.market-ticker-change,
#chat-signout,
.message-time,
.message-edited,
.message-context,
.reply-preview,
.reply-preview strong,
.wrekt-account-pnl small,
.wrekt-people-row-meta,
.wrekt-call-status,
.wrekt-call-fineprint,
.wrekt-call-history-head small,
.wrekt-call-history-main span,
.wrekt-call-history-result span,
.wrekt-call-history-meta,
.wrekt-wallet-hero small,
.wrekt-wallet-panel p,
.wrekt-utility-head small,
.wrekt-rep-v2-cap,
.wrekt-rep-v2-position small,
.wrekt-rep-v2-position span,
.wrekt-rep-v2-control-head small,
.wrekt-rep-v2-control-head em,
.wrekt-rep-v2-risk-scale,
.wrekt-rep-v2-shape-scale,
.wrekt-rep-v2-warning,
.wrekt-rep-v2-hero small,
.wrekt-rep-v2-hero span,
.wrekt-rep-v2-trade-row small,
.wrekt-rep-v2-entry,
.wrekt-rep-v2-editor [data-wrekt-editor-error]{
  font-size:10px!important;
  line-height:1.25!important;
}
.market-ticker-item,
.market-ticker-item strong,
.market-ticker-price,
.market-ticker-change{
  font-size:11px!important;
}
.wrekt-account-pnl strong,
.room-subtitle,
.message-author,
.message-body,
.wrekt-people-empty,
.wrekt-call-metrics strong,
.wrekt-call-history-main strong,
.wrekt-call-history-result strong{
  font-size:max(11px,1em);
}

/* Advanced Flow: 7–9px text was visually collapsing at normal canvas zoom. */
.wrekt-flow-brand strong{font-size:12px!important}
.wrekt-flow-brand small{font-size:10px!important;line-height:1.2!important}
.wrekt-flow-toolbar-actions button,
.wrekt-flow-toolbar-actions select,
.wrekt-flow-toolbar-actions output{
  font-size:10px!important;
  min-height:28px;
}
.wrekt-flow-library button strong,
.wrekt-flow-quick-add-list button strong,
.wrekt-flow-quick-add-title strong,
.wrekt-flow-node-title strong{
  font-size:11px!important;
  line-height:1.15!important;
}
.wrekt-flow-library button small,
.wrekt-flow-library button b,
.wrekt-flow-quick-add-title small,
.wrekt-flow-quick-add-group,
.wrekt-flow-quick-add-list button small,
.wrekt-flow-quick-add-list button b,
.wrekt-flow-node-title small,
.wrekt-flow-source-controls label,
.wrekt-flow-processor-controls label,
.wrekt-flow-source-status small,
.wrekt-flow-calls-summary small,
.wrekt-flow-processor-status small,
.wrekt-flow-envelope-body label,
.wrekt-flow-envelope-stats small,
.wrekt-flow-envelope-body p,
.wrekt-flow-indicator-empty{
  font-size:10px!important;
  line-height:1.25!important;
}
.wrekt-flow-port{
  font-size:10px!important;
  line-height:1!important;
  max-width:142px;
}
.wrekt-flow-port .label{
  max-width:110px;
  padding:5px 6px;
}
.wrekt-flow-market-source p,
.wrekt-flow-calls-source p,
.wrekt-flow-processor p,
.wrekt-flow-tool-intro p{
  font-size:10px!important;
  line-height:1.45!important;
}
.wrekt-flow-tool-intro b,
.wrekt-flow-tool-property-label,
.wrekt-flow-tool-output small,
.wrekt-flow-tool-reset,
.wrekt-flow-tool-empty{
  font-size:10px!important;
  line-height:1.15!important;
}
.wrekt-flow-tool-field{
  height:30px;
  font-size:11px!important;
  line-height:1.2!important;
}
.wrekt-flow-tool-output b{
  font-size:11px!important;
  line-height:1.1!important;
}
.wrekt-flow-tool-output{
  min-height:27px;
  padding:6px 7px;
}
.wrekt-flow-tool-property{
  grid-template-columns:minmax(82px,116px) minmax(0,1fr) 24px;
  gap:8px;
}
.wrekt-flow-tool-properties{gap:7px}
.wrekt-flow-tool-body{gap:9px;padding:12px 14px 11px}
.wrekt-flow-envelope-body input{font-size:11px!important}
.wrekt-flow-envelope-body button{font-size:10px!important}
.wrekt-flow-envelope-stats b{font-size:12px!important}
.wrekt-flow-calls-list strong,
.wrekt-flow-calls-list span{font-size:10px!important}
.wrekt-flow-quick-add-empty{font-size:10px!important}

/* Keep deliberately tiny BUILD as the only desktop micro-label. */
body:not([data-layout-mode^="phone-"]) #wrekt-build-badge{font-size:8px!important}

/* Phones still need compact density, but no 5–8px ordinary UI text. */
body[data-layout-mode^="phone-"]{
  --wrekt-readable-control:10px;
  --wrekt-readable-meta:9px;
  --wrekt-readable-body:11px;
}
body[data-layout-mode^="phone-"] .market-ticker-item,
body[data-layout-mode^="phone-"] .market-ticker-item strong,
body[data-layout-mode^="phone-"] .market-ticker-price,
body[data-layout-mode^="phone-"] .market-ticker-change{
  font-size:10px!important;
}
body[data-layout-mode^="phone-"] #wrekt-build-badge{font-size:8px!important}


/* WrektView Flow command-surface system v1 */
.wrekt-flow-library{top:38px;right:8px;width:min(390px,calc(100vw - 20px));max-height:min(620px,calc(100vh - 54px));display:block;gap:0;padding:0;overflow-y:auto;overflow-x:hidden;border:1px solid #2c3f4c;border-radius:8px;background:#0a1117;box-shadow:0 18px 48px rgba(0,0,0,.50),0 0 0 1px rgba(255,255,255,.015);scrollbar-width:thin;scrollbar-color:#344b5b transparent}
.wrekt-flow-library[data-flow-recipes-popover]{width:min(420px,calc(100vw - 20px))}
.wrekt-flow-library::-webkit-scrollbar{width:8px}.wrekt-flow-library::-webkit-scrollbar-track{background:transparent}.wrekt-flow-library::-webkit-scrollbar-thumb{border:2px solid transparent;border-radius:8px;background:#344b5b;background-clip:padding-box}
.wrekt-flow-library-top{position:sticky;top:0;z-index:4;padding:10px;border-bottom:1px solid #263845;background:#0c141b;box-shadow:0 6px 16px rgba(0,0,0,.18)}
.wrekt-flow-library-intro{padding:0 1px 9px;color:#859aa9;font:900 8px/1.25 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.075em}
.wrekt-flow-library-search{width:100%;height:36px;box-sizing:border-box;margin:0 0 8px;padding:0 10px;border:1px solid #2f4351;border-radius:6px;outline:none;color:#e8f2f7;background:#0d161e;font:800 9px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;box-shadow:none}
.wrekt-flow-library-search::placeholder{color:#647a89}.wrekt-flow-library-search:focus{border-color:#48697b;box-shadow:0 0 0 2px rgba(103,169,197,.16)}
.wrekt-flow-library-chips{display:flex;gap:4px;overflow-x:auto;overflow-y:hidden;padding:0 0 2px;scrollbar-width:none}.wrekt-flow-library-chips::-webkit-scrollbar{display:none}
.wrekt-flow-library button.wrekt-flow-library-chip{flex:0 0 auto;min-height:28px;height:28px;display:inline-flex;grid-template-columns:none;align-items:center;justify-content:center;gap:0;padding:0 8px;border:1px solid #2b3d49;border-radius:5px;color:#8197a7;background:#0b141b;font:900 8px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.045em;white-space:nowrap}
.wrekt-flow-library button.wrekt-flow-library-chip:hover,.wrekt-flow-library button.wrekt-flow-library-chip:focus-visible{border-color:#436173;color:#e8f2f7;background:#111f29;outline:none}
.wrekt-flow-library button.wrekt-flow-library-chip[data-active="true"]{border-color:#4d7186;color:#f3fbff;background:#152633}
.wrekt-flow-library-count{padding:7px 1px 0;color:#617989;font:800 7px/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.035em}
.wrekt-flow-library-group-title{margin:0 10px;padding:11px 1px 5px;border-bottom:1px solid #22323d;color:#6f8c9d;font:900 8px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.10em}
.wrekt-flow-library button.wrekt-flow-library-item{width:calc(100% - 16px);min-height:50px;margin:4px 8px 0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:7px 9px;border:1px solid #223440;border-radius:6px;color:#d6e2e9;background:#0d161e;text-align:left;box-sizing:border-box}
.wrekt-flow-library button.wrekt-flow-library-item:last-child{margin-bottom:8px}
.wrekt-flow-library button.wrekt-flow-library-item:hover,.wrekt-flow-library button.wrekt-flow-library-item:focus-visible{border-color:#3f5e70;color:#fff;background:#12212b;outline:none}
.wrekt-flow-library button.wrekt-flow-library-item span{min-width:0;display:grid;gap:4px}
.wrekt-flow-library button.wrekt-flow-library-item strong{overflow:hidden;color:#edf5f9;font:900 9px/1.1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.025em;text-overflow:ellipsis;white-space:nowrap}
.wrekt-flow-library button.wrekt-flow-library-item small{overflow:hidden;color:#718898;font:750 7px/1.25 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;text-overflow:ellipsis;white-space:nowrap}
.wrekt-flow-library button.wrekt-flow-library-item b{min-width:34px;padding:4px 5px;border:1px solid #305164;border-radius:4px;color:#8bd4ec;background:#0b1a23;font:900 7px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.05em;text-align:center}
.wrekt-flow-library-empty{margin:8px;padding:24px 10px;border:1px dashed #2a3b47;border-radius:6px;color:#5f7787;background:#0b131a;text-align:center;font:900 8px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.09em}
