.wf-page { --wf-gap: 1rem; }
.wf-page h1 { font-size: clamp(2rem, 4.3vw, 3.55rem); letter-spacing: -.05em; line-height: 1.07; margin: .45rem 0; max-width: 21ch; }
.wf-page h2 { font-size: 1.15rem; letter-spacing: -.022em; margin: 0 0 .7rem; }
.wf-page h3 { font-size: 1.02rem; line-height: 1.27; margin: .85rem 0 .4rem; }
.wf-page h4 { margin: .8rem 0 .35rem; }
.wf-page p { margin: .45rem 0 .75rem; line-height: 1.47; }
.wf-heading { border-bottom: 1px solid var(--pep-line); margin-bottom: 1.3rem; padding: .7rem 0 1.25rem; }
.wf-heading p { max-width: 66ch; color: var(--pep-muted); }
.wf-scenarios { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--wf-gap); }
.wf-scenario,.wf-panel { border: 1px solid var(--pep-line); border-radius: .9rem; background: var(--surface); min-width: 0; padding: 1rem; }
.wf-scenario { display: flex; flex-direction: column; border-top: 3px solid var(--pep-teal); gap: .18rem; }
.wf-scenario h2 { font-size: 1.4rem; }
.wf-scenario h2 a { text-decoration: none; color: var(--pep-ink); }
.wf-scenario h2 a:hover { text-decoration: underline; }
.wf-meta,.wf-stack,.wf-page small { color: var(--pep-muted); font-size: .84rem; }
.wf-scenario .wf-stack { margin-top: auto; padding-top: .65rem; }
.wf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.wf-button { display: inline-flex; align-items: center; justify-content: center; color: var(--pep-ink); background: var(--surface-alt); border: 1px solid var(--pep-line); border-radius: .45rem; padding: .43rem .65rem; min-height: 40px; box-sizing: border-box; text-decoration: none; text-align: left; cursor: pointer; line-height: 1.25; }
.wf-button:hover { border-color: var(--pep-teal); }
.wf-button:disabled { opacity: .67; }
.wf-board { display: grid; gap: var(--wf-gap); grid-template-columns: minmax(245px,1fr) minmax(280px,1.45fr) minmax(240px,1fr); align-items: start; }
.wf-board .wf-panel { overflow-wrap: anywhere; }
.wf-definition { margin: .55rem 0; font-size: .88rem; }
.wf-definition dt { font-weight: 650; margin-top: .48rem; }
.wf-definition dd { margin: .15rem 0 .35rem; color: var(--pep-muted); }
.wf-panel details { border-top: 1px solid var(--pep-line); padding: .42rem 0; }
.wf-panel summary { cursor: pointer; line-height: 1.38; }
.wf-concepts { list-style: none; display: flex; gap: .35rem .7rem; flex-wrap: wrap; padding: 0; font-size: .87rem; }
.wf-text-button { width: 100%; justify-content: flex-start; margin-bottom: .25rem; }
.wf-graph { position: relative; padding: .8rem .95rem; background: var(--pep-bg); border: 1px solid var(--pep-line); border-radius: .68rem; display: grid; gap: 1.95rem; }
.wf-graph svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; color: var(--pep-teal); }
.wf-graph path { stroke: currentColor; stroke-width: 1.4; fill: none; }
.wf-layer { display: flex; position: relative; justify-content: center; gap: .45rem; align-items: start; min-width: 0; }
.wf-start,.wf-end { border-radius: 2rem; padding: .25rem .65rem; background: var(--surface-alt); color: var(--pep-teal); border: 1px solid var(--pep-line); font-size: .8rem; text-align: center; font-weight: 680; }
.wf-node-wrap { min-width: 0; flex: 1 1 9rem; max-width: 17rem; display: grid; gap: .2rem; text-align: center; background: var(--surface); border: 1px solid var(--pep-line); border-radius: .55rem; padding: .25rem; }
.wf-node { width: 100%; color: var(--pep-ink); border: 1px solid transparent; background: var(--surface-alt); border-radius: .35rem; font-size: .9rem; font-weight: 680; cursor: pointer; padding: .42rem .35rem; line-height: 1.2; }
.wf-node[aria-pressed=true] { border-color: var(--pep-teal); }
.wf-node[data-state=pendiente] { border-style: dashed; border-color: var(--pep-focus); }
.wf-node[data-state=incompatible] { border-color: var(--pep-focus); border-width: 2px; }
.wf-conditions { font-size: .72rem; line-height: 1.2; list-style: none; padding: 0 .12rem; margin: 0; color: var(--pep-muted); }
.wf-conditions li + li { margin-top: .22rem; }
@media (max-width: 980px) { .wf-board { grid-template-columns: minmax(0,1fr) minmax(0,1.35fr); } .wf-board > :last-child { grid-column: 1 / -1; } }
@media (max-width: 670px) { .wf-scenarios,.wf-board { grid-template-columns: minmax(0,1fr); } .wf-layer { flex-wrap: wrap; } .wf-pane { min-width: 0; } }

