.wfd {
  padding: 8px 0;
}
.wfd-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.wfd-title {
  font-size: 1.1em;
  font-weight: 600;
}
.wfd-muted {
  color: var(--text-muted);
}
.wfd-small {
  font-size: 0.85em;
  margin-top: 6px;
}
.wfd-icon-btn {
  display: inline-flex;
  padding: 4px;
  background: transparent;
  box-shadow: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}
.wfd-icon-btn svg {
  width: 15px;
  height: 15px;
}
.wfd-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85em;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.wfd-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--background-modifier-border);
  overflow: hidden;
  max-width: 220px;
}
.wfd-bar-fill {
  height: 100%;
  background: var(--color-green);
}
.wfd-errors {
  font-size: 0.85em;
  color: var(--text-error);
  border: 1px solid var(--text-error);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
}
.wfd-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 18px 0;
  border: 1px dashed var(--background-modifier-border);
  border-radius: 10px;
}

/* Diagramma */
.wfd-canvas {
  position: relative;
  container-type: inline-size;
}
.wfd-arrows {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.wfd-line {
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
}
.wfd-line-on {
  stroke: var(--color-green);
  stroke-dasharray: none;
}
.wfd-a-off { fill: var(--text-faint); }
.wfd-a-on { fill: var(--color-green); }
.wfd-row {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}
.wfd-row-cont {
  margin-top: -24px;
}
.wfd-row:last-child {
  margin-bottom: 4px;
}
.wfd-node {
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 260px;
  flex: 1 1 0;
  padding: 10px 12px;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  border-radius: 10px;
  border: 1px solid var(--background-modifier-border);
  background: var(--background-primary);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.wfd-node:hover {
  background: var(--background-modifier-hover);
}
.wfd-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-weight: 500;
  line-height: 1.35;
}
.wfd-check {
  display: inline-flex;
  flex-shrink: 0;
  padding: 3px;
  margin: -3px 0 -3px -3px;
  border-radius: 6px;
  cursor: pointer;
}
.wfd-check:hover {
  background: var(--background-modifier-hover);
}
.wfd-check svg {
  width: 18px;
  height: 18px;
}
.wfd-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.8em;
  color: var(--text-muted);
  margin-top: 6px;
}
.wfd-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--background-modifier-hover);
  color: var(--text-muted);
  line-height: 1.5;
}
.wfd-chip-icon {
  display: inline-flex;
}
.wfd-chip-icon svg {
  width: 12px;
  height: 12px;
}
.wfd-has-notes {
  padding: 2px 5px;
}
.wfd-late {
  color: var(--color-red);
  background: rgba(var(--color-red-rgb), 0.12);
  font-weight: 600;
}
.wfd-today {
  color: var(--color-orange);
  background: rgba(var(--color-orange-rgb), 0.14);
  font-weight: 600;
}
.wfd-soon {
  color: var(--color-orange);
}

.wfd-bloccato {
  cursor: pointer;
  border-style: dashed;
  background: var(--background-secondary);
  color: var(--text-faint);
}
.wfd-bloccato .wfd-meta {
  color: var(--text-faint);
}
.wfd-dafare {
  border: 2px solid var(--interactive-accent);
}
.wfd-attesa {
  border: 2px solid var(--color-orange);
  background: rgba(var(--color-orange-rgb), 0.08);
}
.wfd-fatto {
  border-color: var(--color-green);
  background: rgba(var(--color-green-rgb), 0.12);
}
.wfd-fatto .wfd-text {
  text-decoration: line-through;
  color: var(--text-muted);
}
.wfd-fatto .wfd-check {
  color: var(--color-green);
}

.wfd-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}
.wfd-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.wfd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8em;
  color: var(--text-muted);
}
.wfd-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.wfd-swatch {
  box-sizing: border-box;
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border-width: 1px;
}

