/*
 * Workflow live page (/feed/workflow-live). Global rather than scoped: the views nest many small
 * components, and scoped CSS only reaches the HTML written in its own file.
 * Every colour comes from the MudBlazor palette, so light and dark themes both work.
 */

.wfl {
    --wfl-surface: var(--mud-palette-surface);
    --wfl-bg: var(--mud-palette-background);
    --wfl-bg-2: var(--mud-palette-background-gray, var(--mud-palette-background-grey));
    --wfl-line: var(--mud-palette-lines-default);
    --wfl-ink: var(--mud-palette-text-primary);
    --wfl-ink-2: var(--mud-palette-text-secondary);
    --wfl-accent: var(--mud-palette-primary);
    --wfl-ok: var(--mud-palette-success);
    --wfl-err: var(--mud-palette-error);
    --wfl-run: var(--mud-palette-info);
    --wfl-cancel: var(--mud-palette-warning);
    /* Ignored rows: a yellow, not the orange of cancellations and warnings, so they do not read as
       errors. Mixed with the text colour, it darkens on the light theme and lightens on the dark one. */
    --wfl-ignored: color-mix(in srgb, #FFD600 74%, var(--wfl-ink));
    --wfl-ignored-bg: color-mix(in srgb, #FFD600 18%, transparent);
    --wfl-idle: var(--mud-palette-text-disabled);
    --wfl-raw: #5C6BC0;
    --wfl-norm: #AB47BC;
    --wfl-ref: #26A69A;
    --wfl-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --wfl-r: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    color: var(--wfl-ink);
}

.wfl *, .wfl *::before, .wfl *::after { box-sizing: border-box; }
.wfl .wfl-mono { font-family: var(--wfl-mono); font-variant-numeric: tabular-nums; }
.wfl .wfl-muted { color: var(--wfl-ink-2); }
.wfl .wfl-spacer { flex: 1; }
.wfl .wfl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wfl :focus-visible { outline: 2px solid var(--wfl-accent); outline-offset: 2px; }
.wfl a { color: var(--wfl-accent); }

/* Status and zone colours, as custom properties every component reads */
.wfl .wfl-st-ok { --sc: var(--wfl-ok); }
.wfl .wfl-st-err { --sc: var(--wfl-err); }
.wfl .wfl-st-run { --sc: var(--wfl-run); }
.wfl .wfl-st-cancel { --sc: var(--wfl-cancel); }
.wfl .wfl-st-idle { --sc: var(--wfl-idle); }
.wfl .wfl-z-raw { --zc: var(--wfl-raw); }
.wfl .wfl-z-norm { --zc: var(--wfl-norm); }
.wfl .wfl-z-ref { --zc: var(--wfl-ref); }
.wfl .wfl-c-ok { color: var(--wfl-ok); }
.wfl .wfl-c-err { color: var(--wfl-err); }
.wfl .wfl-c-run { color: var(--wfl-run); }
.wfl .wfl-c-cancel { color: var(--wfl-cancel); }
.wfl .wfl-bg-ok { background: var(--wfl-ok); }
.wfl .wfl-bg-err { background: var(--wfl-err); }
.wfl .wfl-bg-cancel { background: var(--wfl-cancel); }
.wfl .wfl-bg-run {
    background: var(--wfl-run);
    background-image: repeating-linear-gradient(90deg, transparent 0 4px, rgba(255, 255, 255, .35) 4px 8px);
}

.wfl .wfl-ico { width: 16px !important; height: 16px !important; flex: none; }
.wfl .wfl-spin { width: 14px !important; height: 14px !important; }

/* ---------- Header ---------- */
.wfl-top {
    background: var(--wfl-surface);
    border: 1px solid var(--wfl-line);
    border-radius: 12px;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
    gap: 14px 24px;
    align-items: center;
}
.wfl-top.is-embedded { border-style: dashed; padding: 10px 14px; }
.wfl-ident { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wfl-feed { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wfl-feed-name { font-size: 1.15rem; font-weight: 600; text-decoration: none; color: var(--wfl-ink) !important; }
a.wfl-feed-name:hover { text-decoration: underline; }
.wfl-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--wfl-ink-2); align-items: center; }
.wfl-meta b { color: var(--wfl-ink); font-weight: 600; }
.wfl-run-select { max-width: 340px; }

.wfl-pill-status {
    display: inline-flex; align-items: center; gap: 6px;
    border-radius: 999px; padding: 2px 10px;
    font-size: .75rem; font-weight: 600; white-space: nowrap;
    color: var(--sc);
    background: color-mix(in srgb, var(--sc) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--sc) 35%, transparent);
}
.wfl-pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: wfl-pulse 1.4s ease-in-out infinite; }
@keyframes wfl-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); }
    60% { box-shadow: 0 0 0 6px transparent; }
}
.wfl-live { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--wfl-line); border-radius: 999px; padding: 1px 9px; font-size: .72rem; color: var(--wfl-ink-2); }
.wfl-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--wfl-cancel); }
.wfl-live.is-on i { background: var(--wfl-ok); }

