/* Business automation demonstration. Built on the nx tokens; logical properties only, so one stylesheet serves Arabic and English.
   The one distinctive element is the workflow diagram: steps as cards on a single line, branches side by side, lit during a test. */

.nx {
  --wf-ok: var(--nx-pos);
  --wf-rec: color-mix(in srgb, var(--nx-pos) 45%, var(--nx-accent));
}
.nx .wf-page {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-4);
  min-width: 0;
}
.nx .wf-stack {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-4);
  min-width: 0;
}
.nx .wf-block {
  display: block;
}
.nx .wf-h3 {
  font-size: var(--nx-fs-md);
  font-weight: 600;
}
.nx .wf-bar,
.nx .wf-panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--nx-s-3);
}
.nx .wf-panel-bar {
  padding: var(--nx-s-3) var(--nx-s-4);
  border-block-end: 1px solid var(--nx-line);
}
.nx .wf-tablebar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--nx-s-2);
  flex: 1 1 18rem;
  justify-content: flex-end;
}
.nx .wf-dotsep {
  color: var(--nx-ink-3);
}
.nx .wf-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: var(--nx-surface-3);
  color: var(--nx-ink-2);
  font-size: var(--nx-fs-xs);
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}
.nx .wf-chip .nx-i {
  width: 0.8rem;
  height: 0.8rem;
}
.nx .wf-chip.test {
  background: var(--nx-accent-soft);
  color: var(--nx-accent-ink);
  margin-inline-start: 0.35rem;
}
.nx .wf-chip.paused {
  margin-inline-start: 0.35rem;
  background: var(--nx-warn-soft);
  color: var(--nx-warn);
}
.nx .wf-chip.draft {
  background: var(--nx-info-soft);
  color: var(--nx-brand-ink);
  margin-inline-start: 0.35rem;
}
.nx .wf-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--nx-brand-ink);
  font: inherit;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}
.nx .wf-link:hover {
  text-decoration: underline;
}
.nx .wf-tone-pos {
  color: var(--nx-pos);
}
.nx .wf-tone-warn {
  color: var(--nx-warn);
}
.nx .wf-tone-neg {
  color: var(--nx-neg);
}

/* ---- live dot: a quiet pulse only while live (no motion for people who prefer less) ------------------------------------------- */
.nx .wf-live {
  display: inline-block;
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--nx-ink-3);
}
.nx .wf-live.on {
  background: var(--nx-pos);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--nx-pos) 50%, transparent);
  animation: wf-pulse 2.4s var(--nx-ease) infinite;
}
@keyframes wf-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--nx-pos) 45%, transparent);
  }
  70% {
    box-shadow: 0 0 0 0.45rem transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
.nx .wf-livebtn {
  gap: 0.4rem;
}
.nx .wf-livebtn[aria-pressed="false"] {
  color: var(--nx-ink-3);
}

/* ---- systems and workflows as small marks -------------------------------------------------------------------------------------- */
.nx .wf-app {
  --c: var(--nx-c8);
  display: inline-grid;
  place-content: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: var(--nx-r-md);
  background: color-mix(in srgb, var(--c) 13%, var(--nx-surface));
  color: var(--c);
}
.nx .wf-app .nx-i {
  width: 1rem;
  height: 1rem;
}
.nx .wf-app.sm {
  width: 1.65rem;
  height: 1.65rem;
}
.nx .wf-app.sm .nx-i {
  width: 0.85rem;
  height: 0.85rem;
}
.nx .wf-app.xs {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: var(--nx-r-sm);
}
.nx .wf-app.xs .nx-i {
  width: 0.72rem;
  height: 0.72rem;
}
.nx .wf-app.a-store {
  --c: var(--nx-c4);
}
.nx .wf-app.a-inbox {
  --c: var(--nx-c5);
}
.nx .wf-app.a-crm {
  --c: var(--nx-c1);
}
.nx .wf-app.a-erp {
  --c: var(--nx-c2);
}
.nx .wf-app.a-wa {
  --c: var(--nx-wa);
}
.nx .wf-app.a-ship {
  --c: var(--nx-c6);
}
.nx .wf-app.a-mail,
.nx .wf-app.a-sched {
  --c: var(--nx-c8);
}
.nx .wf-app.a-bi {
  --c: var(--nx-c3);
}
.nx .wf-app.a-sys {
  --c: var(--nx-accent);
}
.nx .wf-flowic {
  --c: var(--nx-c1);
  display: inline-grid;
  place-content: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--nx-r-lg);
  background: var(--c);
  color: #fff;
}
.nx[data-theme="dark"] .wf-flowic {
  color: #06142f;
}
.nx .wf-flowic .nx-i {
  width: 1.2rem;
  height: 1.2rem;
}
.nx .wf-flowic.sm {
  width: 2rem;
  height: 2rem;
  border-radius: var(--nx-r-md);
}
.nx .wf-flowic.sm .nx-i {
  width: 1rem;
  height: 1rem;
}
.nx .wf-flowic.xs {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--nx-r-sm);
}
.nx .wf-flowic.xs .nx-i {
  width: 0.8rem;
  height: 0.8rem;
}
.nx .wf-flowic.c-sales {
  --c: var(--nx-c4);
}
.nx .wf-flowic.c-finance {
  --c: var(--nx-accent);
}
.nx .wf-flowic.c-care {
  --c: var(--nx-c7);
}
.nx .wf-flowic.c-reporting {
  --c: var(--nx-c3);
}
.nx .wf-recic {
  display: inline-grid;
  place-content: center;
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--nx-surface-3);
  color: var(--nx-ink-2);
}
.nx .wf-recic .nx-i {
  width: 0.9rem;
  height: 0.9rem;
}