/* Schede */
.wfd-modal .wfd-wide .setting-item-control {
  flex: 1 1 60%;
}
.wfd-modal .wfd-wide input[type="text"] {
  width: 100%;
}
.wfd-field-error {
  color: var(--text-error);
  font-size: 0.85em;
  min-height: 0;
  margin: -6px 0 6px;
}
.wfd-section-label {
  font-weight: 600;
  margin-top: 14px;
}
.wfd-section-desc {
  font-size: 0.85em;
  color: var(--text-muted);
  margin: 2px 0 8px;
}
.wfd-link-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  /* Nelle schede che su telefono sono in colonna flessibile, un riquadro scorrevole
     si schiaccerebbe fino a sparire: non deve mai restringersi */
  flex: 0 0 auto;
}
.wfd-modal > * {
  flex-shrink: 0;
}
/* Su telefono niente riquadro scorrevole dentro la scheda: scorre la scheda intera */
.is-mobile .wfd-link-list {
  max-height: none;
  overflow: visible;
}
.wfd-link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--background-modifier-border);
}
.wfd-link-text {
  flex: 1 1 140px;
  min-width: 0;
}
.wfd-seg {
  display: inline-flex;
  border: 1px solid var(--background-modifier-border);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.wfd-seg button {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 4px 10px;
  font-size: 0.85em;
  cursor: pointer;
  color: var(--text-muted);
}
.wfd-seg button + button {
  border-left: 1px solid var(--background-modifier-border);
}
.wfd-seg button.is-active {
  background: var(--interactive-accent);
  color: var(--text-on-accent, #fff);
}
.wfd-summary {
  font-size: 0.85em;
  color: var(--text-muted);
  margin-top: 8px;
}
.wfd-textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  box-sizing: border-box;
}
.wfd-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.85em;
}
.wfd-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  border-width: 1px;
}
.wfd-details {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--background-secondary);
  font-size: 0.95em;
  overflow-wrap: anywhere;
}
.wfd-details > :first-child {
  margin-top: 0;
}
.wfd-details > :last-child {
  margin-bottom: 0;
}
.wfd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.wfd-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Panoramica */
.wfd-overview {
  padding: 12px;
}
.wfd-ov-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.wfd-ov-top .mod-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wfd-ov-section {
  margin-bottom: 20px;
}
.wfd-ov-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 8px;
}
.wfd-ov-count {
  font-size: 0.8em;
  color: var(--text-muted);
  background: var(--background-modifier-hover);
  border-radius: 10px;
  padding: 1px 8px;
}
.wfd-ov-empty {
  font-size: 0.9em;
  color: var(--text-muted);
}
.wfd-ov-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  border-width: 1px;
}
.wfd-ov-body {
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
.wfd-ov-text {
  font-weight: 500;
}
.wfd-ov-item .wfd-meta {
  margin-top: 3px;
}

/* Poco spazio (telefono, pannelli stretti): blocchi compatti */
@container (max-width: 560px) {
  .wfd-row {
    gap: 8px;
    margin-bottom: 32px;
  }
  .wfd-node {
    padding: 8px 9px;
  }
}
@container (max-width: 560px) {
  .wfd-cols-3 .wfd-node,
  .wfd-cols-4 .wfd-node {
    padding: 6px 6px 7px;
    font-size: 0.86em;
  }
  .wfd-cols-3 .wfd-head,
  .wfd-cols-4 .wfd-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .wfd-cols-3 .wfd-check,
  .wfd-cols-4 .wfd-check {
    margin: -3px;
  }
  .wfd-cols-3 .wfd-state,
  .wfd-cols-4 .wfd-state,
  .wfd-cols-4 .wfd-who span:last-child {
    display: none;
  }
  .wfd-cols-3 .wfd-meta,
  .wfd-cols-4 .wfd-meta {
    gap: 3px;
    margin-top: 4px;
  }
  .wfd-cols-3 .wfd-chip,
  .wfd-cols-4 .wfd-chip {
    padding: 0 4px;
  }
}
@media (max-width: 500px) {
  .wfd-actions button {
    flex: 1 1 100%;
    justify-content: center;
  }
}


/* ===== Workflow con un colore assegnato =====
   Il colore del workflow va su bordi, icone, frecce e barra;
   lo stato si legge dallo stile del blocco e dall'icona. */
.wfd-colored .wfd-title::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--wfd-c);
  margin-right: 8px;
  vertical-align: 1px;
}
.wfd-colored .wfd-bar-fill {
  background: var(--wfd-c);
}
.wfd-colored .wfd-line-on {
  stroke: var(--wfd-c);
}
.wfd-colored .wfd-a-on {
  fill: var(--wfd-c);
}
.wfd-colored .wfd-check,
.wfd-colored .wfd-chip-icon {
  color: var(--wfd-c);
}
.wfd-colored .wfd-dafare,
.wfd-colored.wfd-dafare {
  border: 2px solid var(--wfd-c);
  background: var(--background-primary);
}
.wfd-colored .wfd-attesa,
.wfd-colored.wfd-attesa {
  border: 2px solid var(--wfd-c);
  background: repeating-linear-gradient(
    135deg,
    rgba(var(--wfd-c-rgb), 0.13) 0 6px,
    transparent 6px 12px
  );
}
.wfd-colored .wfd-fatto,
.wfd-colored.wfd-fatto {
  border: 1px solid rgba(var(--wfd-c-rgb), 0.55);
  background: rgba(var(--wfd-c-rgb), 0.16);
}
.wfd-colored .wfd-fatto .wfd-check {
  color: var(--wfd-c);
}
.wfd-colored .wfd-bloccato,
.wfd-colored.wfd-bloccato {
  border: 1px dashed rgba(var(--wfd-c-rgb), 0.6);
  background: var(--background-secondary);
}
.wfd-colored .wfd-bloccato .wfd-check,
.wfd-colored .wfd-bloccato .wfd-chip-icon {
  color: rgba(var(--wfd-c-rgb), 0.6);
}
.wfd-colored .wfd-legend .wfd-swatch {
  width: 14px;
  height: 14px;
}

