/* Pipeline visual designer — prototype board */

.pipeline-designer-shell {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 3.5rem);
    min-height: 520px;
    background: #f0f2f8;
}

.pipeline-designer-header {
    flex-shrink: 0;
    padding: 0.75rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
}

.pipeline-designer-shell--header-collapsed .pipeline-designer-header {
    padding: 0.45rem 1.25rem;
}

.pipeline-designer-header-toggle {
    flex-shrink: 0;
    min-width: 2.25rem;
    line-height: 1;
}

.pipeline-designer-details {
    flex-shrink: 0;
    background: #f0f2f8;
}

.pipeline-designer-body {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

.pipeline-designer-toolbar {
    flex-shrink: 0;
    width: 72px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0;
    gap: 0.4rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    touch-action: none;
    overflow-y: auto;
    overflow-x: hidden;
}

.pd-tool {
    width: 52px;
    min-height: 52px;
    padding: 0.4rem 0.2rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #e8ecf4;
    font-size: 0.6rem;
    text-align: center;
    user-select: none;
    transition: background 0.15s, transform 0.1s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
}

.pd-tool--palette {
    cursor: grab;
    touch-action: none;
}

.pd-tool--palette:hover {
    background: rgba(255, 255, 255, 0.14);
}

.pd-tool--palette:active {
    cursor: grabbing;
    transform: scale(0.96);
}

.pd-tool--action {
    cursor: pointer;
    touch-action: manipulation;
    border: none;
}

.pd-tool--action:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.pd-tool--action:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.pd-tool--run {
    border-color: rgba(46, 204, 113, 0.55);
}

.pd-tool--danger {
    border-color: rgba(231, 76, 60, 0.55);
}

.pd-tool--danger:hover:not(:disabled) {
    background: rgba(231, 76, 60, 0.25);
}

.pd-tool-icon {
    font-size: 1.35rem;
    line-height: 1.1;
    display: block;
}

.pd-tool-label {
    font-size: 0.55rem;
    line-height: 1.1;
    opacity: 0.85;
}

.pd-tool--worker {
    border-color: rgba(30, 158, 87, 0.55);
}

.pd-tool--orchestrator {
    border-color: rgba(214, 137, 16, 0.55);
}

.pd-tool--decision-maker {
    border-color: rgba(214, 137, 16, 0.55);
}

.pd-tool--coordinator {
    border-color: rgba(36, 113, 163, 0.55);
}

.pd-toolbar-divider {
    width: 40px;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0.25rem 0;
}

.pipeline-designer-board-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.pipeline-designer-board {
    position: absolute;
    inset: 0;
    overflow: auto;
    background-color: #e8ecf4;
    background-image: radial-gradient(circle, #b8c0d0 1px, transparent 1px);
    background-size: 24px 24px;
    background-position: 0 0;
    touch-action: pan-x pan-y;
}

.pipeline-designer-board-inner {
    position: relative;
    min-width: 2000px;
    min-height: 1400px;
}

.pipeline-designer-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.pd-node {
    position: absolute;
    width: 200px;
    min-height: 96px;
    padding: 0;
    border-radius: 10px;
    border: 2px solid;
    background: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    cursor: default;
    user-select: none;
    z-index: 2;
    transition: box-shadow 0.15s;
    touch-action: none;
}

.pd-node-body {
    padding: 0.65rem 0.75rem;
    padding-top: 1.65rem;
    cursor: grab;
    touch-action: none;
}

.pd-node-body:active {
    cursor: grabbing;
}

.pd-node.pd-node--dragging .pd-node-body {
    cursor: grabbing;
}

.pd-node:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}

.pd-node.pd-node--dragging {
    z-index: 10;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.pd-node--worker {
    border-color: #1e9e57;
    background: linear-gradient(145deg, #e4f6eb 0%, #f7fcf9 100%);
}

.pd-node--orchestrator {
    border-color: #d68910;
    background: linear-gradient(145deg, #fef3d8 0%, #fffaf0 100%);
    width: 224px;
    min-height: 96px;
}

.pd-node--orchestrator.pd-node--decision-maker {
    border-color: #d68910;
    background: linear-gradient(145deg, #fef3d8 0%, #fffaf0 100%);
}

.pd-node--orchestrator.pd-node--coordinator {
    border-color: #2471a3;
    background: linear-gradient(145deg, #d9ecfa 0%, #f2f8fc 100%);
}

.pd-node-type {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.75;
}

.pd-node--worker .pd-node-type { color: #146c3a; }
.pd-node--orchestrator .pd-node-type { color: #9a6409; }
.pd-node--orchestrator.pd-node--decision-maker .pd-node-type { color: #9a6409; }
.pd-node--orchestrator.pd-node--coordinator .pd-node-type { color: #1a5276; }

.pd-node-label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.15rem;
    line-height: 1.25;
    word-break: break-word;
}

.pd-node-wsname {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.1;
}

.pd-node-wsid {
    font-size: 0.49rem;
    font-weight: 700;
    line-height: 1.1;
    opacity: 0.9;
}

.pd-node-hint {
    font-size: 0.65rem;
    color: #6c757d;
    margin-top: 0.2rem;
}

.pd-node-delete {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 20px;
    height: 20px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #f8f9fa;
    color: #495057;
    font-size: 0.75rem;
    line-height: 1;
    padding: 0;
    cursor: default;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 3;
}

.pd-node:hover .pd-node-delete {
    opacity: 1;
}

.pd-node-delete:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.pd-node-actions {
    position: absolute;
    top: 6px;
    left: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 3;
}

.pd-node:hover .pd-node-actions {
    opacity: 1;
}

.pd-node-action {
    width: 26px;
    height: 26px;
    border: 1px solid #adb5bd;
    border-radius: 4px;
    background: #ffffff;
    color: #343a40;
    font-size: 0.72rem;
    line-height: 1;
    padding: 0;
    cursor: default;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.pd-node-action--clear:not(:disabled) {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.pd-node-action--clear:not(:disabled):hover {
    background: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.pd-node-action--run:not(:disabled) {
    background: #dbeafe;
    border-color: #6ea8fe;
    color: #0d47a1;
}

.pd-node-action--run:not(:disabled):hover {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.pd-node-action--view.pd-node-action--ready:not(:disabled) {
    background: #e9d5ff;
    border-color: #b197fc;
    color: #5f3dc4;
}

.pd-node-action--view.pd-node-action--ready:not(:disabled):hover {
    background: #7950f2;
    border-color: #7950f2;
    color: #fff;
}

.pd-node-action:disabled {
    background: #e9ecef;
    border-color: #ced4da;
    color: #868e96;
    cursor: default;
    opacity: 0.9;
    box-shadow: none;
}

.pipeline-designer-status {
    flex-shrink: 0;
    padding: 0.35rem 1rem;
    font-size: 0.75rem;
    color: #6c757d;
    background: #fff;
    border-top: 1px solid #dee2e6;
}

.pipeline-designer-status--error {
    color: #842029;
    background: #f8d7da;
    border-top-color: #f5c2c7;
    font-weight: 500;
}

.pd-connection {
    fill: none;
    stroke: #5c6bc0;
    stroke-width: 2;
    stroke-linecap: round;
    opacity: 0.75;
}

.pd-connection-arrow {
    fill: #5c6bc0;
    opacity: 0.75;
}

/* Floating ghost while dragging from toolbar */
.pd-drag-ghost {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0.92;
}

.pd-drag-ghost--worker {
    background: #e4f6eb;
    border: 2px solid #1e9e57;
    color: #146c3a;
}

.pd-drag-ghost--orchestrator {
    background: #fef3d8;
    border: 2px solid #d68910;
    color: #9a6409;
}

.pd-drag-ghost--decision-maker {
    background: #fef3d8;
    border: 2px solid #d68910;
    color: #9a6409;
}

.pd-drag-ghost--coordinator {
    background: #d9ecfa;
    border: 2px solid #2471a3;
    color: #1a5276;
}

body.pd-palette-dragging {
    cursor: grabbing !important;
}

body.pd-palette-dragging * {
    cursor: grabbing !important;
}

body.pd-wait-cursor,
body.pd-wait-cursor * {
    cursor: wait !important;
}

.pd-workspace-picker-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    background: transparent;
}

.pd-workspace-picker-panel {
    pointer-events: auto;
    width: min(420px, 92vw);
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-left: 1px solid #dee2e6;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.12);
    animation: pd-picker-slide-in 0.2s ease-out;
}

.pd-workspace-picker-panel--configure {
    width: min(480px, 94vw);
}

.pd-board-configure {
    min-height: 0;
}

@keyframes pd-picker-slide-in {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.pd-workspace-picker-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}

.pd-workspace-picker-title {
    font-size: 1rem;
    font-weight: 600;
}

.pd-workspace-picker-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pd-workspace-picker-footer {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border-top: 1px solid #dee2e6;
    background: #f8f9fa;
}

.pd-workspace-picker-form {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.pd-workspace-picker-list {
    flex: 1;
    max-height: none;
    overflow-y: auto;
}

.pd-workspace-picker-item {
    cursor: pointer;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.pd-workspace-picker-item:not(.disabled):hover {
    background: #f0f4ff;
}

.pd-workspace-picker-item.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ── Batch copy card ─────────────────────────────────────────────────────── */
.pd-batch-copy-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.45);
}

.pd-batch-copy-card {
    width: min(960px, 96vw);
    max-height: min(90vh, 820px);
    overflow: auto;
    border: none;
    border-radius: 12px;
}

.pd-batch-copy-json {
    padding-right: 4.75rem;
    resize: vertical;
    min-height: 280px;
    background: #0d1117;
    color: #c9d1d9;
}