/* ---- step status icons --------------------------------------------------------------------------------------------------------------- */
.nx .wf-sti {
  --c: var(--nx-ink-3);
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-content: center;
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--c) 14%, var(--nx-surface));
  color: var(--c);
  box-shadow: 0 0 0 3px var(--nx-surface);
}
.nx .wf-sti .nx-i {
  width: 0.85rem;
  height: 0.85rem;
}
.nx .wf-sti.sm {
  width: 1.3rem;
  height: 1.3rem;
}
.nx .wf-sti.sm .nx-i {
  width: 0.7rem;
  height: 0.7rem;
}
.nx .wf-sti.t-pos {
  --c: var(--nx-pos);
}
.nx .wf-sti.t-warn {
  --c: var(--nx-warn);
}
.nx .wf-sti.t-neg {
  --c: var(--nx-neg);
}
.nx .wf-sti.t-info,
.nx .wf-sti.t-brand {
  --c: var(--nx-brand);
}
.nx .wf-sti.is-run::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 2px solid transparent;
  border-block-start-color: var(--nx-brand);
  border-radius: 50%;
  animation: wf-spin 0.9s linear infinite;
}
@keyframes wf-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- step marks in tables -------------------------------------------------------------------------------------------------------------- */
.nx .wf-pips {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.nx .wf-pips i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: var(--nx-pos);
}
.nx .wf-pips i.s-warn,
.nx .wf-pips i.s-retry {
  background: var(--nx-warn);
}
.nx .wf-pips i.s-fail {
  background: var(--nx-neg);
}
.nx .wf-pips i.s-wait,
.nx .wf-pips i.s-run {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--nx-brand);
}
.nx .wf-pips i.s-skip {
  background: var(--nx-surface-3);
}
.nx .wf-errline {
  color: var(--nx-neg);
}
.nx .nx-table tr.wf-row-fail > :first-child {
  border-inline-start: 3px solid var(--nx-neg);
}
.nx .wf-newpill {
  gap: 0.4rem;
  border-color: var(--nx-brand-line);
  background: var(--nx-brand-soft);
  color: var(--nx-brand-ink);
}

/* ---- overview ---------------------------------------------------------------------------------------------------------------------------- */
.nx .wf-chart {
  min-height: 15rem;
}
.nx .wf-feed {
  display: flex;
  flex-direction: column;
  list-style: none;
}
.nx .wf-feed > li + li {
  border-block-start: 1px solid var(--nx-line);
}
.nx .wf-feed-i {
  display: flex;
  align-items: center;
  gap: var(--nx-s-3);
  width: 100%;
  padding: 0.65rem var(--nx-s-4);
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color var(--nx-d-fast) var(--nx-ease);
}
.nx .wf-feed-i:hover {
  background: var(--nx-surface-2);
}
.nx .wf-feed-i.is-run {
  background: color-mix(in srgb, var(--nx-brand) 6%, var(--nx-surface));
}
.nx .wf-feed-m {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.nx .wf-feed-t {
  overflow: hidden;
  font-size: var(--nx-fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nx .wf-feed-s {
  color: var(--nx-ink-2);
  font-size: var(--nx-fs-xs);
}
.nx .wf-feed-r {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  flex: none;
}
.nx .wf-att {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-2);
  list-style: none;
}
.nx .wf-att-i {
  display: flex;
  align-items: center;
  gap: var(--nx-s-3);
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-r-md);
  background: var(--nx-surface);
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: border-color var(--nx-d-fast) var(--nx-ease);
}
.nx .wf-att-i:hover {
  border-color: color-mix(in srgb, var(--nx-neg) 40%, var(--nx-line));
}
.nx .wf-att-n {
  display: grid;
  place-content: center;
  flex: none;
  min-width: 2rem;
  height: 2rem;
  padding-inline: 0.4rem;
  border-radius: var(--nx-r-md);
  background: var(--nx-neg-soft);
  color: var(--nx-neg);
  font-weight: 700;
}
.nx .wf-att-who {
  color: var(--nx-ink-2);
  font-weight: 600;
}
.nx .wf-allgood {
  display: flex;
  align-items: flex-start;
  gap: var(--nx-s-3);
  padding: var(--nx-s-4);
  border-radius: var(--nx-r-md);
  background: var(--nx-pos-soft);
}
.nx .wf-allgood > .nx-i {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  color: var(--nx-pos);
}
.nx .wf-conns {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-2);
}
.nx .wf-connrow {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: var(--nx-s-2);
  list-style: none;
}
.nx .wf-connmini {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  height: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-r-md);
  background: var(--nx-surface);
  color: inherit;
  font: inherit;
  font-size: var(--nx-fs-sm);
  text-align: start;
  cursor: pointer;
}
.nx .wf-connmini:hover {
  border-color: var(--nx-line-strong);
}
.nx .wf-health .nx-cell-main .wf-link {
  font-weight: 600;
}

