/* GGS Flow, hosted variant: the workflow designer. Uses the colours of cloud.css. */
.main.view-workflows:has(.wf) { padding: 0; max-width: none; }
.main.view-workflows:has(.wf) { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.wf { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.wf-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.wf-bar .grow, .filter .grow, .row .grow { flex: 1; }
.wf-bar input { margin: 0; }
.wf-bar .wf-name { width: 280px; font-weight: 600; }
.wf-bar .wf-version { width: 90px; }
.wf-status { padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--line); max-height: 132px; overflow: auto; font-size: 13px; }
.wf-status .row, .filter .row, .row.option { display: flex; align-items: center; gap: 8px; }
.wf-status .issue { display: block; width: 100%; text-align: left; border: 0; background: none; font: inherit; padding: 3px 0 3px 12px; margin-top: 4px; border-left: 3px solid var(--amber); color: var(--ink-2); cursor: pointer; }
.wf-status .issue.bad { border-left-color: var(--red); color: var(--red-dark); }
.wf-status button.issue:hover { background: var(--line-2); }
.wf-body { flex: 1; display: grid; grid-template-columns: 188px 1fr 400px; min-height: 0; }

.wf-palette { background: var(--card); border-right: 1px solid var(--line); padding: 10px; overflow: auto; }
.wf-palette .group { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 12px 6px 6px; }
.wf-palette button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; margin-bottom: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.wf-palette button:hover { border-color: var(--red); }
.glyph { flex: none; width: 34px; height: 26px; border-radius: 6px; background: var(--grey-soft); color: var(--ink-2); display: grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: .02em; }

.wf-canvas { overflow: auto; background-color: var(--paper); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 22px 22px; }
.wf-space { position: relative; }
.wf-lines { position: absolute; left: 0; top: 0; pointer-events: none; }
.wf-lines .edge { fill: none; stroke: #8a93a5; stroke-width: 2; }
.wf-lines .edge.live { stroke: var(--red); stroke-dasharray: 5 4; }
.wf-cut { position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink-3); font-size: 12px; line-height: 14px; padding: 0; cursor: pointer; opacity: .55; }
.wf-cut:hover { opacity: 1; color: var(--red-dark); border-color: var(--red); }
.wf-node { position: absolute; width: 220px; height: 74px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); cursor: grab; user-select: none; touch-action: none; }
.wf-node.end { border-left: 4px solid var(--green); }
.wf-node.on { border-color: var(--ink); }
.wf-node.warn { border-color: var(--amber); }
.wf-node.bad { border-color: var(--red); background: var(--red-soft); }
.wf-node .text { min-width: 0; }
.wf-node b, .wf-node small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-node b { font-size: 14px; }
.wf-node small { color: var(--ink-3); font-size: 11px; }
.wf-node .port { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--card); border: 2px solid #8a93a5; }
.wf-node .port.in { left: -9px; top: 29px; }
.wf-node .port.out { right: -9px; top: 29px; cursor: crosshair; }
.wf-node .port.out:hover, .wf-node .port.yes:hover, .wf-node .port.no:hover { border-color: var(--red); }
.wf-node .port.yes, .wf-node .port.no { right: -20px; width: 36px; height: 20px; border-radius: 10px; font-size: 10px; font-weight: 700; text-align: center; line-height: 16px; cursor: crosshair; }
.wf-node .port.yes { top: 12px; color: var(--green); border-color: var(--green); }
.wf-node .port.no { top: 44px; color: var(--red-dark); border-color: var(--red); }

.wf-side { background: var(--card); border-left: 1px solid var(--line); padding: 16px; overflow: auto; }
.wf-side h3 { font-size: 13px; margin: 0 0 6px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.wf-side .section { margin: 18px 0 8px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.wf-side select, .wf-side input[type=number] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--card); }
.wf-side textarea { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.wf-side .check.tight { margin: 2px 0; }
.with-editable { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.with-editable .check.small { font-size: 12px; color: var(--ink-3); margin-bottom: 14px; }
.filter { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.filter > summary { cursor: pointer; }
.filter .row { margin: 6px 0 10px; }
.row.option { margin-bottom: 6px; }
.row.option input { margin: 0; }
details.tags { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
details.tags > summary { cursor: pointer; font-weight: 600; font-size: 13px; }
details.tags .group { margin-top: 8px; }
details.tags .group b { font-size: 12px; color: var(--ink-2); }
button.tag { border: 1px solid var(--line); background: var(--grey-soft); border-radius: 6px; padding: 2px 6px; margin: 3px 4px 0 0; font-family: ui-monospace, Consolas, monospace; font-size: 12px; cursor: pointer; }
button.tag:hover { border-color: var(--red); }
button.link { border: 0; background: none; padding: 0; font: inherit; color: var(--red-dark); text-decoration: underline; cursor: pointer; text-align: left; }
dialog:has(form.wide) { width: min(860px, calc(100vw - 32px)); }
dialog form.wide table { table-layout: auto; }
dialog form.wide td, dialog form.wide th { padding: 10px 12px; }
dialog form.wide td.actions { white-space: normal; }
[hidden] { display: none !important; }

.wf-bar .wf-icon img { width: 20px; height: 20px; object-fit: contain; vertical-align: -5px; margin-right: 6px; }
.wf-icon-now { margin: 0 0 12px; min-height: 96px; display: flex; align-items: center; }
.wf-icon-now img { width: 96px; height: 96px; object-fit: contain; background: #f1f3f5; border-radius: 8px; padding: 8px; }
