/* Embedded workflow runner — capture + review styling for the Test button flow.
   Throwaway-quality builder/debug view; not the production runner UX. */

.wf-loading,
.wf-error,
.wf-step,
.wf-review-group {
    font-family: var(--theme-font-family, system-ui, sans-serif);
    color: var(--theme-text, #222);
}

/* ── Step shell ──────────────────────────────────────────────────────────── */
.wf-step {
    border: 1px solid var(--theme-border, #d0d4da);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--theme-surface, #fff);
}

.wf-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.wf-step-header-left {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
}

.wf-step-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wf-step-duration {
    font-size: 0.8em;
    color: var(--theme-text-muted, #6b7280);
    white-space: nowrap;
}

.wf-step-edit {
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 0.2rem 0.35rem;
    font-size: 0.95em;
    line-height: 1;
    color: var(--theme-text-muted, #6b7280);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s, background 0.15s;
}

.wf-step-edit:hover {
    opacity: 1;
    background: var(--theme-surface-hover, #f3f4f6);
}

/* ── Builder/debug bar — paths and ids ───────────────────────────────────── */
.wf-step-debug {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--theme-surface-muted, #f6f7f9);
    border-radius: 4px;
    font-size: 0.78em;
}

.wf-step-path,
.wf-step-source-path {
    font-family: var(--theme-font-mono, ui-monospace, "Cascadia Code", "Consolas", monospace);
    color: var(--theme-text-mono, #0c4a6e);
    background: var(--theme-surface, #fff);
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    border: 1px solid var(--theme-border-light, #e5e7eb);
}

.wf-step-source-path {
    color: var(--theme-text-muted, #6b7280);
}

.wf-step-meta {
    color: var(--theme-text-muted, #6b7280);
}

/* ── Property values ─────────────────────────────────────────────────────── */
.wf-property-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 1rem;
    margin: 0.25rem 0;
}
.wf-property-list dt {
    font-weight: 500;
    color: var(--theme-text-muted, #6b7280);
}
.wf-property-list dd {
    margin: 0;
    font-family: var(--theme-font-mono, ui-monospace, "Cascadia Code", "Consolas", monospace);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Entity summary (CaptureEntitySummary + PickerItemReview) ────────────── */
.wf-entity-summary {
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
}

.wf-entity-summary-header {
    margin-bottom: 0.5rem;
}

.wf-entity-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--theme-text, #222);
}

.wf-entity-summary-empty {
    color: var(--theme-text-muted, #6b7280);
    font-size: 0.875rem;
    padding: 0.5rem 0;
}

.wf-property-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0;
}

.wf-property-row + .wf-property-row {
    border-top: 1px solid var(--theme-border, #d0d4da);
}

.wf-property-label {
    flex: 0 0 auto;
    min-width: 9rem;
    color: var(--theme-text-muted, #6b7280);
    font-weight: 500;
    font-size: 0.875rem;
}

.wf-property-value {
    flex: 1;
    font-weight: 500;
    color: var(--theme-text, #222);
    font-size: 0.875rem;
    font-family: var(--theme-font-mono, ui-monospace, "Cascadia Code", "Consolas", monospace);
}

.wf-entity-summary-edit {
    flex: 0 0 auto;
    margin-left: auto;
    background: transparent;
    border: none;
    padding: 0.25rem 0.375rem;
    color: var(--theme-text-muted, #6b7280);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    transition: color 120ms ease, background 120ms ease;
    -webkit-tap-highlight-color: transparent;
}

.wf-entity-summary-edit:hover {
    color: var(--theme-primary, #2563eb);
    background: var(--theme-background-hover, #f3f4f6);
}

/* ── Picker intermediate review title ────────────────────────────────────── */
.wf-picker-review-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-text, #222);
    margin-bottom: 0.75rem;
}

/* ── Split option buttons ───────────────────────────────────────────────── */

.wf-split-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.25rem 0;
}

.wf-split-option {
    width: 100%;
    padding: 0.7rem 1.25rem;
    border: 1.5px solid var(--theme-border, #d0d4da);
    border-radius: 1.5rem;
    background: var(--theme-background-raised, #fff);
    color: var(--theme-text, #222);
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    text-align: center;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, color 150ms ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.wf-split-option:hover {
    background: var(--theme-background-hover, #f3f4f6);
    border-color: var(--theme-border-subtle, #b0b7bf);
}

.wf-split-option:active {
    background: var(--theme-background-active, #e5e7eb);
}

.wf-split-option-selected {
    background: var(--theme-primary-muted, rgba(37, 99, 235, 0.1));
    border-color: var(--theme-primary, #2563eb);
    color: var(--theme-primary, #2563eb);
    box-shadow: 0 0 0 1px var(--theme-primary, #2563eb),
                0 0 14px rgba(var(--theme-primary-rgb, 37 99 235), 0.22);
}

.wf-split-option-selected:hover {
    background: var(--theme-primary-muted, rgba(37, 99, 235, 0.1));
    border-color: var(--theme-primary, #2563eb);
}

/* ── Choice options ──────────────────────────────────────────────────── */

.wf-choice-options {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.25rem 0;
}

.wf-choice-option {
    width: 100%;
    padding: 0.7rem 1.25rem;
    border: 1.5px solid var(--theme-border, #d0d4da);
    border-radius: 1.5rem;
    background: var(--theme-background-raised, #fff);
    color: var(--theme-text, #222);
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-align: left;
}

.wf-choice-option-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    font-size: 1.25rem;
    line-height: 1;
}

.wf-choice-option-label {
    flex: 1 1 auto;
}

.wf-choice-option-proceed {
    border-color: color-mix(in srgb, var(--theme-success, #198754) 35%, var(--theme-border, #d0d4da));
}

.wf-choice-option-proceed .wf-choice-option-badge {
    color: var(--theme-success, #198754);
}

.wf-choice-option-proceed:hover {
    background: color-mix(in srgb, var(--theme-success, #198754) 6%, var(--theme-background-raised, #fff));
    border-color: var(--theme-success, #198754);
}

.wf-choice-option-blocked {
    border-color: color-mix(in srgb, var(--theme-danger, #dc3545) 25%, var(--theme-border, #d0d4da));
    cursor: not-allowed;
    opacity: 0.85;
}

.wf-choice-option-blocked .wf-choice-option-badge {
    color: var(--theme-danger, #dc3545);
}

.wf-choice-option-blocked:hover {
    /* No state change on hover for blocked — they're inert */
    background: var(--theme-background-raised, #fff);
}

.wf-choice-option-exit {
    border-color: color-mix(in srgb, var(--theme-warning, #fd7e14) 35%, var(--theme-border, #d0d4da));
}

.wf-choice-option-exit .wf-choice-option-badge {
    color: var(--theme-warning, #fd7e14);
}

.wf-choice-option-exit:hover {
    background: color-mix(in srgb, var(--theme-warning, #fd7e14) 6%, var(--theme-background-raised, #fff));
    border-color: var(--theme-warning, #fd7e14);
}

.wf-choice-option-exit-selected {
    background: color-mix(in srgb, var(--theme-warning, #fd7e14) 10%, var(--theme-background-raised, #fff));
    border-color: var(--theme-warning, #fd7e14);
    box-shadow: 0 0 0 1px var(--theme-warning, #fd7e14);
}

.wf-choice-option-selected {
    background: color-mix(in srgb, var(--theme-success, #198754) 10%, var(--theme-background-raised, #fff));
    border-color: var(--theme-success, #198754);
    box-shadow: 0 0 0 1px var(--theme-success, #198754);
}

/* ── Picker record list ─────────────────────────────────────────────────── */

.wf-picker-search {
    margin-bottom: 0.6rem;
}

.wf-picker-search-input {
    width: 100%;
    padding: 0.5rem 0.85rem;
    border: 1.5px solid var(--theme-border, #d0d4da);
    border-radius: 0.5rem;
    background: var(--theme-background-raised, #fff);
    color: var(--theme-text, #222);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 150ms ease;
}

.wf-picker-search-input:focus {
    border-color: var(--theme-primary, #2563eb);
}

.wf-picker-options {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0.25rem 0;
}

/* Outer wrapper — one per record; holds the row + optional expansion panel */
.wf-picker-record {
    border: 1.5px solid var(--theme-border, #d0d4da);
    border-radius: 0.75rem;
    background: var(--theme-background-raised, #fff);
    overflow: hidden;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.wf-picker-record-selected {
    border-color: var(--theme-primary, #2563eb);
    box-shadow: 0 0 0 1px var(--theme-primary, #2563eb),
                0 0 14px rgba(var(--theme-primary-rgb, 37 99 235), 0.18);
}

/* Inner row: record label (stretches) + edit icon button */
.wf-picker-item {
    display: flex;
    align-items: stretch;
}

.wf-picker-item-label {
    flex: 1;
    padding: 0.65rem 1rem;
    border: none;
    background: transparent;
    color: var(--theme-text, #222);
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.wf-picker-record-selected .wf-picker-item-label {
    color: var(--theme-primary, #2563eb);
    background: var(--theme-primary-muted, rgba(37, 99, 235, 0.07));
}

.wf-picker-item-label:hover {
    background: var(--theme-background-hover, #f3f4f6);
}

.wf-picker-item-edit {
    padding: 0 0.85rem;
    border: none;
    border-left: 1px solid var(--theme-border, #d0d4da);
    background: transparent;
    color: var(--theme-text-muted, #6b7280);
    font-size: 1rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 150ms ease, color 150ms ease;
}

.wf-picker-item-edit:hover {
    background: var(--theme-background-hover, #f3f4f6);
    color: var(--theme-text, #222);
}

/* Inline expansion panel shown below the row when a record is tapped */
.wf-picker-item-details {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--theme-border, #d0d4da);
    background: var(--theme-primary-muted, rgba(37, 99, 235, 0.04));
}

.wf-picker-empty,
.wf-picker-no-results {
    padding: 0.75rem 0;
    color: var(--theme-text-muted, #6b7280);
    font-size: 0.95rem;
    text-align: center;
}

.wf-picker-add-btn {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.6rem 1rem;
    border: 1.5px dashed var(--theme-border, #d0d4da);
    border-radius: 1.5rem;
    background: transparent;
    color: var(--theme-text-muted, #6b7280);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

.wf-picker-add-btn:hover {
    border-color: var(--theme-primary, #2563eb);
    color: var(--theme-primary, #2563eb);
    background: var(--theme-primary-muted, rgba(37, 99, 235, 0.06));
}

/* ── Picker step-by-step form header + navigation ───────────────────────── */

.wf-picker-form-tabs {
    display: flex;
    margin-bottom: 1rem;
    border: 1.5px solid var(--theme-border, #d0d4da);
    border-radius: 1.5rem;
    overflow: hidden;
}

.wf-picker-form-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--theme-text-muted, #6b7280);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

.wf-picker-form-tab:hover:not(.wf-picker-form-tab-active) {
    background: var(--theme-surface-hover, #f3f4f6);
}

.wf-picker-form-tab-active {
    background: var(--theme-primary, #2563eb);
    color: #fff;
}

.wf-picker-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.wf-picker-form-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-text, #222);
}

.wf-picker-form-cancel-x {
    padding: 0.2rem 0.55rem;
    border: none;
    background: transparent;
    color: var(--theme-text-muted, #6b7280);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    transition: background 150ms ease, color 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

.wf-picker-form-cancel-x:hover {
    background: var(--theme-surface-hover, #f3f4f6);
    color: var(--theme-text, #222);
}

.wf-picker-form-step-count {
    font-size: 0.8rem;
    color: var(--theme-text-muted, #6b7280);
    margin-bottom: 0.5rem;
}

.wf-picker-step-footer {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
}

.wf-picker-step-footer .wf-nav-back {
    padding: 0.6rem 1rem;
    border: 1.5px solid var(--theme-border, #d0d4da);
    border-radius: 1.5rem;
    background: transparent;
    color: var(--theme-text-muted, #6b7280);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 150ms ease, color 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

.wf-picker-step-footer .wf-nav-back:hover:not(:disabled) {
    border-color: var(--theme-text-muted, #6b7280);
    color: var(--theme-text, #222);
}

.wf-picker-step-footer .wf-nav-back:disabled {
    opacity: 0.4;
    cursor: default;
}

.wf-picker-step-footer .wf-nav-next {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 1.5rem;
    background: var(--theme-primary, #2563eb);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

.wf-picker-step-footer .wf-nav-next:hover {
    background: var(--theme-primary-dark, #1d4ed8);
}

/* ── Picker add / edit form ─────────────────────────────────────────────── */

.wf-picker-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.25rem 0;
}

.wf-picker-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.wf-picker-form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--theme-text, #222);
}

.wf-picker-form-required {
    margin-left: 0.2rem;
    color: var(--theme-danger, #dc2626);
}

.wf-picker-form-actions {
    display: flex;
    gap: 0.6rem;
    padding-top: 0.25rem;
}

.wf-picker-form-save {
    flex: 1;
    padding: 0.65rem 1rem;
    border: none;
    border-radius: 1.5rem;
    background: var(--theme-primary, #2563eb);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

.wf-picker-form-save:hover {
    background: var(--theme-primary-dark, #1d4ed8);
}

.wf-picker-form-cancel {
    padding: 0.65rem 1.25rem;
    border: 1.5px solid var(--theme-border, #d0d4da);
    border-radius: 1.5rem;
    background: transparent;
    color: var(--theme-text-muted, #6b7280);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 150ms ease, color 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

.wf-picker-form-cancel:hover {
    border-color: var(--theme-text-muted, #6b7280);
    color: var(--theme-text, #222);
}

/* ── MultiSplit checkboxes (capture and review) ─────────────────────────── */

.wf-multisplit-check-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0.25rem 0;
}

.wf-multisplit-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--theme-border, #d0d4da);
    border-radius: 4px;
    cursor: pointer;
    background: var(--theme-surface, #fff);
}

.wf-multisplit-check:hover {
    background: var(--theme-surface-hover, #f3f4f6);
}

.wf-multisplit-check.wf-option-selected {
    background: var(--theme-primary-soft, #dbeafe);
    border-color: var(--theme-primary, #2563eb);
}
.wf-option-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.wf-option-required {
    color: var(--theme-danger, #b91c1c);
    margin-left: 0.15rem;
}
.wf-option-status-complete {
    color: var(--theme-success, #16a34a);
    font-weight: 700;
}
.wf-option-status-started {
    color: var(--theme-warning, #b45309);
}

/* ── Loop iteration badge ────────────────────────────────────────────────── */
.wf-loop-iteration {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--theme-primary, #2563eb);
    background: var(--theme-primary-soft, #dbeafe);
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    margin-bottom: 0.5rem;
}

/* ── Workflow review ─────────────────────────────────────────────────────── */

.wf-review {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.wf-review-header {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--theme-border, #d0d4da);
}

.wf-review-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--theme-text, #222);
}

.wf-review-subtitle {
    font-size: 0.875rem;
    color: var(--theme-text-muted, #6b7280);
    margin-top: 0.2rem;
}

.wf-review-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--theme-text-muted, #6b7280);
}

.wf-review-duration::before {
    content: "·";
    margin-right: 0.75rem;
}

.wf-review-abandoned {
    opacity: 0.55;
    border-top: 1px dashed var(--theme-border, #d0d4da);
    padding-top: 0.75rem;
}

.wf-review-abandoned-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--theme-text-muted, #6b7280);
    margin-bottom: 0.5rem;
}

/* ── Review groups (loops, multisplit legs) ──────────────────────────────── */

.wf-review-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wf-review-group-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--theme-text-muted, #6b7280);
    padding: 0 0 0.25rem;
}

.wf-review-nested {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: 1rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--theme-border, #d0d4da);
}

/* ── Review step content ─────────────────────────────────────────────────── */

.wf-step-value {
    font-size: 0.9rem;
    color: var(--theme-text, #222);
}

.wf-info-acknowledged {
    font-size: 0.85rem;
    color: var(--theme-text-muted, #6b7280);
    font-style: italic;
}

.wf-step-entity {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

/* ── Split radio review ──────────────────────────────────────────────────── */

.wf-split-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.wf-split-radio {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--theme-text-muted, #6b7280);
    cursor: default;
}

.wf-split-radio.wf-option-selected {
    color: var(--theme-text, #222);
    font-weight: 500;
}

.wf-split-radio input[type="radio"] {
    accent-color: var(--theme-primary, #2563eb);
    cursor: default;
}

.wf-split-radio-label {
    flex: 1;
}

/* ── Page chrome ─────────────────────────────────────────────────────────── */
.wf-runner-shell {
    max-width: 960px;
    margin: 1rem auto;
    padding: 0 1rem;
}
.wf-runner-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.wf-runner-toolbar button {
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    border: 1px solid var(--theme-border, #d0d4da);
    background: var(--theme-surface, #fff);
    cursor: pointer;
}
.wf-runner-toolbar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Run page layout (embedded portal runner) ────────────────────────────── */

.wf-run-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 3.25rem);
    padding: 0;
    font-family: var(--theme-font-family, system-ui, sans-serif);
    color: var(--theme-text, #222);
}

.wf-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1.5rem 3rem;
}

.wf-welcome-name {
    margin: 0 0 0.75rem;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.wf-welcome-description {
    margin: 0;
    font-size: var(--theme-font-size-base, 1rem);
    color: var(--theme-text-muted, #6b7280);
    max-width: 480px;
    line-height: 1.6;
}

.wf-welcome-start {
    margin-top: 2rem;
}

.wf-run-workflow-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1rem;
    background: var(--theme-primary, #2563eb);
    color: var(--theme-text-on-primary, #fff);
}

.wf-run-workflow-name {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wf-run-pending-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 0.625rem;
    background: var(--theme-text-on-primary, #fff);
    color: var(--theme-primary, #2563eb);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.wf-run-body {
    flex: 1;
    padding: 1rem;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
}

.wf-run-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--theme-background-raised-alpha, var(--theme-background-raised));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--theme-border);
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.wf-run-error {
    padding: 1.5rem 1rem;
    color: var(--theme-danger, #b91c1c);
}

.wf-nav-back,
.wf-nav-next {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.25rem;
    font-family: inherit;
    font-size: var(--theme-font-size-base, 1rem);
    font-weight: 500;
    border-radius: var(--theme-radius-button, 6px);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 120ms ease;
    user-select: none;
}

.wf-nav-back {
    background: var(--theme-background-active);
    border-color: var(--theme-border-subtle, var(--theme-border));
    color: var(--theme-text);
}

.wf-nav-back:hover:not(:disabled) {
    background: var(--theme-background-hover);
    border-color: var(--theme-text-muted);
}

.wf-nav-next {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: var(--theme-text-on-primary, #fff);
}

.wf-nav-next:hover:not(:disabled) {
    background: var(--theme-primary-hover, var(--theme-primary));
    border-color: var(--theme-primary-hover, var(--theme-primary));
}

.wf-nav-back:disabled,
.wf-nav-next:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── Step capture chrome ─────────────────────────────────────────────────── */

.wf-step-capture {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wf-step-iteration {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--theme-primary-soft, #dbeafe);
    color: var(--theme-primary, #2563eb);
    border-radius: 999px;
    align-self: flex-start;
}

.wf-step-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--theme-text-emphasis, var(--theme-text));
    line-height: 1.35;
}

.wf-step-title {
    font-size: 0.9rem;
    color: var(--theme-text-muted, #6b7280);
    line-height: 1.5;
    margin-top: -0.25rem;
}

.wf-info-step {
    padding: 1rem;
    background: var(--theme-background-subtle, #f8f9fa);
    border-radius: 6px;
    color: var(--theme-text, #222);
    font-size: 0.95rem;
    line-height: 1.6;
    border-left: 3px solid var(--theme-primary, #2563eb);
}

/* ── Capture inputs ──────────────────────────────────────────────────────── */

.wf-capture-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wf-text-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--theme-background-raised, #fff);
    border: 1px solid var(--theme-border, #d0d4da);
    border-radius: var(--theme-radius-button, 6px);
    color: var(--theme-text, #222);
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s;
}

.wf-text-input:focus {
    border-color: var(--theme-primary, #2563eb);
}

.wf-text-input.wf-input-invalid {
    border-color: var(--theme-danger, #dc3545);
}

.wf-capture-error {
    font-size: 0.85rem;
    color: var(--theme-danger, #dc3545);
    padding: 0 0.25rem;
}

.wf-capture-unsupported {
    padding: 0.75rem 1rem;
    background: var(--theme-warning-muted, #fef9c3);
    border-radius: 6px;
    color: var(--theme-warning, #b45309);
    font-size: 0.875rem;
}

/* ── Options list (CaptureChoice) ────────────────────────────────────────── */

.wf-options-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.wf-options-list li {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.6875rem 1rem;
    background: var(--theme-background-raised, #fff);
    border: 1px solid var(--theme-border, #d0d4da);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--theme-text, #222);
    transition: background 100ms ease, border-color 100ms ease;
    user-select: none;
}

.wf-options-list li:hover:not(.wf-option-disabled) {
    background: var(--theme-background-hover, #f3f4f6);
    border-color: var(--theme-border-subtle, #b0b7bf);
}

.wf-options-list li.wf-option-selected {
    background: var(--theme-primary-soft, #dbeafe);
    border-color: var(--theme-primary, #2563eb);
    color: var(--theme-primary, #2563eb);
    font-weight: 500;
}

.wf-option-indicator {
    flex-shrink: 0;
    width: 1.1rem;
    text-align: center;
    font-size: 0.8rem;
}

/* ── Options list with alphabet jump rail ────────────────────────────────── */

.wf-options-with-rail {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    position: relative;
}

.wf-options-with-rail .wf-options-list {
    flex: 1 1 auto;
    min-width: 0;
}

.wf-options-list li.wf-options-section {
    display: block;
    padding: 0.5rem 0 0.25rem 0.25rem;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--theme-text-muted, #6b7280);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: default;
    user-select: none;
    scroll-margin-top: 0.5rem;
}

.wf-options-list li.wf-options-section:hover {
    background: transparent;
    border-color: transparent;
}

.wf-options-rail {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1px;
    padding: 0.25rem 0.125rem;
    position: sticky;
    top: 0.5rem;
    align-self: flex-start;
    max-height: calc(100vh - 8rem);
    overflow: hidden;
}

.wf-rail-letter {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    width: 1rem;
    height: 0.875rem;
    line-height: 0.875rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--theme-primary, #2563eb);
    cursor: pointer;
    user-select: none;
    text-align: center;
    border-radius: 2px;
}

.wf-rail-letter:hover:not(.wf-rail-inactive) {
    background: var(--theme-primary-soft, #dbeafe);
}

.wf-rail-letter.wf-rail-inactive {
    color: var(--theme-text-muted, #9ca3af);
    opacity: 0.4;
    cursor: default;
}

/* ── Date numpad ─────────────────────────────────────────────────────────── */

.wf-date-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: var(--theme-background-raised, #fff);
    border: 1px solid var(--theme-border, #d0d4da);
    border-radius: 6px;
    font-size: 1.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: var(--theme-text, #222);
}

.wf-date-segment {
    color: var(--theme-text-muted, #6b7280);
    transition: color 120ms ease;
}

.wf-date-segment-active {
    color: var(--theme-primary, #2563eb);
}

.wf-date-sep {
    color: var(--theme-border, #d0d4da);
    font-weight: 400;
}

.wf-numpad {
    display: grid;
    grid-template-areas:
        "n7 n8 n9 ca"
        "n4 n5 n6 ca"
        "n1 n2 n3 cc"
        "n0 n0 sl cc";
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 3.25rem);
    gap: 0.5rem;
}

.wf-numpad-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 1.25rem;
    font-weight: 500;
    background: var(--theme-background-raised, #fff);
    border: 1px solid var(--theme-border, #d0d4da);
    border-radius: 6px;
    color: var(--theme-text, #222);
    cursor: pointer;
    transition: background 100ms ease, border-color 100ms ease, opacity 100ms ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.wf-numpad-btn:hover:not(:disabled) {
    background: var(--theme-background-hover, #f3f4f6);
    border-color: var(--theme-border-subtle, #b0b7bf);
}

.wf-numpad-btn:active:not(:disabled) {
    background: var(--theme-background-active, #e5e7eb);
}

.wf-numpad-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.wf-numpad-action {
    background: var(--theme-background-subtle, #f8f9fa);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.wf-numpad-action:hover:not(:disabled) {
    background: var(--theme-background-active, #e5e7eb);
}

.wf-numpad-sep {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--theme-text-muted, #6b7280);
}

.wf-numpad.wf-numpad-num {
    grid-template-areas:
        "n7 n8 n9 ca"
        "n4 n5 n6 ca"
        "n1 n2 n3 cc"
        "dp n0 n0 cc";
}

.wf-num-display {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background: var(--theme-background-raised, #fff);
    border: 1px solid var(--theme-border, #d0d4da);
    border-radius: 6px;
    font-size: 1.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: var(--theme-text, #222);
    min-height: 3.25rem;
    word-break: break-all;
}

.wf-num-display-empty {
    color: var(--theme-text-muted, #6b7280);
}

.wf-date-display-datetime {
    font-size: 1.3rem;
    gap: 0.2rem;
}

.wf-date-sep-dash {
    margin: 0 0.25rem;
    color: var(--theme-text-muted, #6b7280);
    font-weight: 400;
}

.wf-ampm-indicator {
    margin-left: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--theme-text-muted, #6b7280);
    align-self: flex-end;
    padding-bottom: 0.1rem;
}

.wf-numpad.wf-numpad-time {
    grid-template-areas:
        "n7 n8 n9 am"
        "n4 n5 n6 pm"
        "n1 n2 n3 md"
        "n0 n0 sl cc";
}

.wf-numpad-btn.wf-ampm-active {
    background: var(--theme-primary, #2563eb);
    color: #fff;
    border-color: var(--theme-primary, #2563eb);
}

.wf-numpad-btn.wf-ampm-active:hover {
    background: var(--theme-primary-hover, #1d4ed8);
    border-color: var(--theme-primary-hover, #1d4ed8);
}

.wf-shortcut-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.625rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--theme-border, #d0d4da);
    border-radius: 6px;
    background: var(--theme-background-raised, #fff);
    color: var(--theme-text-muted, #6b7280);
    cursor: pointer;
    transition: background 100ms ease, color 100ms ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.wf-shortcut-btn:hover {
    background: var(--theme-background-hover, #f3f4f6);
    color: var(--theme-text, #222);
}

.wf-shortcut-btn:active {
    background: var(--theme-background-active, #e5e7eb);
}