/* ---- workflows list ------------------------------------------------------------------------------------------------------------------------- */
.nx .wf-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: var(--nx-s-3);
  list-style: none;
  align-content: start;
}
.nx .wf-card {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-3);
  padding: var(--nx-s-4);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-r-lg);
  background: var(--nx-surface);
  min-width: 0;
}
.nx .wf-card.is-off {
  background: var(--nx-surface-2);
}
.nx .wf-card.is-off .wf-flowic {
  filter: grayscale(1);
  opacity: 0.6;
}
.nx .wf-card-h {
  display: flex;
  align-items: flex-start;
  gap: var(--nx-s-3);
}
.nx .wf-card-t {
  font-size: var(--nx-fs-md);
  font-weight: 600;
  line-height: 1.35;
}
.nx .wf-card-c {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
  margin-block-start: 0.15rem;
  color: var(--nx-ink-3);
  font-size: var(--nx-fs-xs);
}
.nx .wf-card-d {
  color: var(--nx-ink-2);
  font-size: var(--nx-fs-sm);
}
.nx .wf-card-trig {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--nx-r-md);
  background: var(--nx-surface-2);
  font-size: var(--nx-fs-xs);
}
.nx .wf-card-trig .nx-i {
  flex: none;
  margin-block-start: 0.15rem;
  color: var(--nx-accent);
}
.nx .wf-card-f {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--nx-s-2);
  margin-block-start: auto;
  padding-block-start: var(--nx-s-2);
  border-block-start: 1px solid var(--nx-line);
}
.nx .wf-card-apps {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.nx .wf-card-stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.75rem;
  color: var(--nx-ink-2);
  font-size: var(--nx-fs-xs);
}
.nx .wf-card-stats b {
  color: var(--nx-ink);
  font-weight: 600;
}
.nx .wf-card-stats .nx-neg b {
  color: var(--nx-neg);
}
/* a switch drawn as a button with role="switch" (so it announces "on" or "off") */
.nx .wf-switch {
  position: relative;
  flex: none;
  width: 2.5rem;
  height: 1.4rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--nx-line-strong);
  cursor: pointer;
  transition: background-color var(--nx-d-fast) var(--nx-ease);
}
.nx .wf-switch span {
  position: absolute;
  inset-block-start: 0.2rem;
  inset-inline-start: 0.2rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transition: inset-inline-start var(--nx-d-fast) var(--nx-ease);
}
.nx .wf-switch[aria-checked="true"] {
  background: var(--nx-pos);
}
.nx .wf-switch[aria-checked="true"] span {
  inset-inline-start: 1.3rem;
}
.nx .wf-switch:focus-visible {
  outline: 2px solid var(--nx-focus);
  outline-offset: 2px;
}
.nx .wf-chg {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-3);
  list-style: none;
}
.nx .wf-chg > li {
  display: flex;
  align-items: flex-start;
  gap: var(--nx-s-2);
}
.nx .wf-chg-who {
  flex: none;
}
.nx .wf-how {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-2);
  list-style: none;
  font-size: var(--nx-fs-sm);
}
.nx .wf-how li {
  display: flex;
  gap: 0.45rem;
}
.nx .wf-how .nx-i {
  flex: none;
  margin-block-start: 0.2rem;
  color: var(--nx-pos);
}

