/* The workflow builder's Code tab (workflow-builder-code.js). */
/* The column of the calls and the app: one track that never grows past its column, however wide a row of file tabs is. */
.wb-codecol { grid-template-columns: minmax(0, 1fr); }

/* The run, call by call (WB14): a list beside a stage, as the owner's canvas (option D) draws it. */
.wb-run { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); margin: 0 0 22px; min-width: 0; }
.wb-run h3 { margin: 0; }
.wb-runhead { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; }
.wb-runhead > div:first-child { flex: 1 1 380px; min-width: 0; } .wb-runhead p { margin: 4px 0 0; max-width: 70ch; }
#c-play { min-height: 44px; min-width: 110px; }
.wb-runctl { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; } .wb-runctl .wb-f { margin: 0; } .wb-runctl .wb-acts { flex-wrap: nowrap; gap: 6px; }
.wb-lanes { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.wb-lanes li::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; background: var(--ln); vertical-align: -1px; }
/* the lanes: who makes the call */
.ln-server { --ln: #2747e0; --ln-bg: #e6ebfc; --ln-ink: #1f3bb8; } .ln-signet { --ln: #8a958f; --ln-bg: #eef0ec; --ln-ink: #33403d; }
.ln-app { --ln: #5b6b66; --ln-bg: #eef0ec; --ln-ink: #33403d; }
/* Your app at either end of the run: not a call, so dashed, with no number (owner, 2026-12-04). */
.wb-calls button.ln-app { border-style: dashed; background: transparent; } .wb-calls .ln-app .wb-n { background: transparent; border: 2px dashed var(--ln); }
.wb-phone.app .wb-srv { background: var(--surface); color: var(--ink); place-content: center; text-align: center; }
.wb-appscreen { display: grid; gap: 10px; justify-items: center; padding: 18px; } .wb-appscreen b { font-size: 16px; } .wb-appscreen p { margin: 0; font-size: 13px; color: var(--muted); }
.wb-appbtn { padding: 8px 18px; border-radius: 8px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 13px; }
.ln-webhook { --ln: #c2410c; --ln-bg: #fbe9df; --ln-ink: #8f2f08; } .ln-device { --ln: #0f766e; --ln-bg: #ddf3ef; --ln-ink: #0b5650; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .wb-run [class*=ln-] { --ln-bg: color-mix(in srgb, var(--ln) 22%, transparent); --ln-ink: var(--ink); } }
:root[data-theme=dark] .wb-run [class*=ln-] { --ln-bg: color-mix(in srgb, var(--ln) 22%, transparent); --ln-ink: var(--ink); }

.wb-rungrid { display: grid; grid-template-columns: minmax(260px, 330px) minmax(0, 1fr); gap: 18px; align-items: start; min-width: 0; }
.wb-listbox { display: grid; gap: 8px; min-width: 0; }
.wb-count { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
/* the list scrolls in its own box, and keeps the running call in view */
.wb-calls { margin: 0; padding: 6px; list-style: none; display: grid; gap: 6px; max-height: 660px; overflow-y: auto; overscroll-behavior: contain; position: relative; }
.wb-calls li { margin: 0; }
.wb-calls button { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 10px; width: 100%; min-height: 52px; padding: 8px 10px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; box-shadow: none; }
.wb-calls button:hover { background: var(--surface); border-color: var(--line-strong); }
.wb-calls .wb-n { grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; background: var(--ln); }
.wb-calls .done .wb-n { background: var(--ok); }
.wb-calls [aria-current=step] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.wb-calls .out { opacity: .6; } .wb-calls .out .wb-n { background: var(--line-strong); }
.wb-what { display: grid; min-width: 0; } .wb-what b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.wb-mp { font: 12px/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.wb-longnote { margin: 0; font-size: 12px; color: var(--muted); }
.wb-res { grid-column: 2; justify-self: start; margin-top: 2px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 6px; background: #e3f3e8; color: #1d6b3a; } .wb-res:empty { display: none; }
.wb-res.off { background: var(--surface-2); color: var(--muted); }

.wb-rstage { display: grid; gap: 12px; min-width: 0; padding: 16px; border-radius: 12px; background: var(--bg); }
.wb-rstage .wb-info { background: var(--surface); }
.wb-cap { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 14px; }
.wb-capn { color: var(--muted); font-size: 13px; } .wb-capr { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--ln-bg); color: var(--ln-ink); }
.wb-runtrack { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.wb-runbar { display: block; height: 100%; width: var(--v, 0); background: var(--accent); border-radius: 3px; transition: width .4s; }
.wb-stagerow { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 18px; align-items: start; }
.wb-phonecol { display: grid; gap: 8px; justify-items: center; }
/* the phone: the preview page itself at 390 px, drawn at 70 % */
.wb-phone { width: 300px; height: 600px; box-sizing: border-box; border: 10px solid #10201f; border-radius: 40px; background: #10201f; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
/* the header: what Signet is doing, beside a small square in the webhook's orange, as the canvas has it */
.wb-ptop { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 8px 12px 10px; background: #10201f; color: #fff; font-size: 12px; font-weight: 600; min-height: 18px; }
.wb-ptop i { flex: none; width: 8px; height: 8px; border-radius: 2px; background: #c2410c; }
.wb-screen { position: relative; flex: 1; width: 280px; overflow: hidden; border-radius: 0 0 30px 30px; background: #fff; }
.wb-screen iframe { width: 390px; height: 760px; border: 0; transform: scale(.718); transform-origin: 0 0; pointer-events: none; }
.wb-srv { display: none; position: absolute; inset: 0; padding: 14px; gap: 6px; align-content: start; overflow: auto; background: #12201e; color: #e6efe9; font-size: 12px; }
.wb-srv pre { margin: 0; padding: 8px; border-radius: 8px; background: rgba(255, 255, 255, .06); font: 11px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.wb-phone.server .wb-srv { display: grid; } .wb-phone.server iframe { visibility: hidden; }
.wb-note { margin: 0; max-width: 300px; text-align: center; color: var(--muted); }
.wb-draw { display: flex; gap: 10px; justify-content: center; color: var(--ink); } .wb-draw .dp-art { width: 110px; height: auto; }
.wb-draw .dp-acc { stroke: var(--accent); } .wb-draw .dp-thin { stroke-width: 1.2; } .wb-draw .dp-pt { fill: var(--accent); stroke: none; } .wb-draw .dp-txt { fill: var(--muted); stroke: none; font: 9px var(--mono); }
.wb-draw .dp-rise { animation: wb-rise .4s ease-out both; } @keyframes wb-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.wb-info { display: grid; gap: 10px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.wb-info p { margin: 0; }
.wb-ihead { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; } .wb-ihead code { overflow-wrap: anywhere; } .wb-ihead a { margin-left: auto; font-size: 14px; }
.wb-lane { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 6px; background: var(--ln-bg); color: var(--ln-ink); } .wb-m { font: 600 12px var(--mono); }
.wb-branch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.wb-branch > div { padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; } .wb-branch dt { font-weight: 600; } .wb-branch dd { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.wb-sample summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.wb-sample .wb-two { margin-top: 8px; } .wb-sample .wb-two > div { display: grid; gap: 4px; min-width: 0; align-content: start; } .wb-sample b { font-size: 13px; color: var(--muted); font-weight: 500; }
.wb-sample pre { margin: 0; max-height: 280px; overflow: auto; padding: 10px 12px; border-radius: 8px; background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--code-line); font: 12px/1.5 var(--mono); }

@media (max-width: 1180px) { .wb-stagerow { grid-template-columns: minmax(0, 1fr); justify-items: center; } .wb-info { justify-self: stretch; } }
@media (max-width: 860px) { .wb-rungrid { grid-template-columns: minmax(0, 1fr); } .wb-calls { max-height: 300px; } .wb-run { padding: 14px; } .wb-sample .wb-two, .wb-branch { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .wb-runbar { transition: none; } .wb-draw .dp-rise, .wb-draw .dp-sweep { animation: none; } }
/* A phone's width: the canvas's 300 px phone, drawn smaller where the column is narrower than it. */
@media (max-width: 420px) { .wb-run { padding: 10px; } .wb-rstage { padding: 8px; } .wb-phone { zoom: .86; } .wb-note { max-width: 260px; } }

/* The spec of these calls (WB15): a fixed-height preview that scrolls, with its file name and size. */
.wb-specbox { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); margin: 0 0 22px; min-width: 0; }
.wb-specbox h3, .wb-specbox > p { margin: 0; }
.wb-specbar { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; }
.wb-own { display: flex; gap: 10px; align-items: flex-start; flex: 1 1 360px; min-width: 0; cursor: pointer; } .wb-own input { margin-top: 3px; flex: none; width: 18px; height: 18px; }
.wb-own > span { display: grid; gap: 2px; min-width: 0; }
.wb-specline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 13px; } .wb-specfile { font: 600 13px var(--mono); overflow-wrap: anywhere; }
.wb-spec { margin: 0; height: 360px; overflow: auto; padding: 14px 16px; border-radius: 10px; background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--code-line); font: 12.5px/1.55 var(--mono); }
.wb-spec code { background: none; padding: 0; color: inherit; font: inherit; }
.wb-specbox .wb-acts { align-items: center; gap: 8px 12px; }
@media (max-width: 860px) { .wb-specbox { padding: 14px; } .wb-spec { height: 300px; } }
