.wf-triptych {
    display: flex;
    gap: 0;
    height: calc(100vh - 110px);
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.06);
}

.wf-triptych-col {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.wf-triptych-left {
    flex: 0 0 32%;
    border-right: 1px solid rgba(255,255,255,0.07);
    background: rgba(0,0,0,0.15);
}

.wf-triptych-center {
    flex: 0 0 36%;
    border-right: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.01);
}

.wf-triptych-right {
    flex: 1;
    background: rgba(0,0,0,0.12);
}

.wf-triptych-col-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

/* ── Column scale slider ──────────────────────────────────────────── */
.wf-col-scale-slider {
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
    margin-left: auto;
    width: 72px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255,255,255,0.15);
    outline: none;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.wf-col-scale-slider:hover,
.wf-col-scale-slider:focus-visible {
    opacity: 1;
    background: rgba(255,165,0,0.3);
}
.wf-col-scale-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #ffb347;
    cursor: pointer;
}
.wf-col-scale-slider::-moz-range-thumb {
    width: 11px;
    height: 11px;
    border: none;
    border-radius: 50%;
    background: #ffb347;
    cursor: pointer;
}

/* Column scale: control grid density via CSS custom property.
   Text stays at natural size; only column count (chip/example size) changes.
   --wf-hero-cols: used by thumb-hero rows (e.g. cinematic look). Always 1
   fewer than --wf-left-cols so the slider drives all rows together. */
.wf-triptych-left  { --wf-left-cols: 3; --wf-hero-cols: 2; }
.wf-triptych-right { --wf-right-cols: 3; }

.wf-triptych-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255,165,0,0.18);
    border: 1px solid rgba(255,165,0,0.35);
    color: #ffb347;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.wf-triptych-step-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.45);
    flex: 1;
}

/* Small inline badge that signals whether the column is a selector or results viewer */
.wf-triptych-col-cue {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}
.wf-triptych-col-cue--select {
    background: rgba(255,179,71,0.12);
    border: 1px solid rgba(255,179,71,0.25);
    color: rgba(255,179,71,0.7);
}
.wf-triptych-col-cue--results {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.3);
}

.wf-triptych-col-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;               /* Firefox: always-thin */
    scrollbar-color: transparent transparent; /* Firefox: hidden until hover */
}
.wf-triptych-col-body:hover {
    scrollbar-color: rgba(255,255,255,0.18) transparent;
}

/* Chrome/Safari: hide scrollbar thumb until column is hovered */
.wf-triptych-col-body::-webkit-scrollbar { width: 4px; }
.wf-triptych-col-body::-webkit-scrollbar-track { background: transparent; }
.wf-triptych-col-body::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
    transition: background 0.2s;
}
.wf-triptych-col-body:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); }

/* ══════════════════════════════════════════════════════════════════════════
   TRIPTYCH PRESET SELECTION PANEL — design language
   ──────────────────────────────────────────────────────────────────────────
   Matches the Action Shot left-column pattern: image card + name label below.
   Each card reads as a UI choice, not a browsable gallery thumbnail.
   Rules:
     • 2-column grid — large enough to read the image at a glance
     • Flex-column card: image (square) + text label footer below
     • Label text pulled from data-gallery-display via CSS attr()
     • ::after = persistent label footer on every card
     • ::before = ✓ badge inside top-right corner when selected
     • Gold border + gold label on selected state
     • No hover scale — border brightens instead (scale = zoom, border = choose)
     • Size slider hidden — layout is fixed
   !important on layout props overrides workflow_unified.css flex + JS var. */

.wf-triptych-left .wf-gallery-strip {
    display: grid !important;
    grid-template-columns: repeat(var(--wf-left-cols, 2), 1fr) !important;
    gap: 8px !important;
    align-items: start !important; /* let cards grow to image+label height, don't stretch */
    overflow: visible;
    white-space: normal;
    width: 100%;
}

/* Card: image fills square, label overlaid at bottom with gradient */
.wf-triptych-left .wf-gallery-item {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    min-width: 0;
    padding: 0 !important;
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Image fills card edge-to-edge */
.wf-triptych-left .wf-gallery-item img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 0;
    display: block;
}