/* ---- one workflow ------------------------------------------------------------------------------------------------------------------------- */
.nx .wf-wfhead {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-2);
}
.nx .wf-crumbs {
  color: var(--nx-ink-3);
  font-size: var(--nx-fs-sm);
}
.nx .wf-tabs {
  border-block-end: 1px solid var(--nx-line);
}
.nx .wf-publist {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-block-start: var(--nx-s-2);
  padding-inline-start: 1.2rem;
  font-size: var(--nx-fs-sm);
}
.nx .wf-vers {
  display: flex;
  flex-direction: column;
  list-style: none;
}
.nx .wf-vers > li {
  display: flex;
  align-items: center;
  gap: var(--nx-s-3);
  padding-block: 0.7rem;
}
.nx .wf-vers > li + li {
  border-block-start: 1px solid var(--nx-line);
}
.nx .wf-ver-v {
  display: grid;
  place-content: center;
  flex: none;
  min-width: 2.4rem;
  height: 1.8rem;
  border-radius: var(--nx-r-md);
  background: var(--nx-surface-3);
  font-weight: 700;
}
.nx .wf-vers > li.is-cur .wf-ver-v {
  background: var(--nx-pos-soft);
  color: var(--nx-pos);
}
.nx .wf-canvas {
  overflow-x: auto;
  padding-block: var(--nx-s-2);
}
/* a narrow side panel reads better with each label above its value */
.nx .wf-side .nx-kv {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.1rem;
}
.nx .wf-side .nx-kv dt {
  font-size: var(--nx-fs-xs);
}
.nx .wf-side .nx-kv dd + dt {
  margin-block-start: 0.55rem;
}