main:has(.wf-page) { max-width: 1480px; padding-inline: clamp(.85rem, 3vw, 2.4rem); }
.wf-modes { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.wf-modes [aria-pressed=true],.wf-primary { background: var(--pep-teal); border-color: var(--pep-teal); color: var(--pep-bg); font-weight: 700; }
:root[data-theme=dark] .wf-primary { color: #10252a; }
.wf-status { border: 1px solid var(--pep-line); border-radius: 1.4rem; color: var(--pep-teal); font-weight: 700; font-size: .85rem; padding: .25rem .7rem; background: var(--surface-alt); }
.wf-status[data-state=incompatible], .wf-status-text { color: var(--pep-focus); font-weight: 680; }
.wf-notice:not(:empty),.wf-alert { border-inline-start: 3px solid var(--pep-focus); background: var(--surface-alt); padding: .55rem .7rem; margin: .6rem 0; }
.wf-notice:empty { display: none; }
.wf-board > section:focus { outline-offset: 1px; }
.wf-section-links { gap: .35rem .8rem; font-size: .88rem; margin-top: .8rem; }
.wf-field { display: grid; gap: .2rem; margin: .5rem 0; font-size: .88rem; }
.wf-field select,.wf-field input { min-width: 0; width: 100%; padding: .45rem; border: 1px solid var(--pep-line); border-radius: .35rem; min-height: 40px; }
.wf-python-editor { width: 100%; min-height: 12rem; font-family: monospace; resize: vertical; }
.wf-add-card { display: grid; gap: .3rem; margin: .4rem 0; border: 1px solid var(--pep-line); border-radius: .5rem; padding: .55rem; }
.wf-add-card button { justify-self: start; }
.wf-add-card p { font-size: .82rem; margin: .15rem 0; }
.wf-reasons { font-size: .82rem; padding-inline-start: 1.1rem; margin: .35rem 0; }
.wf-question-picker { margin: .65rem 0; }
.wf-question { border: 1px solid var(--pep-line); border-radius: .58rem; padding: .65rem; margin: .55rem 0; }
.wf-question > h3 { margin-top: .2rem; }
.wf-option-body { font-size: .88rem; padding-inline-start: .3rem; }
.wf-option { margin: .12rem 0; }
.wf-option[open] > summary { color: var(--pep-teal); font-weight: 660; }
.wf-option summary { font-size: .9rem; }
.wf-node-decisions { display: flex; flex-wrap: wrap; justify-content: center; gap: .18rem .3rem; }
.wf-node-choice { min-height: 34px; padding: .25rem .45rem; border-radius: .35rem; color: var(--pep-teal); border: 1px solid var(--pep-line); font-size: .73rem; text-align: left; }
.wf-dialog { width: min(31rem, calc(100% - 2rem)); padding: 1rem; border-radius: .7rem; }
.wf-dialog h2 { margin: 0 0 .6rem; }

.wf-page:has(.wf-board) h1 { max-width: none; font-size: clamp(1.85rem,3.6vw,3.1rem); }
.wf-heading details { margin-top: .55rem; color: var(--pep-muted); }
.wf-heading summary { cursor: pointer; }
.wf-heading > .wf-actions { gap: .55rem .85rem; }
.wf-page a:focus-visible,.wf-page button:focus-visible,.wf-page summary:focus-visible {
  outline: 2px solid var(--pep-focus); outline-offset: 2px;
}
@media (max-width: 670px) {
  .wf-board { gap: .85rem; }
  .wf-section-links { row-gap: .4rem; }
  .wf-node-choice { min-height: 40px; }
}
.wf-sample { overflow-x: auto; max-width: 100%; }
.wf-sample table { border-collapse: collapse; font-size: .82rem; }
.wf-sample th,.wf-sample td { padding: .3rem; border-bottom: 1px solid var(--pep-line); text-align: left; }
#workflow-inspector pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: .5rem; }