/* Panoramica: striscia del colore del workflow */
.wfd-ov-item.wfd-colored,
.wfd-ov-item.wfd-colored.wfd-dafare,
.wfd-ov-item.wfd-colored.wfd-attesa {
  border-left: 4px solid var(--wfd-c);
  border-radius: 4px 8px 8px 4px;
}
.wfd-wf-colored {
  color: var(--wfd-c);
  font-weight: 600;
}

/* Scelta del colore */
.wfd-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, 32px);
  gap: 10px;
  margin: 4px 0 14px;
}
.wfd-swatch-btn {
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wfd-swatch-none {
  background: var(--background-secondary);
  color: var(--text-muted);
  border-color: var(--background-modifier-border);
}
.wfd-swatch-none svg {
  width: 16px;
  height: 16px;
}
.wfd-swatch-btn.is-active {
  outline: 2px solid var(--text-normal);
  outline-offset: 2px;
}
.wfd-colored .wfd-legend .wfd-swatch.wfd-attesa {
  background: repeating-linear-gradient(
    135deg,
    rgba(var(--wfd-c-rgb), 0.45) 0 2px,
    transparent 2px 4px
  );
}

.wfd-swatch-btn:hover {
  filter: brightness(1.08);
}

/* Cornice attorno all'intero workflow, nel colore scelto */
.wfd.wfd-colored {
  border: 2px solid var(--wfd-c);
  border-radius: 14px;
  padding: 12px 14px;
}
@container (max-width: 560px) {
  .wfd.wfd-colored {
    padding: 10px 8px;
  }
}
@media (max-width: 500px) {
  .wfd.wfd-colored {
    padding: 10px 8px;
  }
}

/* ===== Pannello di controllo ===== */
.wfd-dash {
  max-width: 760px;
  margin: 0 auto;
}
.wfd-dash-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.wfd-dash-title {
  font-size: 1.3em;
  font-weight: 700;
}
.wfd-dash-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.wfd-dash-tools .mod-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wfd-dash-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.wfd-dash-card {
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--background-secondary);
  text-align: center;
}
.wfd-dash-num {
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1.2;
}
.wfd-dash-label {
  font-size: 0.8em;
  color: var(--text-muted);
}
.wfd-card-late {
  background: rgba(var(--color-red-rgb, 233, 49, 71), 0.12);
  color: var(--color-red, #e93147);
}
.wfd-card-today {
  background: rgba(var(--color-orange-rgb, 236, 117, 0), 0.14);
  color: var(--color-orange, #ec7500);
}
.wfd-card-late .wfd-dash-label,
.wfd-card-today .wfd-dash-label {
  color: inherit;
}
.wfd-dash-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.wfd-dash-filters button.wfd-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 0.85em;
  height: auto;
  box-shadow: none;
  border: 1px solid var(--background-modifier-border);
  background-color: transparent;
  color: var(--text-muted);
  opacity: 0.75;
  cursor: pointer;
}
.wfd-dash-filters button.wfd-filter.is-active {
  opacity: 1;
  color: var(--text-normal);
  border-color: var(--text-muted);
}
.wfd-dash-filters button.wfd-filter.wfd-colored.is-active {
  border-color: var(--wfd-c);
  background-color: rgba(var(--wfd-c-rgb), 0.1);
}
.wfd-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
}
.wfd-colored .wfd-filter-dot {
  background: var(--wfd-c);
}
.wfd-filter-n {
  font-size: 0.85em;
  color: var(--text-faint);
}
.wfd-dash-group {
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 10px 0 4px;
}
.wfd-dash-group.wfd-late {
  background: none;
  color: var(--color-red, #e93147);
}
.wfd-dash-group.wfd-today {
  background: none;
  color: var(--color-orange, #ec7500);
}
details.wfd-ov-section > summary.wfd-ov-heading {
  cursor: pointer;
  list-style: none;
}
details.wfd-ov-section > summary.wfd-ov-heading::-webkit-details-marker {
  display: none;
}
details.wfd-ov-section > summary.wfd-ov-heading > span:first-child::before {
  content: "\25B8";
  display: inline-block;
  width: 1.1em;
  color: var(--text-muted);
}
details[open].wfd-ov-section > summary.wfd-ov-heading > span:first-child::before {
  content: "\25BE";
}
.wfd-dash .wfd-ov-item {
  border: 1px solid var(--background-modifier-border);
}
@media (max-width: 500px) {
  .wfd-dash-head {
    flex-wrap: wrap;
  }
  .wfd-dash-num {
    font-size: 1.25em;
  }
}

/* ===== Versione 3.1: "Io", tipi, disposizione ===== */
.wfd-hidden {
  display: none !important;
}

/* Contrassegno "Io": indipendente dai colori del workflow */
.wfd-node.wfd-mine,
.wfd-ov-item.wfd-mine {
  outline: 1.5px solid var(--text-muted);
  outline-offset: 2px;
}
.wfd-mine-badge {
  position: absolute;
  top: -9px;
  right: -7px;
  z-index: 2;
  padding: 0 7px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0.02em;
  background: var(--text-normal);
  color: var(--background-primary);
  box-shadow: 0 0 0 2px var(--background-primary);
}
.wfd-ov-item {
  position: relative;
}
.wfd-ov-item.wfd-mine .wfd-mine-badge {
  top: -8px;
  right: 8px;
}
.wfd-chip.wfd-who-me {
  background: var(--text-normal);
  color: var(--background-primary);
  font-weight: 600;
}
.wfd-chip.wfd-who-me .wfd-chip-icon,
.wfd-colored .wfd-chip.wfd-who-me .wfd-chip-icon {
  color: var(--background-primary);
}

/* Tipi di passaggio */
.wfd-type-chip {
  font-weight: 600;
}
.wfd-type-call .wfd-text::before {
  content: none;
}
.wfd-node.wfd-type-call.wfd-attesa,
.wfd-ov-item.wfd-type-call.wfd-attesa {
  border-style: double;
  border-width: 3px;
}
.wfd-colored .wfd-node.wfd-type-call.wfd-attesa {
  border-style: double;
  border-width: 3px;
}
.wfd-node.wfd-type-avvio .wfd-text {
  font-weight: 700;
}

/* Disposizione dei blocchi */
.wfd-arrange {
  gap: 4px;
  font-size: 0.8em;
  border-radius: 6px;
  padding: 3px 6px;
}
.wfd-arrange-label {
  font-size: 0.95em;
}
.wfd-arrange.is-active {
  background: var(--interactive-accent);
  color: var(--text-on-accent, #fff);
}
.wfd-move {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  border-top: 1px dashed var(--background-modifier-border);
  padding-top: 4px;
}
.wfd-move-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-normal);
  background: var(--background-modifier-hover);
}
.wfd-move-btn svg {
  width: 16px;
  height: 16px;
}
.wfd-move-btn.is-disabled {
  opacity: 0.25;
  cursor: default;
}
.wfd-layout .wfd-node {
  cursor: default;
}

/* Pannello: riquadri e sezioni speciali */
.wfd-dash-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.wfd-card-mine {
  background: var(--text-normal);
  color: var(--background-primary);
}
.wfd-card-mine .wfd-dash-label {
  color: inherit;
}
.wfd-sec-mine > .wfd-ov-heading::before {
  content: "Io";
  display: inline-block;
  margin-right: 8px;
  padding: 0 7px;
  border-radius: 9px;
  font-size: 11px;
  line-height: 18px;
  background: var(--text-normal);
  color: var(--background-primary);
}
.wfd-sec-mine > .wfd-ov-heading {
  justify-content: flex-start;
  gap: 0;
}
.wfd-sec-mine > .wfd-ov-heading .wfd-ov-count {
  margin-left: auto;
}
.wfd-dash .wfd-ov-section.wfd-sec-mine .wfd-ov-item.wfd-mine {
  outline: none;
}
@media (max-width: 500px) {
  .wfd-dash-cards {
    gap: 5px;
  }
  .wfd-dash-card {
    padding: 6px 4px;
  }
  .wfd-dash-label {
    font-size: 0.7em;
  }
}

/* ===== Versione 3.3: decisioni Sì / No ===== */

/* Blocco decisione: bordi a punta (esagono allungato), per distinguerlo dagli altri */
.wfd-node.wfd-type-decisione {
  border-radius: 22px;
  border-style: solid;
  border-width: 2px;
  padding-left: 16px;
  padding-right: 16px;
}
.wfd-node.wfd-type-decisione::before,
.wfd-node.wfd-type-decisione::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  transform: rotate(45deg);
  /* Fondo pieno: con uno sfondo trasparente o a righe le punte si vedrebbero "doppie" */
  background: var(--background-primary);
  border: inherit;
  border-width: 2px;
}
.wfd-node.wfd-type-decisione.wfd-bloccato::before,
.wfd-node.wfd-type-decisione.wfd-bloccato::after,
.wfd-node.wfd-type-decisione.wfd-saltato::before,
.wfd-node.wfd-type-decisione.wfd-saltato::after {
  background: var(--background-secondary);
}
.wfd-node.wfd-type-decisione.wfd-fatto::before,
.wfd-node.wfd-type-decisione.wfd-fatto::after {
  background: linear-gradient(rgba(var(--color-green-rgb), 0.12), rgba(var(--color-green-rgb), 0.12)), var(--background-primary);
}
.wfd-colored .wfd-node.wfd-type-decisione.wfd-fatto::before,
.wfd-colored .wfd-node.wfd-type-decisione.wfd-fatto::after {
  background: linear-gradient(rgba(var(--wfd-c-rgb), 0.16), rgba(var(--wfd-c-rgb), 0.16)), var(--background-primary);
}
.wfd-node.wfd-type-decisione::before {
  left: -7px;
  border-top-color: transparent;
  border-right-color: transparent;
}
.wfd-node.wfd-type-decisione::after {
  right: -7px;
  border-bottom-color: transparent;
  border-left-color: transparent;
}
.wfd-node.wfd-type-decisione .wfd-text {
  font-style: italic;
}
.wfd-node.wfd-type-decisione.wfd-fatto .wfd-text {
  text-decoration: none;
}