/* ---- the diagram -------------------------------------------------------------------------------------------------------------------------- */
.nx .wf-flow {
  --line: var(--nx-line-strong);
  --gap: 1.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap);
  list-style: none;
}
.nx .wf-flow > li,
.nx .wf-lane-steps > li {
  position: relative;
  width: min(100%, 26rem);
}
/* the line between two steps */
.nx .wf-flow > li + li::before,
.nx .wf-lane-steps > li + li::before {
  content: "";
  position: absolute;
  inset-block-start: calc(-1 * var(--gap));
  inset-inline-start: 50%;
  width: 2px;
  height: var(--gap);
  margin-inline-start: -1px;
  background: var(--line);
}
/* a small downward triangle at the end of each line (the same in both writing directions) */
.nx .wf-flow > li + li::after,
.nx .wf-lane-steps > li + li::after {
  content: "";
  position: absolute;
  inset-block-start: -0.45rem;
  inset-inline-start: 50%;
  width: 0.7rem;
  height: 0.4rem;
  margin-inline-start: -0.35rem;
  background: var(--line);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.nx .wf-node {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-r-lg);
  background: var(--nx-surface);
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  box-shadow: var(--nx-shadow-panel);
  transition: border-color var(--nx-d-fast) var(--nx-ease), box-shadow var(--nx-d-fast) var(--nx-ease), background-color var(--nx-d-base) var(--nx-ease);
}
.nx .wf-node:hover {
  border-color: var(--nx-brand-line);
}
.nx .wf-node:focus-visible {
  outline: 2px solid var(--nx-focus);
  outline-offset: 2px;
}
.nx .wf-node.is-trigger {
  border-color: color-mix(in srgb, var(--nx-accent) 45%, var(--nx-line));
  background: color-mix(in srgb, var(--nx-accent) 7%, var(--nx-surface));
}
.nx .wf-node.is-wait {
  border-style: dashed;
  box-shadow: none;
}
.nx .wf-node.is-changed {
  border-color: var(--nx-brand);
  box-shadow: 0 0 0 1px var(--nx-brand);
}
.nx .wf-node-m {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 auto;
  min-width: 0;
}
.nx .wf-node-k {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--nx-ink-3);
  font-size: 0.6875rem;
  font-weight: 600;
}
.nx .wf-node-d {
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--nx-brand);
  color: #fff;
}
.nx[data-theme="dark"] .wf-node-d {
  color: #06142f;
}
.nx .wf-node-t {
  font-size: var(--nx-fs-sm);
  font-weight: 600;
  line-height: 1.4;
}
.nx .wf-node-s {
  color: var(--nx-ink-2);
  font-size: var(--nx-fs-xs);
}
.nx .wf-node-tpl {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.3rem;
  margin-block-start: 0.15rem;
  color: var(--nx-ink-2);
  font-size: var(--nx-fs-xs);
}
.nx .wf-node-tpl > span {
  min-width: 0;
}
.nx .wf-node-tpl > .nx-i {
  flex: none;
  margin-block-start: 0.15rem;
}
.nx .wf-node-tpl > .nx-i {
  color: var(--nx-wa);
}
.nx .wf-node-n {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  flex: none;
  color: var(--nx-ink-2);
  font-size: var(--nx-fs-xs);
}
.nx .wf-node-f {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--nx-neg);
}
.nx .wf-node-st {
  display: none;
}
.nx .wf-end {
  display: flex;
  justify-content: center;
}
.nx .wf-end span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--nx-surface-3);
  color: var(--nx-ink-2);
  font-size: var(--nx-fs-xs);
  font-weight: 600;
}
/* a branch: the question, then its lanes side by side */
.nx .wf-flow > li.wf-branch {
  width: 100%;
}
.nx .wf-branch-h {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--nx-line-strong);
  border-radius: 999px;
  background: var(--nx-surface-2);
  font-size: var(--nx-fs-sm);
  font-weight: 600;
}
.nx .wf-lanes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr));
  gap: var(--nx-s-3);
  margin-block-start: var(--gap);
  padding-block-start: var(--nx-s-3);
}
/* the bar that joins the lanes under the question */
.nx .wf-lanes::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: calc(50% / var(--n, 2));
  height: 2px;
  background: var(--line);
}
.nx .wf-lanes::after {
  content: "";
  position: absolute;
  inset-block-start: calc(-1 * var(--gap));
  inset-inline-start: 50%;
  width: 2px;
  height: var(--gap);
  margin-inline-start: -1px;
  background: var(--line);
}
.nx .wf-lane {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--nx-s-3);
  min-width: 0;
  padding: var(--nx-s-3) var(--nx-s-2);
  border-radius: var(--nx-r-lg);
  background: color-mix(in srgb, var(--nx-surface-3) 55%, transparent);
}
.nx .wf-lane::before {
  content: "";
  position: absolute;
  inset-block-start: calc(-1 * var(--nx-s-3));
  inset-inline-start: 50%;
  width: 2px;
  height: var(--nx-s-3);
  margin-inline-start: -1px;
  background: var(--line);
}
.nx .wf-lane-h {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--nx-fs-xs);
  font-weight: 600;
}
.nx .wf-lane-p {
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--nx-surface);
  color: var(--nx-ink-2);
  font-weight: 500;
}
/* the lanes join again under the branch */
.nx .wf-merge {
  height: var(--nx-s-3);
  margin-inline: calc(50% / var(--n, 2));
  border-block-end: 2px solid var(--line);
}
.nx .wf-lane::after {
  content: "";
  position: absolute;
  inset-block-end: calc(-1 * var(--nx-s-3));
  inset-inline-start: 50%;
  width: 2px;
  height: var(--nx-s-3);
  margin-inline-start: -1px;
  background: var(--line);
}
.nx .wf-lane-steps {
  --gap: 1.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap);
  width: 100%;
  list-style: none;
}
.nx .wf-lane-steps > li {
  width: 100%;
}
.nx .wf-lane-steps .wf-node {
  padding: 0.6rem 0.7rem;
}
.nx .wf-lane-steps .wf-node-n {
  display: none;
}
.nx .wf-lane-none {
  color: var(--nx-ink-3);
  font-size: var(--nx-fs-xs);
  text-align: center;
}
/* during a test: steps light up as they run */
.nx .wf-flow.is-testing .wf-node {
  opacity: 0.55;
}
.nx .wf-flow.is-testing .is-run .wf-node,
.nx .wf-flow.is-testing .is-ok .wf-node,
.nx .wf-flow.is-testing .is-warn .wf-node,
.nx .wf-flow.is-testing .is-fail .wf-node,
.nx .wf-flow.is-testing .is-skip .wf-node {
  opacity: 1;
}
.nx .wf-step.is-run .wf-node {
  border-color: var(--nx-brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--nx-brand) 25%, transparent);
}
.nx .wf-step.is-ok .wf-node {
  border-color: color-mix(in srgb, var(--nx-pos) 55%, var(--nx-line));
  background: color-mix(in srgb, var(--nx-pos) 6%, var(--nx-surface));
}
.nx .wf-step.is-warn .wf-node {
  border-color: color-mix(in srgb, var(--nx-warn) 60%, var(--nx-line));
  background: color-mix(in srgb, var(--nx-warn) 7%, var(--nx-surface));
}
.nx .wf-step.is-fail .wf-node {
  border-color: var(--nx-neg);
  background: color-mix(in srgb, var(--nx-neg) 7%, var(--nx-surface));
}
.nx .wf-step.is-skip .wf-node {
  opacity: 0.45;
}
.nx .wf-step:is(.is-ok, .is-warn, .is-fail, .is-run) .wf-node-st {
  display: inline-grid;
  place-content: center;
  flex: none;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--nx-pos);
  color: #fff;
}
.nx[data-theme="dark"] .wf-step .wf-node-st {
  color: #06142f;
}
.nx .wf-node-st .nx-i {
  width: 0.75rem;
  height: 0.75rem;
}
.nx .wf-step.is-warn .wf-node-st {
  background: var(--nx-warn);
}
.nx .wf-step.is-fail .wf-node-st {
  background: var(--nx-neg);
}
.nx .wf-step.is-run .wf-node-st {
  background: transparent;
  border: 2px solid var(--nx-brand-line);
  border-block-start-color: var(--nx-brand);
  animation: wf-spin 0.9s linear infinite;
}
.nx .wf-lane.is-lane {
  outline: 2px solid var(--nx-brand-line);
  outline-offset: 2px;
  background: color-mix(in srgb, var(--nx-brand) 6%, transparent);
}
.nx .wf-tlog {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-2);
  max-height: 26rem;
  overflow: auto;
  list-style: none;
}
.nx .wf-tlog-i {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: var(--nx-fs-sm);
}
.nx .wf-test-end:not(:empty) {
  margin-block-start: var(--nx-s-3);
}

