/* ═══════════════════════════════════════════════════════════════════
   What the classic workflow canvas left behind (the canvas itself was RETIRED
   on 2026-10-04 - Kirk's order item 4, docs/claude/CONVERSATION-BUILDER.md
   section 29): the scroll + zoom surface and the step-family tokens other
   pages still read. Its step-card, connector and drag-drop rules went with it.
   ═══════════════════════════════════════════════════════════════════ */

.canvas-scroll {
    flex: 1;
    min-height: 0;
    min-width: 0;
    /* Always-visible scrollbars — the canvas is the only scroll surface on
       this page, and a permanent gutter avoids the "scrollbar hides below
       the viewport" problem when content is tall AND wide. */
    overflow: scroll;
    padding-bottom: 1rem;
    /* `safe center` centers the canvas while it fits, but snaps to the
       start edge (left/top) the moment content overflows — so scrollLeft
       can engage normally without the centering math fighting it. */
    display: flex;
    justify-content: safe center;
    align-items: safe start;
}

/* Temporary debug HUD — corner panel that prints live scroll metrics so we
   can diagnose why horizontal scrolling isn't engaging. Remove once fixed. */
.wf-zoom-debug {
    position: fixed;
    bottom: 8px;
    right: 8px;
    z-index: 99999;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.4;
    border-radius: 4px;
    pointer-events: none;
    white-space: pre;
}

.wf-canvas {
    padding: 1rem 2rem 2rem;
    /* No `margin: 0 auto` — auto-centering changes the canvas's left
       position implicitly when crossing the fits-container threshold,
       which fights our scroll-based zoom-to-cursor math. Canvas anchored
       at the scroll origin; smaller canvases just look left-justified. */
    margin: 0;
    /* zoom is layout-affecting (unlike transform: scale), so the wrapper's
       scrollbars track the scaled canvas naturally. Wired to the toolbar
       slider and to shift+wheel via JSCanvasZoomService. */
    transform-origin: top left;
}

/* ── Step-type family palette ────────────────────────────────────────
   Categorical colors for the canvas step cards. These are INTENTIONALLY
   theme-independent: a Split is always amber, a Loop always pink, etc.,
   regardless of the tenant's brand color — categorical encoding must stay
   stable so a builder learns "amber = fork" once. Defined once here as
   named tokens (not scattered hex) and read via var(--wf-fam) on the rail
   + chip. Mid-ramp values so they read on light AND dark surfaces. */
.wf-canvas {
    --wf-fam-info: #378ADD;
    --wf-fam-connected: #639922;
    --wf-fam-plain: #8A8A82;
    --wf-fam-split: #C98A1E;
    --wf-fam-multisplit: #7C74D6;
    --wf-fam-context: #1D9E75;
    --wf-fam-value: #D2693E;
    --wf-fam-loop: #CF5C84;
    --wf-fam-start: #57902A;
    --wf-fam-end: #8A8A82;
    --wf-fam-branch: #6E76B3;
    --wf-fam-exit: #2A9D8F;
    --wf-fam-jump: #2AA9D8;
    --wf-bdg-internal: #B8860B;
}

.wf-step-title {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--theme-text);
    text-align: left;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    word-break: break-word;
}

.wf-step-name {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    line-height: 1.2;
    color: var(--theme-text);
    font-weight: 500;
    overflow: hidden;
    /* 2-line clamp: allows two-line wrap, then ellipsis on the third */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    word-break: break-word;
}

.wf-step-name i {
    flex-shrink: 0;
    margin-right: 0.25rem;
}

/* ── Drag-and-drop ─────────────────────────────────────────────── */

/* Draggable steps */
.wf-step-name[draggable="true"] {
    cursor: grab;
}
.wf-step-name[draggable="true"]:active {
    cursor: grabbing;
    opacity: 0.5;
}

.wf-drop-zone {
    min-width: 110px;
    height: 32px;
    padding: 0 0.65rem;
    border: 2px dashed var(--theme-border-subtle, #b0b7bf);
    border-radius: 16px;
    background: var(--theme-background-subtle, #f8f9fa);
    color: var(--theme-text-muted, #6c757d);
    font-size: 0.72rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.12s ease;
    user-select: none;
    pointer-events: none; /* parent cell handles drop events */
}

/* Ensure canvas scrolls during drag */
.canvas-scroll {
    scroll-behavior: smooth;
}