/* Label gradient overlay at bottom — reads preset name from data attribute */
.wf-triptych-left .wf-gallery-item::after {
    content: attr(data-gallery-display);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 22px 7px 7px;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255,255,255,0.88);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: capitalize;
    letter-spacing: 0.01em;
    background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.72) 100%);
    pointer-events: none;
    z-index: 2;
}

/* Hover: border brightens */
.wf-triptych-left .wf-gallery-item:hover {
    border-color: rgba(255,255,255,0.3);
    transform: none;
}

/* Selected: gold ring */
.wf-triptych-left .wf-gallery-item.is-selected {
    border-color: var(--accent, #f28b3c);
    box-shadow: 0 0 0 2px var(--accent, #f28b3c);
    overflow: hidden;
}

/* Selected: label warms to gold */
.wf-triptych-left .wf-gallery-item.is-selected::after {
    content: attr(data-gallery-display);
    color: var(--accent, #f28b3c);
    font-weight: 700;
    background: linear-gradient(to bottom, transparent 0%, rgba(30,15,0,0.82) 100%);
}

/* Checkmark badge in top-right corner when selected */
.wf-triptych-left .wf-gallery-item.is-selected::before {
    content: '\2713';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    background: var(--accent, #f28b3c);
    color: #000;
    font-size: 11px;
    font-weight: 800;
    border-radius: 50%;
    line-height: 18px;
    text-align: center;
    z-index: 3;
    box-shadow: 0 1px 4px rgba(0,0,0,0.6);
    pointer-events: none;
}

/* Hide the size slider — 2-column layout is the fixed optimal size */
.wf-triptych-left .wf-gallery-size-control { display: none !important; }

.wf-triptych-left .wf-gallery-toolbar { padding-bottom: 6px; }
.wf-triptych-left .wf-gallery-hint {
    font-size: 10px;
    color: rgba(255,255,255,0.22);
    margin-top: 4px;
}

.wf-triptych-generate {
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin: 0;
    padding: 10px 12px;
    border-radius: 0;
}

.wf-triptych-options {
    margin-top: 0;
    padding: 10px 0 0;
    flex-wrap: wrap;
}

.wf-triptych-examples {
    display: grid;
    grid-template-columns: repeat(var(--wf-right-cols, 3), 1fr);
    gap: 5px;
}

/* ── RIGHT COLUMN — result showcase, not interactive ──────────────────────
   These are output examples, not selectable choices. No hover-zoom so users
   don't confuse them with the clickable presets on the left. */
.wf-triptych-example-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    cursor: default;
}

.wf-triptych-example-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: none;
}

/* No hover-zoom on result examples — they're output references, not choices */
.wf-triptych-example-item:hover img { transform: none; }

/* Optional 'before' corner inset — small thumbnail of the source image
   pinned bottom-left of a result, styled like a little Polaroid sticker
   so the input → output relationship reads at a glance. Opt-in via the
   example's `before` key in the workflow JSON.
   True 1/4 (25%) of the result tile, with no min-width so it scales
   gracefully on dense grids. Border + shadow let it pop off any
   background (especially dark sepia/tintype photos). */
/* NOTE: the parent rule `.wf-triptych-example-item img { width:100%; height:100% }`
   has higher specificity than a single class, so we MUST use a compound selector
   here (img.wf-triptych-example-before) or the inset stretches to cover the
   entire tile. Don't simplify back to `.wf-triptych-example-before`. */
.wf-triptych-example-item img.wf-triptych-example-before {
    position: absolute;
    bottom: 6px;
    left: 6px;
    width: 28%;
    height: auto;          /* override parent's height:100% */
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 2px solid #fff;
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.3);
    z-index: 2;
    pointer-events: none;
    transition: transform 0.2s ease;
    transform: rotate(-3deg);
    transform-origin: bottom left;
}
.wf-triptych-example-item:hover img.wf-triptych-example-before { transform: rotate(-3deg); }

.wf-triptych-example-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 4px 6px;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    text-align: center;
}

.wf-triptych-examples-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 100%;
    min-height: 220px;
    padding: 24px 16px;
    text-align: center;
}

.wf-triptych-empty-icon { font-size: 28px; color: rgba(255,165,0,0.3); line-height: 1; }
.wf-triptych-empty-title { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.5); margin: 0; }
.wf-triptych-empty-hint { font-size: 12px; color: rgba(255,255,255,0.3); margin: 0; line-height: 1.5; max-width: 200px; }