/* ---- step drawer ---------------------------------------------------------------------------------------------------------------------------- */
.nx .wf-stepdw {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-4);
}
.nx .wf-stepdw-d {
  color: var(--nx-ink-2);
}
.nx .wf-stepdw-tpl {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-2);
}
.nx .wf-errlist {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-2);
  margin-block-start: var(--nx-s-2);
  list-style: none;
  font-size: var(--nx-fs-sm);
}
.nx .wf-errlist li {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.65rem;
  border-inline-start: 3px solid var(--nx-line-strong);
  background: var(--nx-surface-2);
}

/* ---- run drawer ----------------------------------------------------------------------------------------------------------------------------- */
.nx .wf-rundw,
.nx .wf-tpldw {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-4);
}
.nx .wf-rundw-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--nx-s-2);
}
.nx .wf-errbox {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-3);
  padding: var(--nx-s-4);
  border: 1px solid color-mix(in srgb, var(--nx-neg) 35%, var(--nx-line));
  border-radius: var(--nx-r-lg);
  background: color-mix(in srgb, var(--nx-neg) 5%, var(--nx-surface));
}
.nx .wf-errbox-h {
  display: flex;
  align-items: flex-start;
  gap: var(--nx-s-3);
}
.nx .wf-errbox-h > .nx-i {
  flex: none;
  width: 1.3rem;
  height: 1.3rem;
  color: var(--nx-neg);
}
.nx .wf-errbox-fix {
  padding: 0.55rem 0.7rem;
  border-radius: var(--nx-r-md);
  background: var(--nx-surface);
}
.nx .wf-tl {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-3);
  list-style: none;
}
.nx .wf-tl::before {
  content: "";
  position: absolute;
  inset-block: 0.8rem;
  inset-inline-start: 0.78rem;
  width: 2px;
  background: var(--nx-line);
}
.nx .wf-tl-i {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}
.nx .wf-tl-m {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1 1 auto;
  min-width: 0;
  padding-block-start: 0.1rem;
}
.nx .wf-tl-h {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.nx .wf-tl-t {
  font-size: var(--nx-fs-sm);
  font-weight: 600;
}
.nx .wf-tl-i.s-skip .wf-tl-t {
  color: var(--nx-ink-3);
  font-weight: 500;
}
.nx .wf-tl-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--nx-ink-3);
  font-size: var(--nx-fs-xs);
}
.nx .wf-tl-n {
  color: var(--nx-ink-2);
  font-size: var(--nx-fs-sm);
}
.nx .wf-step-err {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.35rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.25rem 0.55rem;
  border-radius: var(--nx-r-sm);
  font-size: var(--nx-fs-xs);
  font-weight: 500;
}
.nx .wf-step-err .nx-i {
  flex: none;
  margin-block-start: 0.1rem;
}
.nx .wf-step-err.neg {
  background: var(--nx-neg-soft);
  color: var(--nx-neg);
}
.nx .wf-step-err.warn {
  background: var(--nx-warn-soft);
  color: var(--nx-warn);
}
.nx .wf-step-pend {
  color: var(--nx-brand-ink);
  font-size: var(--nx-fs-xs);
  font-weight: 500;
}
.nx .wf-tech summary {
  color: var(--nx-ink-2);
  font-size: var(--nx-fs-sm);
  cursor: pointer;
}
.nx .wf-tech[open] summary {
  margin-block-end: var(--nx-s-3);
}