/* Esito della decisione */
.wfd-chip.wfd-outcome {
  font-weight: 700;
}
.wfd-outcome-si {
  color: var(--color-green, #08b94e);
  background: rgba(var(--color-green-rgb, 8, 185, 78), 0.14);
}
.wfd-outcome-no {
  color: var(--color-red, #e93147);
  background: rgba(var(--color-red-rgb, 233, 49, 71), 0.12);
}

/* Etichette Sì / No sulle frecce */
.wfd-edge-label {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  padding: 0 6px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 16px;
  background: var(--background-primary);
  border: 1px solid var(--background-modifier-border);
  color: var(--text-muted);
  pointer-events: none;
}
.wfd-edge-label.wfd-edge-si.is-on {
  color: var(--color-green, #08b94e);
  border-color: var(--color-green, #08b94e);
}
.wfd-edge-label.wfd-edge-no.is-on {
  color: var(--color-red, #e93147);
  border-color: var(--color-red, #e93147);
}
.wfd-edge-label.is-dead {
  opacity: 0.4;
  text-decoration: line-through;
}
.wfd-line-skip {
  opacity: 0.25;
}

/* Passaggi saltati (ramo non scelto) */
.wfd-node.wfd-saltato,
.wfd-colored .wfd-node.wfd-saltato {
  opacity: 0.45;
  border: 1px dashed var(--background-modifier-border);
  background: var(--background-secondary);
  cursor: default;
}
.wfd-node.wfd-saltato .wfd-text {
  text-decoration: line-through;
  color: var(--text-muted);
}
.wfd-swatch.wfd-saltato {
  opacity: 0.5;
  border: 1px dashed var(--text-muted);
  background: var(--background-secondary);
}

/* Scelta della risposta */
.wfd-decide {
  display: flex;
  gap: 12px;
  margin: 12px 0 6px;
}
.wfd-decide button.wfd-decide-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 52px;
  font-size: 1.15em;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
}
.wfd-decide button.wfd-decide-btn.wfd-outcome-si {
  color: var(--color-green, #08b94e);
  background-color: rgba(var(--color-green-rgb, 8, 185, 78), 0.12) !important;
  border: 2px solid var(--color-green, #08b94e);
}
.wfd-decide button.wfd-decide-btn.wfd-outcome-no {
  color: var(--color-red, #e93147);
  background-color: rgba(var(--color-red-rgb, 233, 49, 71), 0.1) !important;
  border: 2px solid var(--color-red, #e93147);
}
.wfd-decide button.wfd-decide-btn.is-active {
  box-shadow: 0 0 0 3px var(--background-primary), 0 0 0 5px currentColor !important;
}

/* Ramo nei collegamenti della scheda */
.wfd-branch {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px dashed var(--background-modifier-border);
  font-size: 0.85em;
}
.wfd-branch-label {
  color: var(--text-muted);
}

/* ===== Versione 3.4: posizioni a colonne nelle righe più corte ===== */
.wfd-row.wfd-row-grid {
  display: grid;
  grid-template-columns: repeat(var(--wfd-n), minmax(0, 1fr));
  max-width: calc(var(--wfd-n) * 260px + (var(--wfd-n) - 1) * 12px);
  margin-left: auto;
  margin-right: auto;
}
.wfd-row.wfd-row-grid .wfd-node {
  grid-row: 1;
  max-width: none;
  min-width: 0;
  width: auto;
  flex: none;
}
.wfd-center-row {
  position: absolute;
  right: 0;
  top: -22px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--background-modifier-hover);
}
.wfd-center-row:hover {
  color: var(--text-normal);
}

/* ===== Versione 3.6: pannello con "Filtro" e "Questa settimana" ===== */
.wfd-dash-tools button.wfd-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  height: auto;
  border-radius: 8px;
  box-shadow: none;
  border: 1px solid var(--background-modifier-border);
  background-color: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.wfd-dash-tools button.wfd-filter-btn.is-open,
.wfd-dash-tools button.wfd-filter-btn.has-active {
  color: var(--text-normal);
  border-color: var(--interactive-accent);
}
.wfd-filter-badge {
  min-width: 17px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 11px;
  line-height: 17px;
  text-align: center;
  background: var(--interactive-accent);
  color: var(--text-on-accent, #fff);
}
.wfd-filter-panel {
  border: 1px solid var(--background-modifier-border);
  border-radius: 10px;
  padding: 10px 12px 4px;
  margin-bottom: 14px;
  background: var(--background-secondary);
}
.wfd-filter-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.wfd-filter-quick {
  display: inline-flex;
  gap: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.wfd-filter-panel .wfd-dash-filters {
  margin-bottom: 10px;
}
.wfd-filter-tick {
  display: inline-flex;
}
.wfd-filter-tick svg {
  width: 14px;
  height: 14px;
}
.wfd-dash-filters button.wfd-filter.is-active .wfd-filter-tick {
  color: var(--interactive-accent);
}
.wfd-filter-panel button.wfd-filter-reset {
  margin: 0 0 10px;
  font-size: 0.85em;
  height: auto;
  padding: 3px 10px;
}
.wfd-card-week {
  background: color-mix(in srgb, var(--interactive-accent) 14%, transparent);
  color: var(--interactive-accent);
}
.wfd-card-week .wfd-dash-label {
  color: inherit;
}
.wfd-sec-week > .wfd-ov-heading {
  color: var(--interactive-accent);
}
.wfd-ov-heading .wfd-ov-above {
  margin-left: auto;
  margin-right: 8px;
  font-size: 0.75em;
  font-weight: 400;
  color: var(--text-faint);
}
.wfd-ov-heading .wfd-ov-above + .wfd-ov-count {
  margin-left: 0;
}
@media (max-width: 500px) {
  .wfd-filter-btn-label {
    display: none;
  }
}
.wfd-dash-note {
  font-size: 0.85em;
  color: var(--text-muted);
  margin: -6px 0 12px;
}
.wfd-dash-filters button.wfd-filter.wfd-filter-mine {
  margin-left: 6px;
}

/* ===== Versione 3.9: colore personalizzato ===== */
.wfd-swatch-custom {
  position: relative;
  background: conic-gradient(#f44, #fb3, #ee3, #4c4, #3cc, #36f, #a4f, #f4a, #f44);
  color: #fff;
}
.wfd-swatch-custom-dot {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  display: none;
}
.wfd-swatch-custom.has-color .wfd-swatch-custom-dot {
  display: block;
}
.wfd-swatch-custom-icon {
  position: relative;
  display: inline-flex;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.6));
}
.wfd-swatch-custom-icon svg {
  width: 16px;
  height: 16px;
}
.wfd-swatch-custom.has-color .wfd-swatch-custom-icon {
  display: none;
}
.wfd-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
  margin: -4px 0 14px;
}
.wfd-picker-sv {
  position: relative;
  height: 150px;
  border-radius: 8px;
  cursor: crosshair;
  touch-action: none;
  background-image:
    linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #fff, rgba(255, 255, 255, 0));
}
.wfd-picker-knob {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
input.wfd-picker-hue {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  margin: 0;
  padding: 0;
  border-radius: 7px;
  border: none;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  cursor: pointer;
}
input.wfd-picker-hue::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.4);
}
input.wfd-picker-hue::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
}
.wfd-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wfd-picker-preview {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--background-modifier-border);
  flex-shrink: 0;
}
input.wfd-picker-hex {
  width: 110px;
  font-family: var(--font-monospace);
  text-transform: lowercase;
}

/* ===== Versione 4.0: completati nascosti, archivio, rinvio, attesa ===== */
.wfd-hidden-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.8em;
  color: var(--text-muted);
  margin: -4px 0 14px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--background-secondary);
  width: fit-content;
  max-width: 100%;
}
.wfd-colored .wfd-hidden-bar .wfd-chip-icon {
  color: var(--wfd-c);
}
.wfd-archived-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  color: var(--text-muted);
}
.wfd-archived-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.wfd-archived-actions button {
  font-size: 0.85em;
  height: auto;
  padding: 3px 10px;
}
.wfd.wfd-archived {
  opacity: 0.85;
}
.wfd.wfd-colored.wfd-archived {
  border-style: dashed;
}
.wfd-chip.wfd-wait {
  color: var(--text-muted);
}
.wfd-chip.wfd-wait-long {
  color: var(--color-orange, #ec7500);
  background: rgba(var(--color-orange-rgb, 236, 117, 0), 0.14);
  font-weight: 600;
}
.wfd-colored .wfd-chip.wfd-wait-long .wfd-chip-icon {
  color: inherit;
}
.wfd-wait-long-text {
  color: var(--color-orange, #ec7500);
}
.wfd-postpone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.wfd-postpone-label {
  font-size: 0.75em;
  color: var(--text-faint);
}
.wfd-postpone button.wfd-postpone-btn {
  font-size: 0.75em;
  height: auto;
  padding: 2px 8px;
  border-radius: 10px;
  box-shadow: none;
  border: 1px solid var(--background-modifier-border);
  background-color: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.wfd-postpone button.wfd-postpone-btn:hover {
  color: var(--text-normal);
  border-color: var(--text-muted);
}
.wfd-postpone-modal {
  margin: 8px 0 4px;
}
.wfd-postpone-modal .wfd-postpone-label {
  font-size: 0.85em;
  color: var(--text-muted);
}

/* ===== Versione 4.1.1: avviso workflow duplicati ===== */
.wfd-dup-warning {
  border: 1px solid rgba(var(--color-orange-rgb, 236, 117, 0), 0.5);
  background: rgba(var(--color-orange-rgb, 236, 117, 0), 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 0.9em;
}
.wfd-dup-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--color-orange, #ec7500);
}
.wfd-dup-files {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 4px 22px;
}
.wfd-dup-desc {
  font-size: 0.9em;
  color: var(--text-muted);
}