@media (max-width: 900px) {
    .wf-triptych { flex-direction: column; height: auto; }
    .wf-triptych-left, .wf-triptych-center, .wf-triptych-right {
        flex: none; width: 100%; border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }
    .wf-triptych-left { max-height: 280px; }
    .wf-triptych-right { max-height: 340px; border-bottom: none; }
}

/* ── 3-PANEL — options live in left column, stacked vertically ── */
.wf-triptych-options-stacked {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    border: none;
    background: transparent;
    padding: 0;
}
.wf-triptych-options-stacked .wf-toolbar-divider { display: none; }
.wf-triptych-options-stacked .wf-option-group { width: 100%; }
.wf-triptych-options-stacked .wf-radio-grid {
    display: grid;
    grid-template-columns: repeat(var(--wf-left-cols, 3), 1fr);
    gap: 6px;
}
/* Action Shot (and similar): cinematic / universe row — fewer, larger tiles.
   Uses --wf-hero-cols (set by the column scale slider in base.html) so the
   slider keeps working. Default 2; compact gets --wf-left-cols (default 3).
   Both variables are driven by the same applyScale() call so one slider
   controls all row densities proportionally. */
.wf-triptych-options-stacked .wf-option-group--thumb-hero .wf-radio-grid {
    grid-template-columns: repeat(var(--wf-hero-cols, 2), 1fr);
    gap: 10px;
}
.wf-triptych-options-stacked .wf-option-group--thumb-hero .wf-radio-card {
    padding: 8px;
}
.wf-triptych-options-stacked .wf-option-group--thumb-hero .wf-radio-card strong {
    font-size: 13px;
    line-height: 1.25;
}
.wf-triptych-options-stacked .wf-option-group--thumb-hero .wf-radio-card img,
.wf-triptych-options-stacked .wf-option-group--thumb-hero .wf-radio-card .wf-radio-thumb {
    aspect-ratio: 1 / 1;
    min-height: 88px;
}
/* Secondary rows — pose, outfit, body: denser grid, smaller labels.
   Uses --wf-left-cols (driven by slider). */
.wf-triptych-options-stacked .wf-option-group--thumb-compact .wf-radio-grid {
    grid-template-columns: repeat(var(--wf-left-cols, 3), 1fr);
    gap: 5px;
}
.wf-triptych-options-stacked .wf-option-group--thumb-compact .wf-radio-card {
    padding: 4px;
}
.wf-triptych-options-stacked .wf-option-group--thumb-compact .wf-radio-card strong {
    font-size: 10px;
    line-height: 1.2;
}
.wf-triptych-options-stacked .wf-option-group--thumb-compact .wf-radio-card small {
    font-size: 9px;
    line-height: 1.15;
}
.wf-triptych-options-stacked .wf-option-group--thumb-compact .wf-radio-card img,
.wf-triptych-options-stacked .wf-option-group--thumb-compact .wf-radio-card .wf-radio-thumb {
    aspect-ratio: 1 / 1;
    width: 100%;
    object-fit: cover;
    object-position: center;
}
/* Text-only option groups — 2-col pill buttons */
.wf-triptych-options-stacked .wf-option-group:not(:has(.wf-radio-thumb)) .wf-radio-grid {
    grid-template-columns: repeat(2, 1fr);
}
.wf-triptych-options-stacked .wf-radio-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    white-space: normal;
    flex: none;
    padding: 6px;
    text-align: center;
    font-size: 11px;
    line-height: 1.2;
    gap: 4px;
}
.wf-triptych-options-stacked .wf-radio-card img,
.wf-triptych-options-stacked .wf-radio-card .wf-radio-thumb {
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: center;
    border-radius: 4px;
    margin: 0;
    display: block;
}
.wf-triptych-options-stacked .wf-radio-card strong {
    font-size: 12px;
    margin: 0;
}

/* ── 3-PANEL — "Try a sample" starter strip ──
   Sits above the drop zone in the center column. Horizontal scroll on
   small viewports, wraps into a tight grid on wider ones. Tiles render
   square so the variety of sources reads as a uniform palette of
   options rather than a slideshow. */
.wf-starter-strip {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 8px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}

.wf-starter-strip-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.wf-starter-strip-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
}

.wf-starter-strip-hint {
    font-size: 11px;
    line-height: 1.3;
}

.wf-starter-strip-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 6px;
}