/* ---- the customer's phone -------------------------------------------------------------------------------------------------------------------- */
.nx .wf-phone {
  --chat-bg: color-mix(in srgb, var(--nx-wa) 7%, var(--nx-surface-2));
  display: flex;
  flex-direction: column;
  width: min(100%, 20rem);
  height: 30rem;
  margin-inline: auto;
  overflow: hidden;
  border: 8px solid var(--nx-ink);
  border-radius: 1.6rem;
  background: var(--chat-bg);
  box-shadow: var(--nx-shadow-dialog);
}
.nx[data-theme="dark"] .wf-phone {
  border-color: #2a3550;
}
.nx .wf-phone-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.7rem;
  background: var(--nx-wa);
  color: #fff;
}
.nx .wf-phone-top > .nx-i {
  opacity: 0.85;
}
.nx .wf-phone-av {
  display: grid;
  place-content: center;
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.22);
}
.nx .wf-phone-n {
  display: block;
  font-size: var(--nx-fs-sm);
  font-weight: 600;
}
.nx .wf-phone-s {
  display: block;
  font-size: 0.6875rem;
  opacity: 0.85;
}
.nx .wf-chat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 auto;
  padding: 0.7rem 0.6rem;
  overflow-y: auto;
}
.nx .wf-chat-day {
  align-self: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--nx-r-sm);
  background: var(--nx-surface);
  color: var(--nx-ink-2);
  font-size: 0.6875rem;
  box-shadow: 0 1px 1px rgb(0 0 0 / 0.08);
}
.nx .wf-bub {
  position: relative;
  max-width: 88%;
  padding: 0.45rem 0.6rem 0.3rem;
  border-radius: 0.7rem;
  font-size: var(--nx-fs-sm);
  line-height: 1.5;
  box-shadow: 0 1px 1px rgb(0 0 0 / 0.08);
}
.nx .wf-bub p {
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.nx .wf-bub.biz {
  align-self: flex-start;
  border-start-start-radius: 0.2rem;
  background: var(--nx-surface);
}
.nx .wf-bub.me {
  align-self: flex-end;
  border-start-end-radius: 0.2rem;
  background: color-mix(in srgb, var(--nx-wa) 22%, var(--nx-surface));
}
.nx .wf-bub-f {
  margin-block-start: 0.2rem;
  color: var(--nx-ink-3);
  font-size: 0.6875rem;
}
.nx .wf-bub-t {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  margin-block-start: 0.1rem;
  color: var(--nx-ink-3);
  font-size: 0.6875rem;
}
.nx .wf-ticks {
  display: inline-flex;
}
.nx .wf-ticks .nx-i {
  width: 0.95rem;
  height: 0.95rem;
}
.nx .wf-ticks.read {
  color: var(--nx-brand);
}
.nx .wf-chat-btns {
  display: flex;
  flex-direction: column;
  margin-block-start: 0.35rem;
  margin-inline: -0.6rem;
  margin-block-end: -0.3rem;
  border-block-start: 1px solid var(--nx-line);
}
.nx .wf-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem;
  border: 0;
  background: none;
  color: var(--nx-wa);
  font: inherit;
  font-size: var(--nx-fs-sm);
  font-weight: 600;
}
.nx .wf-chat-btn + .wf-chat-btn {
  border-block-start: 1px solid var(--nx-line);
}
.nx button.wf-chat-btn:not(:disabled) {
  cursor: pointer;
}
.nx button.wf-chat-btn:not(:disabled):hover {
  background: color-mix(in srgb, var(--nx-wa) 8%, transparent);
}
.nx button.wf-chat-btn:disabled {
  color: var(--nx-ink-3);
}
.nx .wf-chat-btn .nx-i {
  width: 0.85rem;
  height: 0.85rem;
}
.nx .wf-phone-in {
  margin: 0.5rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: var(--nx-surface);
  color: var(--nx-ink-3);
  font-size: var(--nx-fs-sm);
}
.nx .wf-tplmini {
  padding: var(--nx-s-3);
  border-radius: var(--nx-r-lg);
  background: color-mix(in srgb, var(--nx-wa) 7%, var(--nx-surface-2));
}
.nx .wf-tplmini .wf-bub {
  max-width: 100%;
}
.nx .wf-tplprevs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--nx-s-3);
}
.nx .wf-tplprev {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-2);
  padding: var(--nx-s-3);
  border-radius: var(--nx-r-lg);
  background: color-mix(in srgb, var(--nx-wa) 7%, var(--nx-surface-2));
}
.nx .wf-tplprev .wf-bub {
  max-width: 100%;
}
.nx .wf-tplprev-l {
  color: var(--nx-ink-2);
  font-size: var(--nx-fs-xs);
  font-weight: 600;
}
.nx .wf-tplid {
  color: var(--nx-ink-3);
  font-size: var(--nx-fs-xs);
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---- the test order window ------------------------------------------------------------------------------------------------------------------ */
.nx .wf-sim {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 21rem);
  gap: var(--nx-s-5);
  align-items: start;
}
.nx .wf-sim-l {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-3);
  min-width: 0;
}
.nx .wf-sim-h {
  display: flex;
  align-items: center;
  gap: var(--nx-s-2);
}
.nx .wf-sim-st {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--nx-s-2);
  padding: 0.55rem 0.7rem;
  border-radius: var(--nx-r-md);
  background: var(--nx-surface-2);
}
.nx .wf-sim-tl {
  max-height: 18rem;
  overflow: auto;
}
.nx .wf-sim-cap {
  margin-block-end: var(--nx-s-2);
  text-align: center;
}
@media (max-width: 760px) {
  .nx .wf-sim {
    grid-template-columns: minmax(0, 1fr);
  }
  .nx .wf-sim-r {
    order: -1;
  }
  .nx .wf-phone {
    height: 24rem;
  }
}

