.flow-panel {padding:var(--panel-inset);min-width:0}
.flow-tools {margin-bottom:16px}
.flow-tools label {display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.flow-tools select {max-width:min(100%,32rem)}
.flow-scroll {overflow:auto;max-height:78vh;border-radius:14px;background:radial-gradient(circle,#baaeef55 1px,transparent 1.4px) 0 0/16px 16px}
.flow-board {position:relative;padding:12px 0 24px;isolation:isolate}
.flow-nodes {width:clamp(185px,36vw,330px);box-sizing:border-box;padding-left:12px}
.flow-nodes section+section {margin-top:24px}
.flow-nodes h3 {margin:0 0 10px}
.flow-step {margin:0 0 13px;display:grid;gap:4px}
.flow-step header {box-sizing:border-box;display:grid;min-height:44px;align-content:center;padding:8px 10px;background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:10px;color:var(--ui-text)}
.flow-step .flow-tile {max-width:none;border:0;padding:0;background:transparent;text-align:left}
.flow-port {margin-left:18px;padding:6px 10px;border:1px solid var(--ui-border);border-right:3px solid var(--wire,var(--ui-accent));border-radius:7px;background:var(--ui-surface);color:var(--ui-secondary);font:inherit;font-size:.81rem;text-align:left;cursor:pointer}
.flow-wires {position:absolute;inset:0;width:100%;height:100%;pointer-events:none;fill:none;stroke-width:1.6}
.flow-tile {position:relative;flex:1;max-width:210px;min-width:0;display:grid;gap:5px;text-align:left;align-content:center;padding:9px 11px;border-radius:10px;border:1px solid var(--ui-border);color:var(--ui-text);font:inherit;cursor:pointer;overflow-wrap:anywhere}
.flow-tile strong {font-size:1rem;line-height:1.15}
.flow-indicators {display:flex;flex-wrap:wrap;gap:10px;font-size:.76rem;color:var(--ui-secondary)}
.flow-indicator[data-present=true] {color:var(--ui-text)}
.flow-tile:hover,.flow-tile:focus-visible {border-color:var(--ui-accent)}
.flow-photo {width:100%;max-height:240px;object-fit:contain;border-radius:12px}
.flow-message {white-space:pre-wrap;overflow-wrap:anywhere}
.flow-actions {display:flex;gap:8px;flex-wrap:wrap}

.flow-nodes {width:100%;padding:0;box-sizing:border-box}
.flow-board {min-width:780px;padding:18px 42px 40vh;box-sizing:border-box}
.flow-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));column-gap:52px;row-gap:74px;align-items:start}
.flow-nodes section+section {margin-top:78px}
.flow-step {margin:0;min-width:0}
.flow-port {margin-left:0;line-height:1.25}
.flow-wires g {cursor:pointer}
.wire-hit {fill:none;stroke:transparent;stroke-width:10;pointer-events:stroke}
.wire-ink,.wire-tip {pointer-events:none}
.flow-wires g:hover .wire-ink {stroke:white;stroke-width:3}
.flow-step.flow-selected header {outline:2px solid var(--ui-accent);outline-offset:2px}

#modal:has(.flow-phone-layout) {width:min(1080px,calc(100% - 24px));max-width:1080px}
.flow-phone-layout {display:grid;grid-template-columns:minmax(0,1fr) minmax(270px,352px);align-items:start;gap:clamp(18px,3vw,42px)}
.flow-phone-layout>div {min-width:0}
.flow-iphone.tg-phone {width:100%;border:7px solid #111217;border-radius:42px;box-shadow:0 0 0 2px #686875,0 16px 32px #07071166}
.flow-iphone .tg-status {position:relative;height:37px}
.flow-iphone .tg-status:after {content:"";position:absolute;left:50%;top:7px;transform:translateX(-50%);width:76px;height:21px;border-radius:16px;background:#111217}
.flow-iphone .tg-chat {height:clamp(300px,54vh,540px);min-height:0;overflow:auto;overscroll-behavior:contain}
.flow-iphone .tg-chat-head {min-height:48px}
.flow-iphone .tg-caption {font-size:14px;line-height:1.38}
.flow-iphone .tg-input {padding:5px 12px}
.flow-tg-link {color:#168acd}
.flow-keyboard {background:#d4d7df;padding:4px 6px 8px;color:#18212a}
.flow-keyboard>div {display:flex;gap:4px;margin-bottom:4px}
.flow-keyboard span {flex:1;display:grid;place-items:center;text-align:center;padding:6px 3px;border-radius:5px;background:white;box-shadow:0 1px 1px #20273338;font-size:12px;line-height:1.2}
.flow-keyboard:after {content:"";display:block;margin:10px auto 0;width:90px;height:4px;border-radius:4px;background:#21242d}
@media(max-width:700px){.flow-phone-layout{grid-template-columns:minmax(0,1fr)}.flow-phone-layout aside{width:min(100%,352px);justify-self:center}}
.flow-editor,.flow-editor>section {display:grid;align-content:start;gap:10px;min-width:0}
.flow-editor {gap:20px}
.flow-editor h3 {margin:0}
.flow-editor .flow-photo {max-height:170px;width:auto;max-width:100%;margin:0}
.flow-editor textarea {resize:vertical}
.flow-editor .flow-upload {justify-self:start;position:relative;overflow:hidden;cursor:pointer}
.flow-upload input {position:absolute;inset:0;opacity:0;cursor:pointer;width:100%}
.flow-upload:focus-within {outline:2px solid currentColor}
.flow-format {display:flex;gap:8px;flex-wrap:wrap}
#flow-body {padding:12px;min-height:8em;border:1px solid #646079;border-radius:12px;background:#171827;color:inherit}
#flow-body,.flow-iphone .tg-caption {white-space:pre-wrap;overflow-wrap:anywhere}
#flow-body:focus-visible {outline:2px solid var(--ui-accent)}
.flow-iphone .tg-caption a,#flow-body a {color:#278fd2;text-decoration:underline}