.wf-starter-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 0;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 120ms ease, transform 120ms ease;
}

.wf-starter-tile:hover {
    border-color: rgba(255,165,0,0.55);
    transform: translateY(-1px);
}

.wf-starter-tile:focus-visible {
    outline: 2px solid rgba(255,165,0,0.7);
    outline-offset: 2px;
}

.wf-starter-tile.is-active {
    border-color: rgba(255,165,0,0.85);
    box-shadow: 0 0 0 1px rgba(255,165,0,0.35) inset;
}

.wf-starter-tile img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
}

.wf-starter-tile-label {
    display: block;
    padding: 3px 4px 4px;
    font-size: 10px;
    line-height: 1.15;
    color: rgba(255,255,255,0.7);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* On narrow center column, fall back to a single horizontal scroller so
   the tiles never crowd the drop zone vertically. */
@media (max-width: 720px) {
    .wf-starter-strip-tiles {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 4px;
    }
    .wf-starter-tile {
        flex: 0 0 84px;
        scroll-snap-align: start;
    }
}

/* ── Your Bin additions ────────────────────────────────────────────── */
/* Header row: title left, + button right */
.wf-starter-strip-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
/* "+" import button */
.wf-bin-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.5);
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, color .15s, border-color .15s;
}
.wf-bin-plus:hover { background: rgba(242,139,60,.18); border-color: rgba(242,139,60,.5); color: #f28b3c; }

/* Ghost text when user has no uploads yet */
.wf-bin-user-tiles:empty::before {
    content: "Your images appear here";
    display: block;
    font-size: 10px;
    color: rgba(255,255,255,.22);
    padding: 6px 2px;
    pointer-events: none;
}

/* X remove button on user tiles — appears on hover */
.wf-bin-remove-tile {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.7);
    color: rgba(255,255,255,.85);
    font-size: .65rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .15s, background .15s;
    padding: 0;
    z-index: 5;
}
.wf-bin-user-tile:hover .wf-bin-remove-tile { opacity: 1; }
.wf-bin-remove-tile:hover { background: #e53e3e; color: #fff; }

/* "sample" badge on preset sample tiles */
.wf-bin-sample-tile::after {
    content: "sample";
    position: absolute;
    bottom: 20px;
    left: 3px;
    font-size: .5rem;
    font-weight: 700;
    letter-spacing: .04em;
    background: rgba(0,0,0,.55);
    color: rgba(255,255,255,.5);
    border-radius: 3px;
    padding: 1px 3px;
    pointer-events: none;
}

/* ── 3-PANEL — "Or upload your own" divider ──
   Sits between the "Try a sample" tray and the user's drop zone. The
   tray is the first-class option for new users; the drop zone is the
   secondary path. The divider explicitly demotes the upload prompt
   from a column-header directive to an in-flow alternative.
   Only renders when starter_sources is present (otherwise the drop
   zone IS the column and doesn't need a competing heading). */
.wf-upload-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 2px 10px;
    user-select: none;
}

.wf-upload-divider-line {
    flex: 1 1 auto;
    height: 1px;
    background: rgba(255,255,255,0.10);
}

.wf-upload-divider-label {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
}

/* END 3-PANEL LAYOUT */

/* ── Studio panel strip (menu.html) — backup rules; inline template styles are primary ── */
.workspace-grid > script#studio-tools-demos {
    display: none !important;
}
.workspace-grid:not(.is-home):not(.rail-collapsed) > .workspace-rail { grid-column: 1; }
.workspace-grid:not(.is-home):not(.rail-collapsed) > .rail-collapse-strip { grid-column: 2; }
.workspace-grid:not(.is-home):not(.rail-collapsed) > .workspace-shell { grid-column: 3; }
.workspace-grid:not(.is-home).rail-collapsed > .rail-reopen-strip { grid-column: 1; }
.workspace-grid:not(.is-home).rail-collapsed > .workspace-shell { grid-column: 2; }
.rail-collapse-strip,
.rail-reopen-strip {
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    flex: 0 0 22px !important;
    background: rgba(35, 38, 48, 0.92) !important;
    color: rgba(255, 255, 255, 0.55) !important;
}
.rail-collapse-strip:hover,
.rail-reopen-strip:hover {
    background: rgba(242, 139, 60, 0.18) !important;
    color: #f28b3c !important;
}