/* ---- connections ---------------------------------------------------------------------------------------------------------------------------- */
.nx .wf-conns-g {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
  gap: var(--nx-s-3);
  list-style: none;
}
.nx .wf-conn {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-3);
  padding: var(--nx-s-4);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-r-lg);
  background: var(--nx-surface);
  min-width: 0;
}
.nx .wf-conn.t-warn {
  border-color: color-mix(in srgb, var(--nx-warn) 45%, var(--nx-line));
}
.nx .wf-conn-h {
  display: flex;
  align-items: flex-start;
  gap: var(--nx-s-3);
}
.nx .wf-conn-b {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--nx-s-3);
  align-items: end;
}
.nx .wf-spark {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 4.5rem;
  height: 2.5rem;
}
.nx .wf-spark i {
  flex: 1 1 0;
  height: var(--h, 10%);
  border-radius: 2px 2px 0 0;
  background: var(--nx-brand-line);
}
.nx .wf-spark i.err {
  background: var(--nx-warn);
}
.nx .wf-scopes {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.nx .wf-scopes code {
  padding: 0 0.35rem;
  border-radius: var(--nx-r-sm);
  background: var(--nx-surface-3);
  color: var(--nx-ink-2);
  font-size: var(--nx-fs-xs);
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---- full version ----------------------------------------------------------------------------------------------------------------------------- */
.nx .wf-fullg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: var(--nx-s-3);
  list-style: none;
}
.nx .wf-fullc {
  display: flex;
  flex-direction: column;
  gap: var(--nx-s-2);
  padding: var(--nx-s-4);
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-r-lg);
  background: var(--nx-surface);
}
.nx .wf-fullc-h {
  display: flex;
  align-items: center;
  gap: var(--nx-s-2);
}
.nx .wf-fullc-ic {
  display: grid;
  place-content: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: var(--nx-r-md);
  background: var(--nx-brand-soft);
  color: var(--nx-brand);
}
.nx .wf-fulll {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
  font-size: var(--nx-fs-sm);
}
.nx .wf-fulll li {
  display: flex;
  gap: 0.4rem;
}
.nx .wf-fulll .nx-i {
  flex: none;
  margin-block-start: 0.2rem;
  color: var(--nx-pos);
}
.nx .wf-full-foot {
  max-width: 60rem;
}

/* ---- app bar ----------------------------------------------------------------------------------------------------------------------------------- */
.nx .wf-role {
  gap: 0.5rem;
  max-width: 15rem;
}
.nx .wf-role-t {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
  text-align: start;
}
.nx .wf-role-n {
  overflow: hidden;
  font-size: var(--nx-fs-sm);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nx .wf-role-r {
  overflow: hidden;
  color: var(--nx-ink-3);
  font-size: 0.6875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- narrow screens ------------------------------------------------------------------------------------------------------------------------------ */
@container nxapp (max-width: 900px) {
  .nx .wf-role-t {
    display: none;
  }
}
@container nxmain (max-width: 640px) {
  .nx .wf-lanes {
    grid-template-columns: minmax(0, 1fr);
    padding-block-start: 0;
  }
  .nx .wf-lanes::before {
    display: none;
  }
  .nx .wf-lane::before,
  .nx .wf-lane::after,
  .nx .wf-merge {
    display: none;
  }
  .nx .wf-lane {
    align-items: stretch;
    border-inline-start: 3px solid var(--nx-line-strong);
    border-radius: var(--nx-r-md);
  }
  .nx .wf-lane-steps > li + li::before,
  .nx .wf-lane-steps > li + li::after {
    inset-inline-start: 1.6rem;
  }
  .nx .wf-node-n {
    display: none;
  }
  .nx .wf-tplprevs {
    grid-template-columns: minmax(0, 1fr);
  }
  .nx .wf-feed-i {
    padding-inline: var(--nx-s-3);
  }
  .nx .wf-feed-r .wf-tone-pos,
  .nx .wf-feed-r .nx-badge {
    font-size: 0.6875rem;
  }
}
@container nxmain (max-width: 480px) {
  .nx .wf-feed-r .nx-badge {
    display: none;
  }
  .nx .wf-conn-b {
    grid-template-columns: minmax(0, 1fr);
  }
  .nx .wf-spark {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .nx .wf-live.on,
  .nx .wf-sti.is-run::after,
  .nx .wf-step.is-run .wf-node-st {
    animation: none;
  }
  .nx .wf-node,
  .nx .wf-switch,
  .nx .wf-switch span {
    transition: none;
  }
}