.wfl-stepper { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.wfl-stepper-one { grid-template-columns: minmax(0, 1fr); }
.wfl-zone { border-radius: var(--wfl-r); padding: 8px 10px; background: var(--wfl-bg-2); border-left: 3px solid var(--zc); min-width: 0; }
.wfl-zone-t { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.wfl-zone-t b { font-size: .8rem; }
.wfl-zone-t span { font-size: .72rem; color: var(--wfl-ink-2); }
.wfl-zone-bar { height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--wfl-ink) 10%, transparent); margin-top: 7px; overflow: hidden; display: flex; }
.wfl-zone-bar i { display: block; height: 100%; }

.wfl-kpis { display: grid; grid-template-columns: repeat(4, auto); gap: 6px 16px; }
.wfl-kpi { display: flex; flex-direction: column; align-items: flex-end; }
.wfl-kpi .v { font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.wfl-kpi .l { font-size: .7rem; color: var(--wfl-ink-2); }

/* ---------- Toolbar ---------- */
.wfl-toolbar {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
    background: var(--wfl-surface); border: 1px solid var(--wfl-line); border-radius: 12px; padding: 8px 12px;
}
.wfl-seg { display: inline-flex; background: var(--wfl-bg-2); border-radius: var(--wfl-r); padding: 3px; gap: 2px; }
.wfl-seg button { border: 0; background: transparent; border-radius: 6px; padding: 5px 12px; font: inherit; font-size: .8rem; font-weight: 500; color: var(--wfl-ink-2); cursor: pointer; }
.wfl-seg button[aria-selected="true"] { background: var(--wfl-surface); color: var(--wfl-ink); box-shadow: var(--mud-elevation-1); }
.wfl-search { display: flex; align-items: center; gap: 6px; background: var(--wfl-bg-2); border: 1px solid var(--wfl-line); border-radius: var(--wfl-r); padding: 0 10px; height: 32px; flex: 1 1 220px; max-width: 360px; min-width: 0; color: var(--wfl-ink-2); }
.wfl-search input { border: 0; background: transparent; outline: 0; width: 100%; font: inherit; font-size: .82rem; color: var(--wfl-ink); }
.wfl-search-sm { max-width: 280px; height: 30px; }
.wfl-chip-toggle { border: 1px solid var(--wfl-line); background: var(--wfl-surface); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: .78rem; color: var(--wfl-ink-2); cursor: pointer; }
.wfl-chip-toggle[aria-pressed="true"] { background: color-mix(in srgb, var(--wfl-accent) 12%, transparent); border-color: var(--wfl-accent); color: var(--wfl-accent); font-weight: 600; }
.wfl-chip-toggle.is-err[aria-pressed="true"] { background: color-mix(in srgb, var(--wfl-err) 12%, transparent); border-color: var(--wfl-err); color: var(--wfl-err); }
.wfl-select { height: 30px; border: 1px solid var(--wfl-line); border-radius: var(--wfl-r); background: var(--wfl-surface); color: var(--wfl-ink); padding: 0 8px; font: inherit; font-size: .8rem; }
.wfl-count { font-size: .78rem; }

.wfl-focusbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: color-mix(in srgb, var(--wfl-accent) 10%, transparent); color: var(--wfl-accent); border-radius: var(--wfl-r); padding: 6px 12px; font-size: .82rem; }
.wfl-crumbs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.wfl-focusbar .wfl-btn { margin-left: auto; }

