.workflow-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.workflow-preview-grid canvas {
    display: block;
    max-width: 100%;
    height: auto;
    margin: auto;
}
.workflow-preview-grid figure {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--site-border, #dbe2ed);
    border-radius: 10px;
}
.workflow-preview-grid figcaption {
    margin-bottom: 8px;
    font-weight: 600;
}
.workflow-media {
    display: block;
    width: 100%;
    max-height: 60vh;
    background: #111;
    border-radius: 8px;
}
.workflow-surface {
    position: relative;
    max-width: 100%;
    margin: 16px auto;
    overflow: hidden;
    touch-action: none;
    line-height: 0;
}
.workflow-surface canvas,
.workflow-surface video {
    display: block;
    width: 100%;
    height: auto;
}
.workflow-crop-box {
    position: absolute;
    border: 2px solid #fff;
    outline: 1px solid #2563eb;
    box-shadow: 0 0 0 9999px #0007;
    cursor: move;
    touch-action: none;
}
.workflow-resize {
    position: absolute;
    right: -8px;
    bottom: -8px;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    background: #2563eb;
    border-radius: 50%;
    cursor: nwse-resize;
    touch-action: none;
}
.workflow-seam {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #2563eb;
    touch-action: none;
    cursor: ew-resize;
}
.workflow-seam::after {
    content: '';
    position: absolute;
    top: 45%;
    left: -12px;
    width: 27px;
    height: 40px;
    background: #2563eb;
    border: 2px solid white;
    border-radius: 7px;
}
.workflow-results {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}
.workflow-result {
    border: 1px solid var(--site-border, #dbe2ed);
    border-radius: 10px;
    padding: 12px;
    min-width: 0;
}
.workflow-result-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}
.workflow-result-summary {
    margin-top: 10px;
    overflow-wrap: anywhere;
}
.workflow-result-summary .tool-status {
    margin-top: 0;
}
.workflow-result video {
    width: 100%;
    max-height: 280px;
    background: #111;
    margin: 8px 0;
}
.workflow-result .tool-actions {
    margin-top: 8px;
}
.workflow-file-list {
    max-height: 65vh;
    overflow: auto;
}
.workflow-thumbnails {
    display: flex;
    gap: 8px;
    overflow: auto;
    padding: 8px 0;
}
.workflow-thumbnails img {
    width: 80px;
    height: 65px;
    object-fit: contain;
    border: 1px solid #dbe2ed;
}
.workflow-timeline {
    display: flex;
    gap: 2px;
    height: 54px;
    overflow: hidden;
    border-radius: 6px;
    margin: 10px 0;
    background: #eef2f6;
}
.workflow-timeline img {
    min-width: 0;
    flex: 1;
    object-fit: cover;
}
.workflow-range {
    width: 100%;
    accent-color: #2563eb;
    min-height: 32px;
}
.workflow-caption {
    font-size: 14px;
    line-height: 1.6;
    color: var(--site-muted, #64748b);
}
.workflow-selected {
    background: var(--site-bg-soft, #eff6ff);
}
details.workflow-settings {
    margin-top: 16px;
}
details.workflow-settings > summary {
    cursor: pointer;
    font-weight: 600;
    min-height: 40px;
    display: flex;
    align-items: center;
}
details.workflow-settings[open] > summary {
    margin-bottom: 12px;
}
.workflow-paper {
    display: block;
    width: 100%;
    max-height: 65vh;
    object-fit: contain;
    background: #e2e8f0;
    border-radius: 8px;
}
.workflow-preview-grid [hidden],
.workflow-results [hidden] {
    display: none;
}
@media (max-width: 650px) {
    .workflow-preview-grid {
        grid-template-columns: 1fr;
    }
    .workflow-result .tool-actions > * {
        flex: 1;
    }
    .workflow-surface {
        margin: 12px auto;
    }
}

.workflow-crop-preview {
    display: block;
    max-width: 100%;
    max-height: 240px;
    width: auto;
    height: auto;
    margin: 12px auto;
    border-radius: 8px;
    background: #e2e8f0;
}

details.workflow-settings > summary {
    width: fit-content;
    gap: 12px;
    padding: 0 12px;
    border: 1px solid var(--site-border, #dbe2ed);
    border-radius: 7px;
}
details.workflow-settings > summary::after {
    content: '';
    width: 7px;
    height: 7px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
details.workflow-settings[open] > summary::after {
    transform: rotate(225deg);
}
#pp-list .workflow-result {
    display: flex;
    align-items: center;
    gap: 8px;
}
#pp-list .workflow-result button:first-child {
    flex: 1;
    min-width: 0;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}