/* ---------- Generic controls ---------- */
.wfl-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--wfl-line); background: var(--wfl-surface); color: var(--wfl-ink) !important; border-radius: var(--wfl-r); padding: 5px 11px; font: inherit; font-size: .8rem; text-decoration: none; cursor: pointer; }
.wfl-btn:hover { background: var(--wfl-bg-2); }
.wfl-btn-sm { padding: 3px 8px; font-size: .76rem; }
.wfl-btn-primary { background: var(--wfl-accent); border-color: var(--wfl-accent); color: var(--mud-palette-primary-text) !important; }
.wfl-btn-danger { color: var(--wfl-err) !important; border-color: color-mix(in srgb, var(--wfl-err) 40%, transparent); }
.wfl-btn[disabled] { opacity: .6; cursor: default; }
.wfl-icon-btn { border: 0; background: transparent; color: var(--wfl-ink-2); width: 28px; height: 28px; border-radius: 6px; display: inline-grid; place-items: center; cursor: pointer; }
.wfl-icon-btn:hover { background: var(--wfl-bg-2); color: var(--wfl-ink); }
.wfl-link { border: 0; background: none; padding: 0; color: var(--wfl-accent); font: inherit; cursor: pointer; text-decoration: underline; }
.wfl-tag { font-size: .66rem; font-weight: 700; border-radius: 4px; padding: 1px 5px; background: color-mix(in srgb, var(--wfl-ink) 8%, transparent); color: var(--wfl-ink-2); letter-spacing: .03em; white-space: nowrap; }
.wfl-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--wfl-line); background: var(--wfl-surface); border-radius: 999px; padding: 2px 9px; font: inherit; font-size: .75rem; color: var(--wfl-ink-2); }
button.wfl-chip { cursor: pointer; }
.wfl-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--sc, var(--wfl-idle)); }
.wfl-chip.is-warn { color: var(--wfl-cancel); border-color: var(--wfl-cancel); font-weight: 600; }
.wfl-chiplist { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.wfl-avatar { width: 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--zc, var(--wfl-ref)) 18%, var(--wfl-surface)); color: var(--zc, var(--wfl-ref)); display: inline-grid; place-items: center; font-size: .62rem; font-weight: 700; flex: none; object-fit: cover; }
.wfl-avatar-sm { width: 16px; height: 16px; font-size: .55rem; }
.wfl-empty { color: var(--wfl-ink-2); font-size: .82rem; text-align: center; padding: 18px 8px; }
.wfl-empty-big { background: var(--wfl-surface); border: 1px dashed var(--wfl-line); border-radius: 12px; padding: 28px; }
.wfl-loading { display: flex; flex-direction: column; gap: 8px; padding: 18px; }

/* Fold button of a zone column, a tenant lane or a tenant frame */
.wfl-zfold { border: 0; background: transparent; color: var(--wfl-ink-2); width: 22px; height: 22px; border-radius: 5px; display: inline-grid; place-items: center; cursor: pointer; flex: none; padding: 0; }
.wfl-zfold:hover { background: color-mix(in srgb, var(--wfl-ink) 8%, transparent); color: var(--wfl-ink); }
.wfl-zfold .mud-icon-root { font-size: 1rem; width: 1em; height: 1em; }

/* Row counters */
.wfl-rows { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.wfl-r { display: inline-flex; align-items: center; gap: 3px; font-family: var(--wfl-mono); font-size: .7rem; border-radius: 4px; padding: 1px 5px 1px 3px; background: color-mix(in srgb, var(--wfl-ink) 7%, transparent); color: var(--wfl-ink-2); white-space: nowrap; }
.wfl-r .mud-icon-root { font-size: .9rem; width: 1em; height: 1em; }
.wfl-r-a { color: var(--wfl-ok); background: color-mix(in srgb, var(--wfl-ok) 13%, transparent); }
.wfl-r-m { color: var(--wfl-run); background: color-mix(in srgb, var(--wfl-run) 13%, transparent); }
.wfl-r-e { color: var(--wfl-err); background: color-mix(in srgb, var(--wfl-err) 13%, transparent); font-weight: 600; }
.wfl-r-i { color: var(--wfl-ignored); background: var(--wfl-ignored-bg); }
.wfl-r-i.is-validated { color: var(--wfl-ok); background: color-mix(in srgb, var(--wfl-ok) 13%, transparent); }
.wfl-th-ic { display: inline-flex; align-items: center; gap: 4px; }
.wfl-th-ic .mud-icon-root { font-size: 1rem; width: 1em; height: 1em; }

/* ---------- Stage ---------- */
.wfl-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.wfl-stage.has-rail { grid-template-columns: 250px minmax(0, 1fr); }
.wfl-stage.has-insp { grid-template-columns: minmax(0, 1fr) 380px; }
.wfl-stage.has-rail.has-insp { grid-template-columns: 250px minmax(0, 1fr) 380px; }
.wfl-view { min-width: 0; background: var(--wfl-surface); border: 1px solid var(--wfl-line); border-radius: 12px; position: relative; min-height: 420px; overflow: hidden; }

/* ---------- Cards ---------- */
.wfl-card {
    position: relative;
    background: var(--wfl-surface);
    border: 1px solid var(--wfl-line);
    border-left: 3px solid var(--sc);
    border-radius: var(--wfl-r);
    padding: 8px 10px;
    cursor: pointer;
    text-align: left;
    transition: box-shadow .15s, transform .15s;
    min-width: 0;
}
.wfl-card:hover { box-shadow: var(--mud-elevation-3); transform: translateY(-1px); }
.wfl-card.is-selected { outline: 2px solid var(--wfl-accent); outline-offset: 1px; }
.wfl-card-zone { position: absolute; top: -1px; left: -3px; right: -1px; height: 3px; border-radius: var(--wfl-r) var(--wfl-r) 0 0; background: var(--zc); }
.wfl-card-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.wfl-card-title { font-weight: 600; font-size: .8rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfl-card-dur { font-family: var(--wfl-mono); font-size: .7rem; color: var(--wfl-ink-2); white-space: nowrap; }
.wfl-card-desc { font-size: .74rem; color: var(--wfl-ink-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfl-card .wfl-rows { margin-top: 6px; }
.wfl-card-err { margin-top: 6px; font-size: .74rem; color: var(--wfl-err); background: color-mix(in srgb, var(--wfl-err) 10%, transparent); border-radius: 5px; padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfl-st-cancel .wfl-card-err { color: var(--wfl-cancel); background: color-mix(in srgb, var(--wfl-cancel) 12%, transparent); }
.wfl-card-branch { border-style: dashed; border-left-style: solid; background: color-mix(in srgb, var(--wfl-accent) 5%, var(--wfl-surface)); }
.wfl-card-branch .wfl-card-title { font-style: italic; }
.wfl-prog { height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--wfl-ink) 10%, transparent); margin-top: 7px; overflow: hidden; }
.wfl-prog i { display: block; height: 100%; width: 40%; background: var(--wfl-run); animation: wfl-slide 1.4s linear infinite; }
@keyframes wfl-slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.wfl-fold { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); border: 1px solid var(--wfl-line); background: var(--wfl-surface); color: var(--wfl-ink-2); border-radius: 999px; font: inherit; font-size: .66rem; padding: 0 7px; line-height: 16px; cursor: pointer; z-index: 1; }
.wfl-fold:hover { color: var(--wfl-accent); border-color: var(--wfl-accent); }

.wfl-card-group { border-left-style: double; border-left-width: 5px; }
.wfl-gchips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.wfl-gchip { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: .7rem; border: 1px solid var(--wfl-line); background: var(--wfl-bg-2); border-radius: 999px; padding: 1px 7px 1px 5px; color: var(--wfl-ink-2); cursor: pointer; }
.wfl-gchip i { width: 7px; height: 7px; border-radius: 50%; background: var(--sc); }
.wfl-gchip:hover, .wfl-gchip.is-selected { border-color: var(--wfl-accent); color: var(--wfl-accent); }
.wfl-glink { font: inherit; font-size: .74rem; color: var(--wfl-accent); margin-top: 6px; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- Tree view ---------- */
.wfl-tree-viewport { position: relative; overflow: hidden; height: 74vh; min-height: 480px; cursor: grab; touch-action: none; background: var(--wfl-bg); }
.wfl-tree-viewport.is-panning { cursor: grabbing; user-select: none; }
/* Each wheel notch and tool eases over 100 ms, as on the classic page; a drag follows the pointer. */
.wfl-tree { display: inline-flex; flex-direction: column; align-items: center; padding: 26px 24px 40px; min-width: 100%; will-change: transform; transition: transform .1s ease-out; }
.wfl-tree-viewport.is-panning .wfl-tree { transition: none; }
.wfl-viewtools { position: absolute; right: 10px; top: 10px; display: flex; gap: 2px; z-index: 3; background: var(--wfl-surface); border: 1px solid var(--wfl-line); border-radius: var(--wfl-r); padding: 3px; box-shadow: var(--mud-elevation-2); }
.wfl-viewtools button { border: 0; background: transparent; width: 28px; height: 28px; border-radius: 6px; color: var(--wfl-ink-2); display: grid; place-items: center; cursor: pointer; }
.wfl-viewtools button:hover { background: var(--wfl-bg-2); color: var(--wfl-ink); }
.wfl-bx-node { display: flex; flex-direction: column; align-items: center; }
.wfl-bx-card { width: max-content; min-width: 220px; max-width: 420px; padding: 14px 14px 16px; }
.wfl-bx-card .wfl-card-top { align-items: flex-start; }
.wfl-bx-card .wfl-card-title { font-size: .84rem; line-height: 1.3; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.wfl-bx-card .wfl-card-desc { margin-top: 5px; line-height: 1.35; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
.wfl-bx-card .wfl-rows { margin-top: 9px; }
.wfl-bx-card .wfl-card-err { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.wfl-bx-arrow { width: 2px; height: 28px; background: var(--wfl-line); position: relative; flex: none; }
.wfl-bx-arrow.is-long { height: 36px; }
.wfl-bx-arrow::after { content: ""; position: absolute; left: -4px; bottom: -1px; border: 5px solid transparent; border-top: 6px solid var(--wfl-line); border-bottom: 0; }
.wfl-bx-zone-mark { font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--zc); border: 1px solid var(--zc); border-radius: 999px; padding: 2px 10px; background: var(--wfl-surface); }
.wfl-bx-children { display: flex; align-items: flex-start; gap: 20px; }
.wfl-bx-child { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 20px; }
.wfl-bx-child::before { content: ""; position: absolute; top: 0; left: 0; right: 0; border-top: 2px solid var(--wfl-line); }
.wfl-bx-child:first-child::before { left: 50%; }
.wfl-bx-child:last-child::before { right: 50%; }
.wfl-bx-child:only-child::before { display: none; }
.wfl-bx-child::after { content: ""; position: absolute; top: 0; left: calc(50% - 1px); height: 20px; border-left: 2px solid var(--wfl-line); }
.wfl-bx-roots > .wfl-bx-child { padding-top: 0; }
.wfl-bx-roots > .wfl-bx-child::before, .wfl-bx-roots > .wfl-bx-child::after { display: none; }
.wfl-bx-tenants { display: flex; align-items: flex-start; gap: 22px; padding-top: 6px; }
.wfl-bx-tenant { --zc: var(--wfl-ref); border: 1.5px dashed var(--wfl-line); border-radius: 14px; padding: 12px 14px 16px; background: color-mix(in srgb, var(--wfl-ref) 6%, var(--wfl-surface)); }
.wfl-bx-tenant-h { display: flex; align-items: center; gap: 8px; font-size: .8rem; margin-bottom: 4px; color: var(--wfl-ink-2); }
.wfl-bx-tenant-h b { color: var(--wfl-ink); }
.wfl-bx-tenant-h .wfl-avatar { width: 28px; height: 28px; font-size: .7rem; border: 1.5px solid var(--wfl-ref); }
.wfl-bx-tenant-h .wfl-muted { margin-left: auto; font-size: .72rem; }
.wfl-bx-tenant.is-collapsed { padding-bottom: 10px; }
.wfl-bx-tenant.is-collapsed .wfl-bx-tenant-h { margin-bottom: 0; }
.wfl-bx-tenant > .wfl-bx-children > .wfl-bx-child::before { display: none; }
.wfl-bx-tenant > .wfl-bx-children > .wfl-bx-child::after { height: 14px; }
.wfl-bx-tenant > .wfl-bx-children > .wfl-bx-child { padding-top: 14px; }
/* Tenant branches of several sibling steps, merged into one frame per tenant under the siblings. */
.wfl-bx-merge { display: flex; flex-direction: column; align-items: center; margin-top: 6px; }
.wfl-bx-merge > .wfl-bx-arrow:first-child { margin-top: 4px; }
.wfl-bx-sources { gap: 26px; }
.wfl-bx-source { display: flex; flex-direction: column; align-items: center; padding-top: 8px; }
.wfl-bx-source + .wfl-bx-source { border-left: 1px dashed var(--wfl-line); padding-left: 26px; }
.wfl-bx-origin { font: inherit; font-size: .72rem; color: var(--wfl-ink-2); background: var(--wfl-surface); border: 1px solid var(--wfl-line); border-radius: 999px; padding: 2px 10px; cursor: pointer; white-space: nowrap; }
.wfl-bx-origin:hover { color: var(--wfl-accent); border-color: var(--wfl-accent); }
.wfl-bx-source > .wfl-bx-children > .wfl-bx-child { padding-top: 14px; }
.wfl-bx-source > .wfl-bx-children > .wfl-bx-child::before { display: none; }
.wfl-bx-source > .wfl-bx-children > .wfl-bx-child::after { height: 14px; }

/* ---------- Board view ---------- */
.wfl-board-wrap { position: relative; overflow: auto; padding: 14px; max-height: 78vh; }
.wfl-board { display: grid; grid-template-columns: repeat(3, minmax(280px, 1fr)); gap: 20px; position: relative; min-width: 900px; }
.wfl-wires { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.wfl-wires path { fill: none; stroke: var(--wfl-line); stroke-width: 1.5; }
.wfl-wires path.is-hot { stroke: var(--wfl-accent); stroke-width: 2; }
.wfl-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.wfl-col-h { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--wfl-r); background: color-mix(in srgb, var(--zc) 10%, var(--wfl-surface)); border-left: 3px solid var(--zc); }
.wfl-col-h b { font-size: .8rem; color: var(--zc); }
.wfl-col-h span { font-size: .72rem; color: var(--wfl-ink-2); margin-left: auto; }
/* A folded column keeps only its header, turned upright in a narrow strip. */
.wfl-col.is-collapsed .wfl-col-h { writing-mode: vertical-rl; padding: 10px 6px; gap: 10px; border-left: 0; border-top: 3px solid var(--zc); align-self: start; }
.wfl-col.is-collapsed .wfl-col-h span { margin-left: 0; margin-top: auto; }
.wfl-col.is-collapsed .wfl-zfold .mud-icon-root { transform: rotate(90deg); }
.wfl-lane { border: 1px dashed var(--wfl-line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: color-mix(in srgb, var(--wfl-bg-2) 45%, transparent); }
.wfl-lane.is-collapsed { padding: 6px 10px; }
.wfl-lane-h { display: flex; align-items: center; gap: 8px; font-size: .76rem; color: var(--wfl-ink-2); }
.wfl-lane-h .wfl-muted { margin-left: auto; }

/* ---------- Timeline view ---------- */
.wfl-tl { padding: 14px; overflow: auto; max-height: 78vh; }
.wfl-tl-grid { display: grid; grid-template-columns: 260px minmax(520px, 1fr); min-width: 800px; }
.wfl-tl-axis { position: relative; height: 26px; border-bottom: 1px solid var(--wfl-line); font-family: var(--wfl-mono); font-size: .68rem; color: var(--wfl-ink-2); }
.wfl-tl-axis span { position: absolute; top: 4px; transform: translateX(-50%); white-space: nowrap; }
.wfl-tl-h { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 10px 6px 4px; font-size: .78rem; font-weight: 600; color: var(--zc); border-left: 3px solid var(--zc); margin-top: 6px; }
.wfl-tl-n { margin-left: auto; font-weight: 400; }
.wfl-tl-h.is-collapsed { padding-bottom: 8px; border-bottom: 1px dashed var(--wfl-line); }
.wfl-tl-row { display: contents; cursor: pointer; }
.wfl-tl-row > div { border-bottom: 1px solid color-mix(in srgb, var(--wfl-line) 55%, transparent); }
.wfl-tl-row:hover > div { background: var(--wfl-bg-2); }
.wfl-tl-row.is-selected > div { background: color-mix(in srgb, var(--wfl-accent) 12%, transparent); }
.wfl-tl-lab { display: flex; align-items: center; gap: 6px; font-size: .78rem; min-width: 0; padding: 3px 6px; }
.wfl-tl-lab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfl-tl-track { position: relative; height: 26px; }
.wfl-tl-bar { position: absolute; top: 5px; height: 16px; border-radius: 4px; background: var(--sc); min-width: 3px; }
.wfl-tl-bar.wfl-st-run { background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(255, 255, 255, .3) 5px 10px); animation: wfl-stripes 1.2s linear infinite; background-size: 200% 100%; }
@keyframes wfl-stripes { to { background-position: -28px 0; } }
.wfl-tl-bl { position: absolute; left: calc(100% + 6px); top: 0; font-family: var(--wfl-mono); font-size: .68rem; color: var(--wfl-ink-2); white-space: nowrap; line-height: 16px; }
.wfl-tl-now { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--wfl-run); pointer-events: none; }

/* ---------- Compact view ---------- */
.wfl-compact { padding: 14px 18px; overflow: auto; max-height: 78vh; }
.wfl-cp-list { list-style: none; margin: 0; padding-left: 22px; position: relative; }
.wfl-compact > .wfl-cp-list { padding-left: 0; }
.wfl-cp-list .wfl-cp-list::before { content: ""; position: absolute; left: 8px; top: -6px; bottom: 12px; border-left: 1.5px solid var(--wfl-line); }
.wfl-cp-list li { position: relative; padding: 3px 0; }
.wfl-cp-list .wfl-cp-list > li::before { content: ""; position: absolute; left: -14px; top: 17px; width: 12px; border-top: 1.5px solid var(--wfl-line); }
.wfl-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 8px; border: 1px solid var(--wfl-line); border-left: 3px solid var(--sc); border-radius: 999px; background: var(--wfl-surface); cursor: pointer; max-width: 100%; }
.wfl-pill:hover { box-shadow: var(--mud-elevation-2); }
.wfl-pill.is-selected { outline: 2px solid var(--wfl-accent); outline-offset: 1px; }
.wfl-pill-t { font-weight: 600; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wfl-pill-d { font-family: var(--wfl-mono); font-size: .7rem; color: var(--wfl-ink-2); }
.wfl-zdot { width: 6px; height: 6px; border-radius: 50%; background: var(--zc); flex: none; }
.wfl-pill-btn { border: 0; background: var(--wfl-bg-2); border-radius: 4px; font: inherit; font-size: .68rem; padding: 1px 6px; color: var(--wfl-ink-2); cursor: pointer; display: inline-grid; place-items: center; }
.wfl-pill-btn:hover { color: var(--wfl-accent); }

/* ---------- Activity rail ---------- */
.wfl-rail { background: var(--wfl-surface); border: 1px solid var(--wfl-line); border-radius: 12px; display: flex; flex-direction: column; max-height: 78vh; overflow: hidden; }
.wfl-rail-h { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--wfl-line); }
.wfl-rail-h b { font-size: .82rem; flex: 1; }
.wfl-rail ul { list-style: none; margin: 0; padding: 6px; overflow: auto; }
.wfl-rail li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: .76rem; }
.wfl-rail li:hover { background: var(--wfl-bg-2); }
.wfl-rail li.is-selected { background: color-mix(in srgb, var(--wfl-accent) 12%, transparent); }
.wfl-rail-t { display: flex; gap: 6px; align-items: center; font-weight: 500; min-width: 0; }
.wfl-rail-t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfl-rail-d { grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; color: var(--wfl-ink-2); align-items: center; }

/* ---------- Inspector ---------- */
.wfl-insp { background: var(--wfl-surface); border: 1px solid var(--wfl-line); border-radius: 12px; box-shadow: var(--mud-elevation-2); max-height: 78vh; display: flex; flex-direction: column; overflow: hidden; position: sticky; top: 8px; }
.wfl-insp-h { padding: 12px 14px; border-bottom: 1px solid var(--wfl-line); border-top: 3px solid var(--zc); }
.wfl-insp-row { display: flex; align-items: center; gap: 8px; }
.wfl-insp-row h2 { font-size: .95rem; margin: 0; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfl-insp-sub { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: .74rem; color: var(--wfl-ink-2); align-items: center; }
.wfl-tabs { display: flex; border-bottom: 1px solid var(--wfl-line); padding: 0 8px; }
.wfl-tabs button { border: 0; background: transparent; padding: 8px 10px; font: inherit; font-size: .8rem; font-weight: 500; color: var(--wfl-ink-2); border-bottom: 2px solid transparent; display: flex; gap: 6px; align-items: center; cursor: pointer; }
.wfl-tabs button[aria-selected="true"] { color: var(--wfl-accent); border-bottom-color: var(--wfl-accent); }
.wfl-badge { font-size: .66rem; border-radius: 999px; padding: 0 6px; background: color-mix(in srgb, var(--wfl-ink) 10%, transparent); }
.wfl-badge-err { background: color-mix(in srgb, var(--wfl-err) 14%, transparent); color: var(--wfl-err); }
.wfl-insp-body { padding: 12px 14px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.wfl-insp-body h3 { font-size: .7rem; margin: 0 0 6px; color: var(--wfl-ink-2); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.wfl-insp-desc { margin: 0; color: var(--wfl-ink-2); font-size: .82rem; overflow-wrap: anywhere; }
.wfl-alert { border-left: 3px solid var(--wfl-err); background: color-mix(in srgb, var(--wfl-err) 10%, transparent); color: var(--wfl-err); border-radius: 6px; padding: 8px 10px; font-size: .8rem; overflow-wrap: anywhere; }
.wfl-alert.is-warn { border-color: var(--wfl-cancel); background: color-mix(in srgb, var(--wfl-cancel) 12%, transparent); color: var(--wfl-cancel); }
.wfl-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.wfl-tile { background: var(--wfl-bg-2); border-radius: 6px; padding: 7px 8px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wfl-tile .v { font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.wfl-tile .l { font-size: .64rem; color: var(--wfl-ink-2); text-transform: uppercase; letter-spacing: .04em; }
.wfl-tile a { font-size: .68rem; }
.wfl-tile-a .v { color: var(--wfl-ok); }
.wfl-tile-m .v { color: var(--wfl-run); }
.wfl-tile-e .v { color: var(--wfl-err); }
.wfl-kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 5px 10px; font-size: .8rem; margin: 0; }
.wfl-kv dt { color: var(--wfl-ink-2); }
.wfl-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.wfl-pre { margin: 0; font-family: var(--wfl-mono); font-size: .7rem; background: var(--wfl-bg-2); padding: 6px 8px; border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; }
.wfl-confirm { margin-top: 8px; border: 1px solid var(--wfl-line); border-radius: var(--wfl-r); padding: 10px; background: var(--wfl-bg-2); font-size: .8rem; display: flex; flex-direction: column; gap: 8px; }
.wfl-confirm-b { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- Propagation runs ---------- */
.wfl-runs { display: flex; flex-direction: column; gap: 8px; }
.wfl-runs-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .78rem; }
.wfl-seg button:disabled { opacity: .45; cursor: default; }
.wfl-seg-n { font-family: var(--wfl-mono); font-size: .7rem; color: var(--wfl-ink-2); margin-left: 3px; }
.wfl-runs .hm-datagrid-container { border: 1px solid var(--wfl-line); border-radius: 10px; overflow: hidden; }
.wfl-runs-grid { font-size: .8rem; }
.wfl-runs-grid .mud-table-cell { white-space: nowrap; vertical-align: middle; }
.wfl-runs-grid th.num .column-header { justify-content: flex-end; }
.wfl-runs-grid .num { text-align: right; }
.wfl-runs-grid tr.wfl-run-row { cursor: pointer; }
.wfl-runs-grid tr.is-selected td { background: color-mix(in srgb, var(--wfl-accent) 12%, transparent); }
.wfl-runs-grid tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--wfl-accent); }
.wfl-runs-grid tr.is-waiting { cursor: default; }
.wfl-runs-grid tr.is-waiting td { color: var(--wfl-ink-2); }
.wfl-runs-grid tfoot td { background: var(--wfl-bg-2); font-weight: 600; }
.wfl-runs-feed { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; max-width: 340px; }
.wfl-runs-feed span { font-size: .7rem; }
.wfl-runs-err { color: var(--wfl-err); overflow: hidden; text-overflow: ellipsis; }
.wfl-plan { display: block; font-size: .68rem; margin-top: 2px; }
.wfl-dps { display: flex; gap: 4px; }
.wfl-dp { font-size: .7rem; border: 1px solid var(--wfl-line); border-radius: 999px; padding: 0 7px; background: var(--wfl-surface); color: var(--wfl-ink-2); }
.wfl-dp.is-more { border-style: dashed; }
.wfl-pbar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.wfl-pbar-b { flex: 1; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--wfl-ink) 10%, transparent); overflow: hidden; display: flex; }
.wfl-pbar-b i { display: block; height: 100%; }
.wfl-pbar span { font-size: .7rem; color: var(--wfl-ink-2); min-width: 36px; text-align: right; }
.wfl-v { font-family: var(--wfl-mono); font-variant-numeric: tabular-nums; }
.wfl-v-a { color: var(--wfl-ok); }
.wfl-v-m { color: var(--wfl-run); }
.wfl-v-e { color: var(--wfl-err); font-weight: 600; }
.wfl-v-z { color: var(--wfl-ink-2); }

/* ---------- Narrow screens ---------- */
@media (max-width: 1200px) {
    .wfl-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .wfl-kpis { grid-column: 1 / -1; justify-content: start; }
    .wfl-stage, .wfl-stage.has-rail, .wfl-stage.has-insp, .wfl-stage.has-rail.has-insp { grid-template-columns: minmax(0, 1fr); }
    .wfl-rail { max-height: 240px; }
    .wfl-insp { position: fixed; right: 12px; left: 12px; bottom: 12px; top: auto; max-height: 70vh; z-index: 1300; }
}
@media (max-width: 700px) {
    .wfl-top { grid-template-columns: minmax(0, 1fr); }
    .wfl-stepper { grid-template-columns: minmax(0, 1fr); }
    .wfl-kpis { grid-template-columns: repeat(2, auto); }
    .wfl-board { grid-template-columns: minmax(0, 1fr); min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .wfl *, .wfl *::before, .wfl *::after { animation: none !important; transition: none !important; }
}
