﻿:root {
    --bg: #111318;
    --panel: rgba(25, 28, 34, 0.94);
    --panel-strong: rgba(30, 34, 42, 0.98);
    --panel-border: rgba(255, 255, 255, 0.08);
    --ink: #edf1f7;
    --muted: #98a2b3;
    --accent: #f28b3c;
    --accent-dark: #d66f22;
    --accent-soft: rgba(242, 139, 60, 0.16);
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
    --shadow-hover: 0 22px 52px rgba(0, 0, 0, 0.36);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(242, 139, 60, 0.08), transparent 22%),
        radial-gradient(circle at top right, rgba(77, 114, 255, 0.08), transparent 20%),
        linear-gradient(180deg, #111318 0%, #0b0d11 100%);
}

.page-shell {
    max-width: none;
    width: calc(100vw - 12px);
    margin: 0 auto;
    padding: 0 6px 14px;
}

.page-shell.shell-mode {
    max-width: none;
    width: calc(100vw - 12px);
    padding: 8px 6px 8px;
    /* Pin the shell to the viewport — no body scroll in workspace mode.
       Brandbar + carousel stay at the top; only panel body scrolls internally. */
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.hero {
    padding: 16px 0 12px;
}

.hero.compact {
    padding-top: 6px;
    padding-bottom: 8px;
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 700;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.02;
    margin-bottom: 8px;
}

h2 {
    font-size: 1.35rem;
    margin-bottom: 14px;
}

.lede,
.muted {
    color: var(--muted);
}

.card-grid,
.two-column {
    display: grid;
    gap: 22px;
}

.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.two-column {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.demo-card,
.panel,
.thumb-card {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.demo-card {
    display: block;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 180ms ease;
}

.demo-card:hover {
    box-shadow: var(--shadow-hover);
}

/* Carousel brand block above the strip */
.shell-carousel-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.carousel-brand-logo {
    height: 56px;
    width: auto;
    object-fit: contain;
}

.shell-carousel-instruction {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    text-align: center;
    margin: 0;
    opacity: 0.85;
}

/* Carousel card — position relative for future badges */
.demo-card.compact {
    position: relative;
}

/* Coming Soon cards */
.demo-card--coming-soon {
    opacity: 0.55;
    cursor: default;
    filter: saturate(0.3);
    pointer-events: none;
}

.demo-card--coming-soon .demo-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 80px;
    background: repeating-linear-gradient(
        135deg,
        rgba(255,255,255,0.02) 0px,
        rgba(255,255,255,0.02) 4px,
        transparent 4px,
        transparent 12px
    );
}

.cs-output-badge {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    padding: 2px 6px;
}

.cs-tagline {
    font-size: 0.6rem;
    color: var(--muted);
    margin: 1px 0 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cs-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.55rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.1);
    color: var(--muted);
    border-radius: 4px;
    padding: 2px 5px;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.12);
}

.demo-card img:not(.matte-overlay) {
    width: 100%;
    object-fit: cover;
    display: block;
    background: linear-gradient(180deg, rgba(10, 12, 16, 0.55), rgba(18, 22, 29, 0.9));
}

.demo-card.compact {
    min-width: 0;
    max-width: none;
    border-radius: 20px;
    background: rgba(62, 68, 82, 0.98);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255,255,255,0.07) inset;
    display: flex;
    flex-direction: column;
    overflow: visible;
}
.demo-card.compact > img,
.demo-card.compact > video,
.demo-card.compact > .matte-card,
.demo-card.compact > .ba-slider,
.demo-card.compact > .demo-card-placeholder {
    border-radius: 20px 20px 0 0;
    overflow: hidden;
}

/* All card visuals share the native PNG aspect ratio (497 × 301) */
.demo-card.compact img:not(.matte-overlay),
.demo-card.compact .demo-card-placeholder,
.demo-card.compact .ba-slider,
.demo-card.compact .matte-card {
    aspect-ratio: 497 / 301;
    width: 100%;
}

/* V3 thumbnails: all 484px tall — let image drive width; card never collapses */
.demo-card.compact.card--v3-thumb {
    width: auto;
    min-width: 160px;
}
.demo-card.compact.card--v3-thumb img:not(.matte-overlay),
.demo-card.compact.card--v3-thumb .demo-card-placeholder,
.demo-card.compact.card--v3-thumb .ba-slider,
.demo-card.compact.card--v3-thumb .matte-card {
    height: 128px;
    width: auto;
    object-fit: unset;
    aspect-ratio: unset;
}

/* Standalone video thumbnail (NOT inside a slider) — direct child only */
.demo-card.compact > video,
.demo-card-video {
    display: block;
    width: 100%;
    aspect-ratio: 497 / 301;
    object-fit: cover;
}

/* V3 videos: fill card width, fixed height — card min-width prevents collapse before load */
.demo-card.compact.card--v3-thumb > video,
.demo-card.compact.card--v3-thumb .demo-card-video {
    height: 128px;
    width: 100%;
    object-fit: cover;
    aspect-ratio: unset;
}

/* V3 cards: title + badge in footer, standard layout */
.demo-card.compact.card--v3-thumb .card-copy {
    padding: 6px 8px 7px;
}

/* Videos inside the BA slider are absolutely positioned — don't constrain them here */
.ba-slider video {
    height: 100%;
    min-height: 0;
    max-height: none;
}


/* ── Matte composite card ────────────────────────────────────────────── */
/* PNG overlay (with alpha cutout on right) sits on top of a positioned video.
   The video is sized/placed to match the transparent window in the PNG.
   PNG native: 497 × 301.  Cutout box: x 256, y 28, w 225, h 200.  */
.matte-card {
    position: relative;
    overflow: hidden;
    background: #000;
    display: block;
}

/* Both layers must fill the card exactly — no aspect-ratio, no contain */
.matte-overlay {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

/* Video sits underneath, positioned to align with the PNG's transparent cutout.
   Percentages derived from the PNG's native pixel measurements (256,28,225,200
   in a 497×301 image), then expanded ~8% to fill the visible cutout window. */
.matte-video {
    position: absolute;
    left: 49.5%;
    top:  5.3%;
    width: 49%;
    height: 74%;
    object-fit: cover;
    z-index: 1;
    background: #000;
}

/* ── Before / After slider ────────────────────────────────────────────── */
.ba-slider {
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    display: block;
    width: 100%;
    height: 132px;
}


/* Both layers sit at the same absolute position and size.
   Clipping is done via clip-path on the wrapper — no layout width tricks. */
.ba-after,
.ba-before-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.ba-after {
    object-fit: cover;
    object-position: center center;
    background: #000;
    max-width: none;
    z-index: 0;
}

/* Videos often have non-matching aspect ratios — contain so nothing is cut off */
video.ba-after,
video.ba-before {
    object-fit: contain;
}

.ba-before-wrap {
    /* JS sets clip-path: inset(0 X% 0 0) to reveal the before layer */
    clip-path: inset(0 50% 0 0);   /* default: 50/50 split */
    z-index: 1;
    overflow: hidden;              /* belt-and-suspenders — nothing leaks past the clip */
}

.ba-before {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    background: #000;
    max-width: none;
    pointer-events: none;
}

.ba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;           /* wider hit area — centred on the 3px line */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    pointer-events: all;   /* handle is clickable/draggable */
    cursor: col-resize;
    z-index: 2;
}

.ba-handle::before {       /* the visible 3px white line */
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    transform: translateX(-50%);
    background: #fff;
    box-shadow: 0 0 6px rgba(0,0,0,0.5);
    pointer-events: none;
}

.ba-knob {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #fff;
    color: #333;
    border-radius: 50%;
    font-size: 13px;
    letter-spacing: -1px;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    pointer-events: none;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.demo-card.compact .card-copy {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 12px 10px;
}

.demo-card.compact h2 {
    font-size: 0.95rem;
    line-height: 1.18;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.demo-card.is-active {
    border-color: rgba(242, 139, 60, 0.5);
    box-shadow:
        0 16px 30px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(242, 139, 60, 0.14),
        inset 0 0 0 1px rgba(242, 139, 60, 0.12);
    transform: translateY(-2px);
}

.demo-card-placeholder {
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(242, 139, 60, 0.18), rgba(72, 80, 98, 0.7)),
        radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 50%);
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
}

.card-copy,
.panel {
    padding: 20px;
}

/* ── Step-flow state indicators ─────────────────────────── */
@keyframes step-blink {
    0%, 49% {
        border-color: rgba(56, 189, 116, 0.9);
        box-shadow: var(--shadow), 0 0 0 3px rgba(56, 189, 116, 0.4);
    }
    50%, 100% {
        border-color: rgba(56, 189, 116, 0.08);
        box-shadow: var(--shadow);
    }
}

.section-next {
    animation: step-blink 0.9s step-start infinite;
    transition: none;
}

.section-complete {
    border-color: rgba(56, 189, 116, 0.85) !important;
    box-shadow: var(--shadow), 0 0 0 2px rgba(56, 189, 116, 0.22);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    animation: none;
}

.shell-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
    margin-bottom: 6px;
    padding: 10px 12px 10px;
    background:
        linear-gradient(180deg, rgba(24, 27, 33, 0.98), rgba(17, 20, 25, 0.98)),
        linear-gradient(135deg, rgba(242, 139, 60, 0.08), transparent 26%);
    box-shadow:
        0 12px 34px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.shell-brandbar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 16px;
    min-height: 56px;
}

/* Nav stretches to fill space — user cluster pushed right */
.shell-brandbar > .demo-effect-nav {
    flex: 1;
    min-width: 0;
}

.shell-brandbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* Bottom-align carousel with copy so the row height (from the left blurb)
   does not leave a dead band above the workspace iframe. */
.shell-mainrow {
    display: grid;
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
    align-items: end;
    gap: 12px;
}

.shell-copy {
    padding-top: 0;
    padding-bottom: 2px;
}

.shell-copy .eyebrow {
    margin-bottom: 2px;
    font-size: 0.72rem;
}

.shell-copy h1 {
    font-size: clamp(1.15rem, 1.6vw, 1.65rem);
    margin-bottom: 2px;
    line-height: 1.15;
}

.shell-copy .lede {
    margin-bottom: 0;
    font-size: 0.84rem;
    line-height: 1.35;
    max-width: 36ch;
}

/* == Workflow carousel ================================================= */
.shell-demo-carousel {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    padding: 6px 12px 10px;
}

.shell-demo-strip {
    display: flex;
    flex-direction: row;
    gap: 14px;
    min-width: max-content;
    padding-top: 18px;
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.shell-demo-strip .demo-card.compact {
    flex: 0 0 auto;
    width: 170px;
}

.shell-carousel-btn {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    border: none;
    border-radius: 0;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    transition: background 180ms, color 180ms, width 180ms;
    padding: 0;
    box-shadow: none;
    opacity: 1;
}
.shell-carousel-btn svg { width: 22px; height: 22px; display: block; stroke-width: 2.8; }
.shell-carousel-btn:hover:not([disabled]) {
    background: rgba(255,255,255,0.15);
    color: #fff;
    width: 52px;
}
.shell-carousel-btn[disabled] { opacity: 0; pointer-events: none; }
.shell-carousel-btn--prev { left: 0; border-radius: 12px 0 0 12px; }
.shell-carousel-btn--next { right: 0; border-radius: 0 12px 12px 0; }
.carousel-more-badge {
    position: absolute;
    top: 8px;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    background: #f28b3c;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 24px;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.shell-carousel-btn--prev .carousel-more-badge {
    left: 50%;
    transform: translateX(-50%);
}
.shell-carousel-btn--next .carousel-more-badge {
    right: 50%;
    transform: translateX(50%);
}

.shell-carousel-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 0;
}
.shell-carousel-footer:empty { display: none; }

.shell-carousel-dots { display: flex; gap: 5px; align-items: center; }
.shell-carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: background 200ms, transform 200ms;
    cursor: pointer;
}
.shell-carousel-dot.is-active {
    background: #f28b3c;
    transform: scale(1.3);
}

.shell-carousel-label {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.38);
    letter-spacing: 0.06em;
    line-height: 1;
}

/* ── Studio menu (shell-mode): reclaim vertical space for the iframe ─ */
.page-shell.shell-mode {
    padding: 6px 6px 10px;
}

.page-shell.shell-mode .shell-header {
    top: 4px;
    gap: 4px;
    margin-bottom: 4px;
    padding: 6px 10px 6px;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.page-shell.shell-mode .shell-brandbar {
    display: flex;
    align-items: center;
    position: relative;
    gap: 6px 12px;
    justify-content: center;
}
.page-shell.shell-mode .topbar-brand-center {
    order: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
    z-index: 2;
}
.page-shell.shell-mode .topbar-brand-tagline {
    display: none;
}
.page-shell.shell-mode .demo-site-brand-logo {
    height: 80px;
}
.page-shell.shell-mode .demo-effect-nav {
    order: 1;
}

.page-shell.shell-mode .demo-effect-nav {
    flex-wrap: wrap;
    gap: 4px 10px;
}

.page-shell.shell-mode .shell-active-demo {
    margin-left: auto;
    min-width: 0;
}

.page-shell.shell-mode .shell-mainrow {
    grid-template-columns: 1fr;
    gap: 4px;
    align-items: start;
}

.page-shell.shell-mode .shell-copy {
    display: none;
}

.page-shell.shell-mode .shell-demo-carousel {
    gap: 0;
    height: 250px;
    flex-shrink: 0;
    overflow: hidden;
}

.page-shell.shell-mode [data-demo-clip] {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.page-shell.shell-mode .shell-demo-strip {
    gap: 12px;
}

.page-shell.shell-mode .shell-demo-strip .demo-card.compact {
    width: 158px;
}

/* Shell-mode cards inherit the same aspect-ratio; width controls sizing */
.page-shell.shell-mode .demo-card.compact img:not(.matte-overlay),
.page-shell.shell-mode .demo-card.compact .demo-card-placeholder,
.page-shell.shell-mode .demo-card.compact .ba-slider,
.page-shell.shell-mode .demo-card.compact .matte-card {
    aspect-ratio: 497 / 301;
    width: 100%;
}

.page-shell.shell-mode .demo-card.compact.card--v3-thumb {
    width: auto;
    min-width: 150px;
}
.page-shell.shell-mode .demo-card.compact.card--v3-thumb img:not(.matte-overlay),
.page-shell.shell-mode .demo-card.compact.card--v3-thumb .demo-card-placeholder,
.page-shell.shell-mode .demo-card.compact.card--v3-thumb .matte-card {
    height: 120px;
    width: auto;
    object-fit: unset;
    aspect-ratio: unset;
}

.page-shell.shell-mode .demo-card.compact > video,
.page-shell.shell-mode .demo-card.compact .demo-card-video {
    aspect-ratio: 497 / 301;
    width: 100%;
}

.page-shell.shell-mode .demo-card.compact.card--v3-thumb > video,
.page-shell.shell-mode .demo-card.compact.card--v3-thumb .demo-card-video {
    height: 120px;
    width: 100%;
    object-fit: cover;
    aspect-ratio: unset;
}

.page-shell.shell-mode .demo-card.compact .card-copy {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 4px 7px 5px;
}

.page-shell.shell-mode .demo-card.compact h2 {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.page-shell.shell-mode .shell-carousel-btn {
    top: 0;
}

.page-shell.shell-mode .shell-carousel-footer {
    display: none;
}

.page-shell.shell-mode .demo-card.is-active {
    transform: none;
}

.page-shell.shell-mode .shell-brandbar,
.page-shell.shell-mode .shell-mainrow {
    flex-shrink: 0;
}

.page-shell.shell-mode .workspace-grid {
    gap: 6px;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.page-shell.shell-mode .workspace-shell.panel {
    padding: 4px 6px;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.page-shell.shell-mode .workspace-rail {
    padding: 8px 8px;
    max-height: none;
    height: 100%;
    box-sizing: border-box;
}

.page-shell.shell-mode .demo-frame {
    flex: 1;
    min-height: 0;
    max-height: none;
}

.shell-active-demo {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 170px;
}

.shell-active-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    font-weight: 700;
}

.shell-active-demo strong {
    font-size: 0.96rem;
    line-height: 1.2;
}

/* ── Active renders bar ─────────────────────────────────────────── */

.shell-active-renders {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 6px 0 0;
    margin-top: 4px;
}

.active-renders-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.active-renders-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent, #f28b3c);
    font-weight: 700;
    white-space: nowrap;
    opacity: 0.8;
}

.active-renders-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.active-render-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 8px;
    border-radius: 20px;
    background: rgba(242, 139, 60, 0.12);
    border: 1px solid rgba(242, 139, 60, 0.3);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.active-render-chip:hover {
    background: rgba(242, 139, 60, 0.22);
    border-color: rgba(242, 139, 60, 0.55);
}

.active-render-chip-label {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-render-kill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s ease, color 0.12s ease;
}

.active-render-kill:hover {
    background: rgba(255, 80, 80, 0.25);
    color: #ff6b6b;
}

.active-render-spinner {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(242, 139, 60, 0.3);
    border-top-color: var(--accent, #f28b3c);
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* ── Workspace shell ─────────────────────────────────────────────── */

.workspace-shell {
    padding: 4px 8px 10px;
    background:
        linear-gradient(180deg, rgba(18, 21, 26, 0.98), rgba(12, 14, 18, 0.98)),
        radial-gradient(circle at top left, rgba(242, 139, 60, 0.06), transparent 26%);
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.workspace-rail {
    padding: 10px 10px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    align-self: stretch;
    max-height: calc(100vh - 126px);
    overflow: hidden;
}
/* Needed because display:grid overrides the [hidden] attribute's display:none */
.workspace-rail[hidden] { display: none !important; }

/* Tab strip */
.workspace-rail-tabs {
    display: flex;
    gap: 2px;
    padding: 0 2px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 6px;
    flex-shrink: 0;
}
.workspace-rail-tab {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 5px 4px;
    text-transform: uppercase;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.workspace-rail-tab:hover { color: rgba(255,255,255,0.78); background: rgba(255,255,255,0.06); }
.workspace-rail-tab.is-active { color: #fff; background: rgba(255,255,255,0.12); }
.workspace-rail-tab small {
    background: rgba(255,255,255,0.18);
    border-radius: 99px;
    font-size: 0.68rem;
    line-height: 1;
    min-width: 16px;
    padding: 2px 4px;
    text-align: center;
}
.workspace-rail-tab.is-active small { background: rgba(255,255,255,0.3); }

/* Panels */
.workspace-rail-panel {
    display: none;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}
.workspace-rail-panel.is-active {
    display: flex;
}

.workspace-rail-body {
    overflow: auto;
    padding-right: 4px;
    display: block;
    flex: 1;
    min-height: 0;
}
.workspace-rail-body-history {
    overflow-y: auto;
}

/* Render cards in renders rail mirror asset cards */
.workspace-rail-panel [data-renders-rail] .history-asset {
    cursor: grab;
}
.shell-render-card {
    position: relative;
}
.shell-render-dismiss {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.65);
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 0;
}
.shell-render-card:hover .shell-render-dismiss {
    opacity: 1;
}
.shell-render-dismiss:hover {
    background: rgba(200,40,40,0.8);
    color: #fff;
}

/* ── Rail importer (left asset panel) ─────────────────────────── */
.rail-importer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 12px;
    border-radius: 12px;
    border: 2px dashed rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.18s ease, background 0.18s ease;
    outline: none;
    user-select: none;
    min-height: 90px;
}
.rail-importer:hover,
.rail-importer:focus {
    border-color: rgba(242, 139, 60, 0.5);
    background: rgba(242, 139, 60, 0.05);
}
.rail-importer.is-drop-target {
    border-color: rgba(242, 139, 60, 0.8);
    background: rgba(242, 139, 60, 0.1);
}
.rail-importer.is-loading {
    opacity: 0.7;
    pointer-events: none;
}
.rail-importer-icon {
    font-size: 1.6rem;
    font-weight: 300;
    line-height: 1;
    color: rgba(255, 255, 255, 0.45);
}
.rail-importer:hover .rail-importer-icon,
.rail-importer:focus .rail-importer-icon {
    color: rgba(242, 139, 60, 0.8);
}
.rail-importer-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    margin: 0;
}
.rail-importer-hint {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    margin: 0;
    letter-spacing: 0.02em;
}
.rail-importer-status {
    font-size: 0.72rem;
    color: rgba(242, 139, 60, 0.9);
    min-height: 1em;
    margin-top: 2px;
}
.rail-importer-status.is-error {
    color: rgba(255, 100, 100, 0.9);
}

.rail-empty-state {
    padding: 10px 4px;
    font-size: 0.78rem;
    line-height: 1.5;
}
.rail-empty-state p { margin: 0 0 4px; }

.compact-head {
    margin-bottom: 2px;
}

.workspace-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 2px;
    padding: 0 0 4px;
}

.workspace-head h2 {
    margin-bottom: 0;
    font-size: 1.05rem;
}

.demo-frame {
    width: 100%;
    min-height: calc(100vh - 156px);
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

#frame-loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 12, 0.55);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    z-index: 10;
    pointer-events: none;
}
#frame-loading-overlay[hidden] { display: none; }

.frame-loader-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: frame-spin 0.7s linear infinite;
}
@keyframes frame-spin { to { transform: rotate(360deg); } }

html.embedded-workspace .page-shell {
    width: 100%;
    padding: 6px 8px 10px;
}

html.embedded-workspace .reference-strip,
html.embedded-workspace .result-history-rail {
    display: none;
}

html.embedded-workspace .result-shell {
    display: block;
}

html.embedded-workspace .back-link {
    display: none;
}

html.embedded-workspace .page-shell > p:first-child {
    display: none;
}

html.embedded-workspace .hero {
    display: none;
}

html.embedded-workspace h1 {
    font-size: clamp(1.15rem, 2vw, 1.9rem);
    margin-bottom: 4px;
}

html.embedded-workspace .eyebrow {
    margin-bottom: 4px;
    font-size: 0.7rem;
}

html.embedded-workspace .lede {
    font-size: 0.88rem;
    line-height: 1.35;
    margin-bottom: 0;
}

html.embedded-workspace .panel,
html.embedded-workspace .card-copy {
    padding: 12px;
}


html.embedded-workspace .form-stack {
    gap: 14px;
}

.instructions p:last-child {
    margin-bottom: 0;
}

.warning {
    color: #8a2f27;
}

.form-stack {
    display: grid;
    gap: 24px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-weight: 600;
}

.quiz-shell {
    display: grid;
    gap: 16px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.quiz-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.choice-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.choice-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--ink);
    cursor: pointer;
}

.choice-chip input {
    accent-color: var(--accent);
}

.effect-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.effect-card {
    position: relative;
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    overflow: hidden;
}

.effect-card input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.effect-card:has(input:checked) {
    border-color: rgba(242, 139, 60, 0.44);
    box-shadow: inset 0 0 0 1px rgba(242, 139, 60, 0.14);
}

.effect-card-media {
    display: block;
    height: 72px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.12), transparent 46%),
        linear-gradient(135deg, rgba(19, 22, 28, 0.96), rgba(11, 13, 17, 0.96));
}

.effect-card-label {
    font-size: 0.9rem;
    font-weight: 700;
}

.effect-electric .effect-card-media {
    background:
        radial-gradient(circle at 50% 45%, rgba(108, 198, 255, 0.7), transparent 24%),
        linear-gradient(120deg, transparent 34%, rgba(108, 198, 255, 0.9) 46%, transparent 58%),
        linear-gradient(135deg, #121822, #091018);
}

.effect-fire .effect-card-media {
    background:
        radial-gradient(circle at 38% 64%, rgba(255, 194, 77, 0.92), transparent 26%),
        linear-gradient(140deg, rgba(255, 94, 0, 0.84), rgba(93, 16, 0, 0.95));
}

.effect-water .effect-card-media {
    background:
        radial-gradient(circle at 34% 34%, rgba(163, 238, 255, 0.58), transparent 22%),
        linear-gradient(160deg, rgba(0, 143, 214, 0.9), rgba(5, 38, 87, 0.95));
}

.effect-frost .effect-card-media {
    background:
        linear-gradient(135deg, rgba(233, 245, 255, 0.92), rgba(113, 183, 255, 0.35)),
        linear-gradient(160deg, rgba(15, 35, 61, 0.94), rgba(8, 15, 25, 0.98));
}

.effect-heat .effect-card-media {
    background:
        radial-gradient(circle at 62% 40%, rgba(255, 155, 54, 0.75), transparent 22%),
        linear-gradient(145deg, rgba(255, 140, 0, 0.85), rgba(92, 23, 0, 0.96));
}

.effect-plasma .effect-card-media {
    background:
        radial-gradient(circle at 40% 48%, rgba(255, 105, 255, 0.72), transparent 20%),
        linear-gradient(135deg, rgba(135, 45, 255, 0.92), rgba(11, 17, 45, 0.97));
}

.effect-wireframe .effect-card-media {
    background:
        linear-gradient(90deg, rgba(76, 226, 255, 0.45) 1px, transparent 1px),
        linear-gradient(rgba(76, 226, 255, 0.45) 1px, transparent 1px),
        linear-gradient(135deg, rgba(13, 27, 37, 0.96), rgba(8, 11, 18, 0.98));
    background-size: 14px 14px, 14px 14px, auto;
}

.effect-neon .effect-card-media {
    background:
        radial-gradient(circle at 30% 50%, rgba(255, 0, 180, 0.74), transparent 18%),
        linear-gradient(120deg, rgba(0, 255, 238, 0.82), rgba(142, 0, 255, 0.9));
}

.effect-xray .effect-card-media {
    background:
        radial-gradient(circle at 58% 50%, rgba(181, 255, 245, 0.65), transparent 20%),
        linear-gradient(150deg, rgba(26, 70, 91, 0.94), rgba(7, 16, 22, 0.98));
}

input[type="text"],
input[type="file"],
select,
textarea {
    width: 100%;
    font: inherit;
}

input[type="text"],
select,
textarea {
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(17, 20, 25, 0.92);
    color: var(--ink);
}

textarea {
    resize: vertical;
}

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.thumb-grid.is-disabled {
    opacity: 0.46;
    pointer-events: none;
}

.thumb-card {
    position: relative;
    display: block;
    padding: 10px;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.thumb-card input[type="radio"],
.thumb-card input[type="checkbox"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    margin: 0;
    z-index: 1;
}

.thumb-card:hover {
    border-color: rgba(242, 139, 60, 0.28);
}

.thumb-card:has(input:checked) {
    border-color: rgba(242, 139, 60, 0.5);
    box-shadow: var(--shadow), 0 0 0 1px rgba(242, 139, 60, 0.18);
    background: rgba(242, 139, 60, 0.06);
}

.thumb-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
    pointer-events: none;
}

.thumb-title {
    margin: 8px 0;
    font-size: 0.95rem;
}

.paste-box {
    border: 2px dashed rgba(72, 200, 230, 0.28);
    border-radius: 18px;
    background: rgba(72, 200, 230, 0.04);
    padding: 18px;
    min-height: 150px;
    transition: border-color 0.18s, background 0.18s;
}
.paste-box.is-drop-target,
.paste-box:focus-within {
    border-color: rgba(72, 199, 102, 0.7);
    background: rgba(72, 199, 102, 0.06);
}

/* Icon zone: fills available vertical space between controls and canvas */
.drop-icon-hint {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1 1 auto;
    min-height: 120px;
    width: 100%;
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.2s;
}

.drop-icon-hint img {
    width: min(200px, 55%);
    height: auto;
    object-fit: contain;
}

[data-image-panel]:hover .drop-icon-hint,
[data-image-panel].is-drop-target .drop-icon-hint {
    opacity: 0.55;
}

[data-image-panel].has-preview .drop-icon-hint {
    display: none;
}

/* Make the panel itself a flex column so icon naturally fills the gap */
.paste-box[data-image-panel]:not(.has-preview) {
    display: flex;
    flex-direction: column;
}

/* demo1 custom zone */
.d1-image-zone:not(.has-preview) {
    display: flex;
    flex-direction: column;
}

.d1-image-zone .drop-icon-hint {
    flex: 1 1 auto;
    min-height: 100px;
}

.dropzone-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.dropzone-copy {
    display: grid;
    gap: 10px;
    align-content: start;
}

.dropzone-art {
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid rgba(103, 149, 255, 0.35);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 0 0 3px rgba(103, 149, 255, 0.18);
    min-height: 180px;
}

.dropzone-art img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
}

.image-panel.has-preview .dropzone-art {
    display: none;
}

.image-panel:focus {
    outline: none;
    border-color: rgba(242, 139, 60, 0.75);
    box-shadow: 0 0 0 4px rgba(242, 139, 60, 0.14);
}

.canvas-wrap {
    position: relative;
    display: inline-block;
    margin-top: 14px;
}

.preview-image {
    display: none;
    max-width: min(100%, 480px);
    max-height: 480px;
    border-radius: 14px;
    border: 1px solid rgba(39, 46, 60, 0.16);
}

.draw-canvas {
    display: none;
    position: absolute;
    inset: 0;
    cursor: crosshair;
}

/* ── Legacy result image (chromafy_review, texturize_review, job_status, etc.) */
.result-image {
    display: block;
    max-width: 100%;
    width: auto;
    max-height: min(62vh, calc(100vh - 260px));
    height: auto;
    object-fit: contain;
    border-radius: 18px;
    border: 1px solid rgba(39, 46, 60, 0.16);
    margin: 0 auto;
}

/* ── Direct-job result page ─────────────────────────────── */
.direct-result-shell {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    background: #0d0f14;
    overflow: hidden;
}

.direct-result-main {
    flex: 1;
    min-height: 0;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    padding: 8px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

/* Two-column grid: result left, sidebar right (desktop only) */
.dr-two-col {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 14px;
    flex: 1;
    min-height: 0;
}
.dr-col-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    overflow-y: auto;
}

/* ── Right sidebar ── */
.dr-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 14px;
    background: #151821;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.07);
    overflow-y: auto;
    align-self: start;
    max-height: 100%;
    position: sticky;
    top: 0;
    margin-top: 8px;
}
.dr-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.dr-sidebar-section:last-child { border-bottom: none; padding-bottom: 0; }
.dr-sidebar-heading {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255,255,255,0.5);
    margin: 0 0 2px;
}

/* Big download button in sidebar */
.dr-sidebar-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(80,200,120,0.4);
    background: rgba(80,200,120,0.1);
    color: #6edda0;
    cursor: pointer;
    transition: background .18s, border-color .18s;
}
.dr-sidebar-download:hover {
    background: rgba(80,200,120,0.2);
    border-color: rgba(80,200,120,0.6);
}
.dr-sidebar-download svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Social row inside sidebar */
.dr-sidebar-share-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.dr-sidebar-share-row .dr-share-btn {
    padding: 5px 8px;
    font-size: 0;
}
.dr-sidebar-share-row .dr-share-btn svg { width: 16px; height: 16px; }
.dr-sidebar-share-row .dr-share-btn span { display: none; }
.dr-sidebar-share-row .dr-share-copy { font-size: 0.72rem; }
.dr-sidebar-share-row .dr-share-copy span { display: inline; }

/* Stats in sidebar */
.dr-sidebar-stats {
    gap: 4px;
}
.dr-sidebar-stats .result-stat-chip {
    font-size: 0.76rem;
    padding: 4px 0;
    background: none;
    border: none;
}

/* Meta in sidebar */
.dr-sidebar-meta .dr-run-id { font-size: 0.68rem; word-break: break-all; }

/* Nav in sidebar */
.dr-sidebar-nav {
    flex-direction: row;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.dr-sidebar-nav .secondary-btn { flex: 1; text-align: center; font-size: 0.78rem; }

/* Chain CTA in sidebar */
.dr-sidebar .dr-chain-cta-btn {
    width: 100%;
    font-size: 0.82rem;
    padding: 8px 10px;
}

/* Compound grid in sidebar */
.dr-sidebar .dr-compound-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.dr-sidebar .dr-compound-btn {
    font-size: 0.72rem;
    padding: 4px 8px;
}

/* ── Mobile: single column ── */
@media (max-width: 768px) {
    .dr-two-col {
        grid-template-columns: 1fr;
    }
    .dr-sidebar {
        position: static;
        border-radius: 12px;
    }
}

/* Hero: fills all remaining vertical space after fixed-height rows below */
.dr-result-hero {
    flex: 0 1 auto;
    min-height: 0;
    /* Tall enough to show the result without scrolling, short enough to fit in
       the workspace iframe alongside the workflow queue below it. */
    max-height: min(62vh, calc(100dvh - 300px));
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0d0f14;
    border-radius: 14px;
    overflow: hidden;
    gap: 8px;
    flex-wrap: wrap;
}

.dr-result-hero--compare {
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    padding: 10px 8px;
}

.dr-compare-figure {
    margin: 0;
    flex: 1 1 min(280px, 100%);
    max-width: min(420px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.dr-compare-caption {
    margin: 0;
    padding: 0 6px;
    text-align: center;
    font-size: 0.78rem;
    line-height: 1.35;
    color: rgba(242, 139, 60, 0.92);
    max-width: 44ch;
}

/* Checkerboard wrapper — shown for transparent PNG results (e.g. backdrop-aifi-it) */
.dr-transparent-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #c8c8c8 25%, transparent 25%),
        linear-gradient(-45deg, #c8c8c8 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #c8c8c8 75%),
        linear-gradient(-45deg, transparent 75%, #c8c8c8 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    border-radius: 16px;
    overflow: hidden;
    max-width: 100%;
    max-height: min(62vh, calc(100dvh - 300px));
    flex: 0 1 auto;
    min-height: 0;
}
.dr-transparent-preview .dr-fit-media {
    border-radius: 0;
    border: none;
    max-height: min(60vh, calc(100dvh - 320px));
    max-width: 100%;
    object-fit: contain;
}

/* The result image/video: fills the hero flex container, scales to fit, never overflows */
.dr-fit-media {
    display: block;
    max-width: 100%;
    max-height: 100%;        /* constrained by flex parent .dr-result-hero */
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
}

/* Action / share bar */
.dr-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #151821;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.dr-action-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 140px;
}

.dr-run-id {
    font-size: 0.72rem;
}

.dr-action-right {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

/* Share group */
.dr-share-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dr-share-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-right: 4px;
}

.dr-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    transition: background .18s, color .18s, border-color .18s;
}

.dr-share-btn:hover {
    background: rgba(255,255,255,0.13);
    color: #fff;
    border-color: rgba(255,255,255,0.25);
}

.dr-share-btn svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.dr-share-download { border-color: rgba(80,200,120,0.35); color: #6edda0; }
.dr-share-download:hover { background: rgba(80,200,120,0.12); }

.dr-share-x       { border-color: rgba(255,255,255,0.18); }
.dr-share-linkedin { border-color: rgba(10,102,194,0.5); color: #5aa9e6; }
.dr-share-linkedin:hover { background: rgba(10,102,194,0.15); }
.dr-share-instagram { border-color: rgba(228,64,95,0.4); color: #f0738a; }
.dr-share-instagram:hover { background: rgba(228,64,95,0.12); }
.dr-share-facebook { border-color: rgba(24,119,242,0.5); color: #6aa0f5; }
.dr-share-facebook:hover { background: rgba(24,119,242,0.12); }

/* Status & error panels */
.dr-status-panel {
    margin: 16px auto;
    width: 100%;
}

/* Two-column processing layout: log left, preview images right */
.dr-processing-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 16px;
}

.dr-processing-left {
    flex: 0 0 260px;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dr-generating-heading {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.dr-loading-card-inline {
    text-align: left;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    flex-direction: row;
    gap: 10px;
    justify-content: flex-start;
    align-items: flex-start;
}

.dr-loading-card-inline .loading-spinner {
    flex-shrink: 0;
    margin-top: 3px;
}

/* Live step thumbnails — right column, grow as images arrive */
.dr-live-thumbs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 4px;
    min-height: 0;
}

.dr-live-thumbs-right {
    flex: 1 1 0;
    margin: 0;
    align-content: flex-start;
    justify-content: flex-start;
}

.dr-live-thumbs:empty {
    display: none;
}

.dr-live-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 120px;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.dr-live-thumb img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: #0d0f14;
    display: block;
}

.dr-live-thumb span {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.45);
    text-align: center;
    line-height: 1.3;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pop-in animation when a new thumb arrives via JS */
.dr-live-thumb-new {
    opacity: 0 !important;
    transform: scale(0.82) !important;
}

/* Narrow screens: stack vertically */
@media (max-width: 540px) {
    .dr-processing-layout { flex-direction: column; }
    .dr-processing-left { flex: none; width: 100%; }
    .dr-live-thumbs-right { justify-content: center; }
}

.dr-error-block {
    text-align: left;
    margin-top: 12px;
}

/* Build detail accordion */
.dr-detail-panel {
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.07);
    background: #151821;
    padding: 0;
}

.dr-detail-panel summary {
    padding: 12px 18px;
    cursor: pointer;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
    user-select: none;
}

.dr-detail-panel[open] summary {
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 12px;
}

.dr-detail-panel > *:not(summary) {
    padding: 0 18px 16px;
}

.reference-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 22px;
}

.prepared-frame-strip,
.current-swap-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.current-swap-strip-review {
    grid-template-columns: repeat(2, minmax(0, 240px));
    justify-content: start;
}

.chromafy-prepared-strip {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.compact-panel {
    flex: 0 1 220px;
    padding: 16px;
}

.compact-panel h2 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.reference-image {
    display: block;
    width: 100%;
    max-width: 180px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Larger build-step tiles inside the direct job status detail panel */
.dr-detail-panel .reference-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.dr-detail-panel .compact-panel {
    flex: none;
    width: 100%;
}

.dr-detail-panel .reference-image {
    max-width: 100%;
    width: 100%;
    object-fit: contain;
    max-height: 340px;
    background: #111;
}

.chromafy-frame-card {
    display: grid;
    gap: 10px;
    align-content: start;
}

.prepared-frame-placeholder {
    display: grid;
    place-items: center;
    min-height: 180px;
    border-radius: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted-text);
    text-align: center;
    padding: 16px;
}

.chromafy-review-image {
    max-width: 100%;
    min-height: 180px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.02);
}

.chromafy-warning-card {
    border-color: rgba(242, 139, 60, 0.35);
    background: linear-gradient(180deg, rgba(242, 139, 60, 0.12), rgba(255, 255, 255, 0.03));
}

.current-swap-card {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.current-swap-card .muted {
    margin-bottom: 0;
}

.current-swap-image {
    display: block;
    width: 100%;
    max-width: 200px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    object-fit: contain;
}

.result-image-scaled {
    max-width: 460px;
    max-height: 420px;
    margin-inline: auto;
    object-fit: contain;
}

.two-column-review {
    align-items: start;
}

.result-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.7fr);
    gap: 18px;
    align-items: start;
}

.result-main {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.result-history-rail {
    position: sticky;
    top: 8px;
    display: grid;
    gap: 12px;
    max-height: calc(100vh - 20px);
    overflow: auto;
}

.result-history-head {
    display: grid;
    gap: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.result-history-head h2 {
    margin-bottom: 0;
    font-size: 1.05rem;
}

.history-stack {
    display: grid;
    gap: 10px;
}

.history-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.history-card.is-active {
    box-shadow:
        inset 0 0 0 1px rgba(242, 139, 60, 0.24),
        0 0 0 1px rgba(242, 139, 60, 0.12);
    background: linear-gradient(180deg, rgba(242, 139, 60, 0.08), rgba(255, 255, 255, 0.025));
}

.history-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.history-card-head-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.history-card-summary-thumb {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    flex: 0 0 auto;
}
.history-card-summary-thumb .shelf-play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.85);
    pointer-events: none;
}

.history-card-summary-thumb img,
.history-card-summary-thumb video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-card-toggle {
    list-style: none;
    cursor: pointer;
}

.history-card-toggle::-webkit-details-marker {
    display: none;
}

.history-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-star-btn {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.history-star-btn.is-starred {
    color: #ffcf6d;
    background: rgba(255, 194, 95, 0.14);
}

/* ── History card action buttons ───────────────────────────────── */
.history-card-actions {
    margin-top: .5rem;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ── History chain section ─────────────────────────────────────────── */
.history-chain-section {
    margin: .5rem 0 0;
    padding-top: .5rem;
    border-top: 1px solid rgba(255,255,255,.07);
}
.history-chain-bar {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.history-chain-add-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .3rem .65rem;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 2rem;
    background: rgba(255,255,255,.05);
    color: rgba(255,255,255,.65);
    font-size: .7rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.history-chain-add-btn:hover {
    border-color: var(--accent, #f28b3c);
    color: var(--accent, #f28b3c);
    background: rgba(242,139,60,.08);
}
.history-chain-hint {
    font-size: .68rem;
    color: rgba(255,255,255,.45);
    font-style: italic;
}
.history-chain-picker {
    margin-top: .4rem;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}
.history-chain-picker .chain-history-pick {
    padding: .25rem .55rem;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: .4rem;
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.75);
    font-size: .7rem;
    cursor: pointer;
    transition: border-color .12s, background .12s;
}
.history-chain-picker .chain-history-pick:hover {
    border-color: var(--accent, #f28b3c);
    background: rgba(242,139,60,.08);
    color: var(--accent, #f28b3c);
}

/* Highlight input assets that are sources for next chain step */
.history-asset.cg-node-new-source .history-asset-thumb {
    outline: 2px solid var(--accent, #f28b3c);
    outline-offset: 2px;
    border-radius: 4px;
    animation: cg-pulse 1.6s ease-in-out infinite;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #f28b3c) 22%, transparent);
}

.history-open-tab-btn,
.history-use-setup-btn {
    font-size: .78rem;
    padding: .35rem .75rem;
    border-radius: .45rem;
    cursor: pointer;
}
.history-open-tab-btn {
    background: rgba(242,139,60,.12);
    border-color: rgba(242,139,60,.35);
    color: var(--accent, #f28b3c);
}
.history-open-tab-btn:hover {
    background: rgba(242,139,60,.22);
    border-color: var(--accent, #f28b3c);
}
.history-use-setup-btn {
    background: rgba(255,255,255,.05);
    border-color: rgba(255,255,255,.15);
    color: rgba(255,255,255,.7);
}
.history-use-setup-btn:hover {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.3);
    color: #fff;
}

.history-card-chevron {
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(255, 255, 255, 0.55);
    border-bottom: 2px solid rgba(255, 255, 255, 0.55);
    transform: rotate(45deg);
    transition: transform 0.16s ease;
}

.history-card[open] .history-card-chevron {
    transform: rotate(225deg);
}

.history-demo,
.history-prompt-id {
    margin: 0;
}

.history-demo {
    font-size: 0.95rem;
    font-weight: 700;
}

.history-prompt-id {
    color: var(--muted);
    font-size: 0.8rem;
}

.history-seed {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(242, 139, 60, 0.14);
    color: #ffc89e;
    font-size: 0.82rem;
    white-space: nowrap;
}

.history-preview {
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.history-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
}

.history-column {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.history-column-label {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c6cfdb;
 }

.history-preview img,
.history-preview video {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    background: #0b0d11;
}

/* Compact video thumbnail in history panel */
.history-preview-video-thumb {
    position: relative;
    width: 100%;
    height: 72px;
    overflow: hidden;
    border-radius: 10px;
    background: #0b0d11;
    cursor: pointer;
}
.history-preview-video-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-height: none;
}
.history-video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: rgba(255,255,255,0.85);
    background: rgba(0,0,0,0.25);
    transition: background 0.15s;
}
.history-preview-video-thumb:hover .history-video-play-overlay {
    background: rgba(0,0,0,0.45);
}
.history-preview-fullvideo video {
    max-height: 200px;
}

.shell-history-draggable {
    cursor: grab;
}

.shell-history-draggable:active {
    cursor: grabbing;
}

.history-preview-placeholder {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 18px 14px;
    text-align: center;
    color: var(--muted);
}

.history-mini-spinner {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 3px solid rgba(242, 139, 60, 0.18);
    border-top-color: var(--accent);
    animation: spin 0.9s linear infinite;
}

.history-prompts {
    display: grid;
    gap: 10px;
}

.history-prompt-field {
    display: grid;
    gap: 6px;
}

.history-prompt-field span {
    font-size: 0.85rem;
    font-weight: 700;
    color: #c6cfdb;
}

.history-prompt-field textarea {
    min-height: unset;
    resize: none;
    font-size: 0.8rem;
    line-height: 1.3;
    overflow: hidden;
}

.history-assets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 8px;
}

.shell-asset-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    justify-items: stretch;
    margin-top: 0;
}

.shell-asset-grid-top {
    align-items: start;
}

.history-derived-assets {
    margin-top: 2px;
}

.history-asset {
    display: grid;
    gap: 6px;
    min-width: 0;
    align-content: start;
}

.shell-shelf-asset {
    cursor: grab;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.shell-shelf-asset:active {
    cursor: grabbing;
}

.history-asset span {
    font-size: 0.72rem;
    line-height: 1.25;
    color: var(--muted);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-asset-thumb {
    aspect-ratio: 1 / 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.history-asset-thumb img,
.history-asset-thumb video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.02);
}
.history-asset-thumb .shelf-play-badge {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    pointer-events: none;
}

.history-nested-group {
    margin-top: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.history-nested-group summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-nested-group summary::-webkit-details-marker {
    display: none;
}

.history-nested-group[open] summary {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.history-nested-group .shell-asset-grid {
    padding: 10px;
}

[data-image-panel].is-drop-target {
    box-shadow: 0 0 0 2px rgba(242, 139, 60, 0.5);
}

.history-empty {
    padding: 10px 0 4px;
}

.step-panel {
    padding: 0;
    overflow: hidden;
}

.step-panel-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
}

.step-panel-summary::-webkit-details-marker {
    display: none;
}

.step-panel-summary h2 {
    margin: 0;
}

.step-panel-note {
    margin: 4px 0 0;
}

.step-state-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.step-panel-body {
    padding: 0 20px 20px;
}

.step-panel-nav {
    margin-top: 18px;
    justify-content: flex-end;
}

.step-next-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.step-panel.is-step-active {
    border-color: rgba(242, 139, 60, 0.5);
    box-shadow: 0 0 0 1px rgba(242, 139, 60, 0.2), var(--shadow);
}

.step-panel.is-step-active .step-state-pill {
    color: #ffc89e;
    border-color: rgba(242, 139, 60, 0.3);
    background: rgba(242, 139, 60, 0.14);
}

.step-panel.is-step-complete .step-state-pill {
    color: #b8f1c1;
    border-color: rgba(53, 188, 108, 0.22);
    background: rgba(53, 188, 108, 0.12);
}

.step-panel.is-step-upcoming {
    opacity: 0.8;
}

.primary-btn,
.secondary-btn,
.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.primary-btn {
    border: 0;
    background: var(--accent);
    color: #fff;
}

.primary-btn:hover {
    background: var(--accent-dark);
}

.secondary-btn,
.link-btn {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--ink);
}

.secondary-btn:hover,
.link-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(242, 139, 60, 0.34);
    transform: translateY(-1px);
}

.secondary-btn:focus-visible,
.link-btn:focus-visible,
.primary-btn:focus-visible {
    outline: 2px solid rgba(242, 139, 60, 0.75);
    outline-offset: 2px;
}

/* Never put pointer-events:none on .secondary-btn:active — it kills the click gesture. */
.secondary-btn:active,
.link-btn:active {
    opacity: 0.9;
    transform: translateY(0);
}

.primary-btn:disabled,
.primary-btn[disabled] {
    opacity: 0.38;
    cursor: not-allowed;
    pointer-events: none;
}

.primary-btn:active {
    transform: translateY(0);
}

/* ── Render Estimate Badge ──────────────────────────────────────────── */
.render-estimate-wrap {
    margin: 10px 0 4px;
}

.render-estimate-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 10px;
    padding: 10px 14px 8px;
    font-size: 0.82rem;
    color: var(--text-secondary, #a0a0b0);
}

.re-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.re-icon { font-size: 0.95rem; }

.re-title {
    font-weight: 600;
    color: var(--text-primary, #e0e0f0);
    font-size: 0.83rem;
}

.re-confidence {
    margin-left: auto;
    font-size: 0.74rem;
    padding: 2px 7px;
    border-radius: 20px;
    background: rgba(255,255,255,0.06);
    white-space: nowrap;
}
.re-conf-high   { color: #5de888; }
.re-conf-medium { color: #f5c542; }
.re-conf-low    { color: #f59442; }
.re-conf-none   { color: #888; }

.re-total {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #e8e8f8);
    line-height: 1.3;
}

.re-cost {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-secondary, #a0a0b0);
}

.re-steps-detail {
    margin-top: 7px;
    font-size: 0.78rem;
}

.re-steps-detail summary {
    cursor: pointer;
    color: var(--text-secondary, #888);
    user-select: none;
    padding: 2px 0;
}

.re-steps-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.re-steps-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.re-step-label {
    flex: 1;
    color: var(--text-primary, #ccc);
}

.re-step-range {
    color: var(--text-secondary, #999);
    white-space: nowrap;
}

.re-step-n {
    font-size: 0.72rem;
    color: #666;
    min-width: 36px;
    text-align: right;
}
.re-step-est { color: #555; font-style: italic; }

/* ── Job Result Cost/Time row ───────────────────────────────────────── */
.result-stats-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 4px 0 2px;
    flex-shrink: 0;
}

.result-stat-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.82rem;
    color: var(--text-secondary, #bbb);
}

.result-stat-chip strong {
    color: var(--text-primary, #eee);
    font-weight: 600;
}

.is-action-btn {
    min-width: 168px;
    font-weight: 700;
    background: rgba(242, 139, 60, 0.12);
    border-color: rgba(242, 139, 60, 0.26);
}

.is-next-step-glow {
    border-color: rgba(72, 199, 102, 0.8);
    box-shadow: 0 0 0 1px rgba(72, 199, 102, 0.3), 0 0 24px rgba(72, 199, 102, 0.28);
    animation: next-step-pulse 1.2s ease-in-out infinite alternate;
}

@keyframes next-step-pulse {
    from {
        transform: translateY(0);
        box-shadow: 0 0 0 1px rgba(72, 199, 102, 0.22), 0 0 12px rgba(72, 199, 102, 0.18);
    }
    to {
        transform: translateY(-1px);
        box-shadow: 0 0 0 1px rgba(72, 199, 102, 0.38), 0 0 28px rgba(72, 199, 102, 0.34);
    }
}

.button-row,
.full-row {
    display: flex;
    gap: 12px;
}

.wrap-row {
    flex-wrap: wrap;
}

.button-row form {
    margin: 0;
}

.thumb-grid-editor {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.thumb-card-editor {
    position: relative;
    padding: 0;
    overflow: hidden;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(33, 36, 45, 0.96), rgba(21, 24, 31, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.thumb-card-editor input {
    position: absolute;
    opacity: 0;
    inset: 0;
    pointer-events: none;
}

.thumb-card-editor .thumb-media {
    aspect-ratio: 1.2 / 1;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.thumb-card-editor .thumb-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-copy {
    padding: 14px 16px 16px;
    display: grid;
    gap: 6px;
}

.thumb-title {
    font-weight: 700;
    font-size: 1rem;
    color: #f4f7fb;
}

.thumb-card-editor:hover {
    border-color: rgba(242, 139, 60, 0.28);
    transform: translateY(-1px);
}

.thumb-card-editor:has(input:checked) {
    border-color: rgba(242, 139, 60, 0.85);
    box-shadow: 0 0 0 1px rgba(242, 139, 60, 0.28), 0 18px 38px rgba(242, 139, 60, 0.18);
}

.thumb-grid.is-disabled {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(0.25);
}

.prompt-editor-shell {
    display: grid;
    grid-template-columns: minmax(300px, 0.94fr) minmax(480px, 1.06fr);
    gap: 22px;
    align-items: start;
}

.car360-v2-form {
    gap: 18px;
}

.car360-v2-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.car360-v2-readiness {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(242, 139, 60, 0.14);
    border: 1px solid rgba(242, 139, 60, 0.28);
    color: #ffd2a9;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.car360-v2-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.car360-v2-slot {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
}

.car360-v2-slot-copy h3 {
    margin-bottom: 6px;
}

.car360-v2-slot-copy .muted {
    margin: 0;
}

.car360-v2-dropzone {
    min-height: 0;
    padding: 8px;
}

.car360-v2-upload-status,
.car360-v2-draw-status {
    margin-top: 10px;
}

.car360-v2-canvas-wrap {
    display: block;
    margin-top: 12px;
    aspect-ratio: 16 / 9;
    min-height: 240px;
    border-radius: 18px;
    overflow: hidden;
    background:
        radial-gradient(circle at top, rgba(242, 139, 60, 0.12), transparent 50%),
        linear-gradient(180deg, rgba(38, 42, 54, 0.92), rgba(24, 27, 35, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.car360-v2-dropzone .preview-image {
    width: 100%;
    max-width: none;
    max-height: none;
    height: 100%;
    object-fit: contain;
    border: 0;
    border-radius: 0;
}

.car360-v2-dropzone .draw-canvas {
    width: 100%;
    height: 100%;
}

.car360-v2-guide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.image-panel.has-preview .car360-v2-guide {
    display: none;
}

.car360-v2-guide-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(242, 139, 60, 0.18);
    border: 1px solid rgba(242, 139, 60, 0.28);
    color: #ffd7b5;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.car360-v2-guide-image {
    width: min(90%, 300px);
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 14px;
    background: #f7f7f7;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08) inset;
}

.car360-v2-guide-text {
    margin: 0;
    max-width: 280px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.car360-v2-panel-actions {
    margin-top: 0;
}

.car360-v2-hidden-control {
    display: none;
}

@media (max-width: 980px) {
    .car360-v2-grid {
        grid-template-columns: 1fr;
    }
}

.prompt-editor-preview,
.prompt-editor-controls {
    min-width: 0;
}

.prompt-editor-preview {
    position: sticky;
    top: 10px;
    display: grid;
    gap: 16px;
    align-self: start;
}

.prompt-editor-preview-head,
.prompt-editor-preview-block,
.prompt-editor-section {
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(27, 31, 40, 0.98), rgba(21, 24, 31, 0.96));
    padding: 18px 20px;
}

.prompt-editor-preview-head h3,
.prompt-editor-toolbar h3 {
    margin: 0;
}

.prompt-editor-preview-head p,
.prompt-editor-toolbar p {
    margin-bottom: 0;
}

.prompt-preview-media-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.preview-media-card {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    min-height: 220px;
    display: flex;
    flex-direction: column;
}

.preview-media-label {
    padding: 12px 14px 0;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.preview-media-card img {
    width: calc(100% - 24px);
    margin: 12px;
    border-radius: 16px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: none;
}

.preview-media-card img.is-visible {
    display: block;
}

.preview-media-empty {
    margin: auto 14px 14px;
}

.preview-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preview-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(242, 139, 60, 0.22);
    background: rgba(242, 139, 60, 0.1);
    color: #ffd6b7;
    font-size: 0.92rem;
    font-weight: 600;
}

.preview-chip.is-empty {
    color: var(--muted);
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.preview-meta-head {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.preview-meta-head h4 {
    margin: 0;
}

.prompt-editor-copy-preview {
    min-height: 220px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.prompt-editor-controls {
    display: grid;
    gap: 16px;
}

.prompt-editor-section-hero {
    display: grid;
    gap: 16px;
    padding: 20px 22px;
    background:
        linear-gradient(180deg, rgba(34, 38, 48, 0.98), rgba(22, 25, 33, 0.96)),
        radial-gradient(circle at top right, rgba(242, 139, 60, 0.08), transparent 32%);
}

.compact-quiz-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
}

.prompt-editor-inline-status {
    min-height: 22px;
}

.prompt-editor-subhead {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.prompt-editor-subhead h4 {
    margin: 0;
}

.prompt-editor-toolbar {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.choice-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.option-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.option-pill-grid {
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

.option-card {
    position: relative;
    display: grid;
    gap: 6px;
    min-height: 84px;
    padding: 16px 16px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.option-card input {
    position: absolute;
    opacity: 0;
    inset: 0;
    pointer-events: none;
}

.option-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #edf1f8;
}

.option-card:hover {
    transform: translateY(-1px);
    border-color: rgba(242, 139, 60, 0.24);
}

.option-card:has(input:checked) {
    border-color: rgba(242, 139, 60, 0.9);
    background: linear-gradient(180deg, rgba(242, 139, 60, 0.16), rgba(242, 139, 60, 0.07));
    box-shadow: 0 0 0 1px rgba(242, 139, 60, 0.22), 0 14px 30px rgba(242, 139, 60, 0.16);
}

.option-card-compact {
    min-height: 62px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.option-pill {
    min-height: 70px;
    padding: 14px 15px 12px;
    align-content: center;
}

.choice-chip-strong {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--ink);
    min-height: 46px;
    padding-inline: 16px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.choice-chip-strong:hover {
    border-color: rgba(242, 139, 60, 0.26);
    transform: translateY(-1px);
}

.choice-chip-strong:has(input:checked) {
    border-color: rgba(242, 139, 60, 0.82);
    background: linear-gradient(180deg, rgba(242, 139, 60, 0.16), rgba(242, 139, 60, 0.08));
    box-shadow: 0 0 0 1px rgba(242, 139, 60, 0.2), 0 10px 24px rgba(242, 139, 60, 0.14);
}

.prompt-editor-collapse {
    padding: 0;
    overflow: hidden;
}

.prompt-editor-collapse-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
}

.prompt-editor-collapse-summary::-webkit-details-marker {
    display: none;
}

.prompt-editor-collapse-summary h4 {
    margin: 0;
}

.prompt-editor-collapse-body {
    display: grid;
    gap: 16px;
    padding: 0 20px 20px;
}

.full-row {
    grid-column: 1 / -1;
}

.back-link {
    color: var(--accent);
    text-decoration: none;
}

.dr-progress-log {
    max-height: 320px;
    overflow-y: auto;
    scroll-behavior: smooth;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: .78rem;
    line-height: 1.6;
}
/* Thin scrollbar for the log */
.dr-progress-log::-webkit-scrollbar { width: 4px; }
.dr-progress-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.pre-block {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    padding: 16px;
    text-align: left;
}

.loading-card {
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
    padding: 28px 20px;
}

.is-hidden {
    display: none !important;
}

.loading-spinner {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    border: 4px solid rgba(182, 86, 51, 0.18);
    border-top-color: var(--accent);
    animation: spin 0.9s linear infinite;
}

.loading-copy {
    margin: 0;
}

/* Build-log progress — steps accumulate instead of cycling */
.loading-copy.recipe-log {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: left;
}

.recipe-log-step {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.88rem;
    line-height: 1.4;
    transition: opacity 0.4s;
}

.recipe-log-step.is-active {
    color: #fff;
    opacity: 1;
    font-weight: 600;
}

.recipe-log-step.is-done {
    color: var(--accent);
    opacity: 0.5;
    font-weight: 400;
}

.loading-dots::after {
    content: "";
    display: inline-block;
    width: 1.4em;
    text-align: left;
    animation: dots 1.2s steps(4, end) infinite;
}

code {
    font-family: Consolas, "Courier New", monospace;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes dots {
    0% {
        content: "";
    }
    25% {
        content: ".";
    }
    50% {
        content: "..";
    }
    75% {
        content: "...";
    }
    100% {
        content: "";
    }
}

@media (max-width: 900px) {
    .page-shell {
        width: calc(100vw - 16px);
        padding-left: 8px;
        padding-right: 8px;
    }

    .shell-header {
        position: static;
    }

    .workspace-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .demo-frame {
        min-height: 68vh;
    }

    .dropzone-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1260px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .workspace-rail {
        max-height: none;
    }

    .result-shell {
        grid-template-columns: 1fr;
    }

    .result-history-rail {
        position: static;
        max-height: none;
    }

    .prompt-editor-shell {
        grid-template-columns: 1fr;
    }

    .prompt-editor-preview {
        position: static;
    }
}

@media (max-width: 960px) {
    .prompt-preview-media-grid {
        grid-template-columns: 1fr;
    }

    .prompt-editor-toolbar {
        flex-direction: column;
    }

    .option-card-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .compact-quiz-grid {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 1100px) {
    .shell-header {
        grid-template-columns: 1fr;
    }

    .shell-demo-strip {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* ── Reveal browser layout ──────────────────────────── */
.reveal-browser-grid {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(280px, 0.7fr);
    gap: 12px;
    align-items: start;
}

.reveal-browser-main {
    display: grid;
    gap: 12px;
    align-content: start;
}

.reveal-browser-review {
    display: grid;
    gap: 12px;
    align-content: start;
}

/* Bigger product image */
.demo-effect-screen-reveal .reveal-upload-panel .canvas-wrap {
    min-height: 280px;
}

.demo-effect-screen-reveal .reveal-upload-panel .preview-image {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
}

/* Look panel */
.reveal-look-panel {
    display: grid;
    gap: 14px;
}

/* Prompts accordion */
.reveal-prompts-details {
    display: grid;
}

.reveal-prompts-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    gap: 12px;
    list-style: none;
    padding: 0;
}

.reveal-prompts-summary::-webkit-details-marker { display: none; }

.reveal-prompts-toggle-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    flex-shrink: 0;
}

.reveal-prompt-grid {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.reveal-render-panel {
    display: grid;
    gap: 12px;
    align-content: start;
}

.reveal-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.reveal-mode-grid {
    margin-bottom: 4px;
}

.reveal-color-control {
    display: grid;
    gap: 14px;
}

.reveal-color-field {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
}

.reveal-color-field input[type="color"] {
    width: 72px;
    height: 54px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.reveal-color-field input[type="text"] {
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.reveal-swatch-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reveal-swatch-chip {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
    flex: 0 0 auto;
}

.reveal-swatch-row p {
    margin: 0;
    color: var(--muted);
}

.reveal-prompt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.reveal-prompts-details {
    padding: 0;
    overflow: hidden;
}

.reveal-prompts-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.reveal-prompts-summary::-webkit-details-marker {
    display: none;
}

.reveal-prompts-summary h2 {
    margin: 0 0 2px;
}

.reveal-prompts-summary .muted {
    margin: 0;
}

.reveal-prompts-toggle-label {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.reveal-prompts-details[open] .reveal-prompts-toggle-label {
    color: rgba(255, 255, 255, 0.3);
}

.reveal-prompts-details > .reveal-prompt-grid,
.reveal-prompts-details > .button-row {
    padding: 0 18px 14px;
}

.shell-copy-actions {
    margin-top: 12px;
}

.page-shell.ui-lab-shell {
    width: min(1920px, calc(100vw - 28px));
    padding: 18px 14px 32px;
}

.ui-lab-shell {
    font-family: Aptos, "Trebuchet MS", "Segoe UI", sans-serif;
}

.ui-lab-hero,
.ui-workroom-header,
.ui-launchpad-hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(242, 139, 60, 0.22), transparent 26%),
        radial-gradient(circle at top right, rgba(93, 165, 255, 0.14), transparent 24%),
        linear-gradient(180deg, rgba(26, 30, 37, 0.98), rgba(17, 20, 26, 0.98));
}

.ui-lab-hero,
.ui-launchpad-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
    gap: 18px;
    margin-bottom: 18px;
    padding: 28px;
}

.ui-lab-hero-copy h1,
.ui-launchpad-copy h1,
.ui-workroom-header h1 {
    max-width: 14ch;
    margin-bottom: 10px;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: 0.94;
    letter-spacing: -0.03em;
}

.ui-lab-hero-copy .lede,
.ui-launchpad-copy .lede,
.ui-workroom-header .lede {
    max-width: 72ch;
    font-size: 1.03rem;
    line-height: 1.6;
}

.ui-lab-hero-panel,
.ui-launchpad-glance {
    display: grid;
    gap: 12px;
    align-self: stretch;
}

.ui-launchpad-glance {
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 22px;
}

.ui-mini-stat,
.ui-glance-stat {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.ui-mini-stat span,
.ui-glance-stat strong {
    display: block;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    line-height: 1;
    margin-bottom: 8px;
    font-weight: 800;
}

.ui-mini-stat p,
.ui-glance-stat p {
    margin-bottom: 0;
}

.ui-lab-section {
    margin-bottom: 20px;
}

.ui-lab-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.ui-lab-section-head h2 {
    margin-bottom: 0;
}

.ui-lab-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.ui-concept-card,
.ui-side-stack {
    padding: 22px;
}

.ui-feature-list {
    margin: 16px 0 18px;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.7;
}

.ui-pattern-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.ui-pattern-card {
    padding: 22px;
}

.ui-pattern-card h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.ui-demo-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.ui-demo-grid-large {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ui-demo-card {
    display: block;
    padding: 0;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 180ms ease;
}

.ui-demo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.ui-demo-media {
    position: relative;
    background: linear-gradient(180deg, rgba(12, 15, 20, 0.3), rgba(16, 19, 24, 0.92));
}

.ui-demo-media img {
    width: 100%;
    aspect-ratio: 16 / 10;
    display: block;
    object-fit: contain;
}

.ui-demo-badge {
    position: absolute;
    left: 14px;
    top: 14px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(17, 20, 26, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ui-demo-copy {
    padding: 16px 18px 18px;
}

.ui-demo-copy h3 {
    margin-bottom: 8px;
}

.ui-demo-cta {
    display: inline-flex;
    margin-top: 8px;
    color: var(--accent);
    font-weight: 700;
}

.ui-job-stack,
.ui-asset-stack,
.ui-create-stack {
    display: grid;
    gap: 12px;
}

.ui-job-card,
.ui-asset-card,
.ui-create-card,
.ui-launchpad-asset {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.ui-job-card img,
.ui-asset-card img,
.ui-create-card img,
.ui-launchpad-asset img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
}

.ui-job-copy,
.ui-asset-copy {
    min-width: 0;
}

.ui-job-topline,
.ui-asset-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.ui-job-state,
.ui-asset-topline span,
.ui-focus-pill {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ui-job-state.is-rendering {
    color: #ffd59f;
    border-color: rgba(242, 139, 60, 0.36);
    background: rgba(242, 139, 60, 0.12);
}

.ui-job-state.is-queued {
    color: #b3d4ff;
    border-color: rgba(93, 165, 255, 0.32);
    background: rgba(93, 165, 255, 0.1);
}

.ui-job-state.is-ready {
    color: #b9f6d3;
    border-color: rgba(56, 189, 114, 0.32);
    background: rgba(56, 189, 114, 0.1);
}

.ui-job-progress {
    height: 8px;
    margin: 10px 0 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}

.ui-job-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(242, 139, 60, 0.95), rgba(255, 190, 110, 0.95));
}

.ui-job-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ui-job-footer a,
.ui-lab-section-head a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

.ui-job-footer small {
    color: var(--muted);
}

.ui-launchpad-shell,
.ui-workroom-shell {
    display: grid;
    gap: 18px;
}

.ui-launchpad-search {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 18px 0 20px;
}

.ui-launchpad-search span {
    color: var(--muted);
    font-weight: 700;
}

.ui-launchpad-search button {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
    padding: 10px 14px;
    border-radius: 999px;
    font: inherit;
}

.ui-launchpad-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
    gap: 18px;
}

.ui-launchpad-main,
.ui-launchpad-side,
.ui-workroom-column,
.ui-workroom-canvas {
    padding: 22px;
}

.ui-side-group + .ui-side-group {
    margin-top: 18px;
}

.ui-workroom-grid {
    display: grid;
    grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.3fr) minmax(320px, 0.86fr);
    gap: 18px;
    align-items: start;
}

.ui-create-card {
    text-decoration: none;
    color: inherit;
}

.ui-quick-actions {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.ui-focus-card {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
    gap: 18px;
    padding: 16px;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
        radial-gradient(circle at top left, rgba(242, 139, 60, 0.12), transparent 30%);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ui-focus-preview img {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 20px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.03);
}

.ui-focus-tags,
.ui-shared-language {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ui-focus-tags {
    margin: 16px 0 18px;
}

.ui-focus-tags span {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.ui-shared-language {
    margin-top: 18px;
}

.ui-language-card {
    flex: 1 1 180px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.022);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.015);
}

.ui-language-card h3 {
    margin-bottom: 8px;
}

.tight-top {
    margin-top: 18px;
}

@media (max-width: 1180px) {
    .ui-lab-hero,
    .ui-launchpad-hero,
    .ui-launchpad-grid,
    .ui-workroom-grid,
    .ui-lab-split,
    .ui-focus-card {
        grid-template-columns: 1fr;
    }

    .ui-demo-grid,
    .ui-demo-grid-large,
    .ui-pattern-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .page-shell.ui-lab-shell {
        width: min(100vw, calc(100vw - 12px));
        padding: 10px 6px 20px;
    }

    .ui-lab-hero,
    .ui-launchpad-hero,
    .ui-workroom-header,
    .ui-concept-card,
    .ui-side-stack,
    .ui-launchpad-main,
    .ui-launchpad-side,
    .ui-workroom-column,
    .ui-workroom-canvas {
        padding: 18px;
    }

    .ui-demo-grid,
    .ui-demo-grid-large,
    .ui-pattern-grid {
        grid-template-columns: 1fr;
    }

    .ui-job-card,
    .ui-asset-card,
    .ui-create-card,
    .ui-launchpad-asset {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .ui-job-card img,
    .ui-asset-card img,
    .ui-create-card img,
    .ui-launchpad-asset img {
        width: 64px;
        height: 64px;
    }
}

.page-shell.ui-lab-shell.ui-lab-shell-wide {
    width: 100vw;
    max-width: none;
    margin: 0;
    padding: 0;
}

.ui-launchpad-v2 {
    display: grid;
    gap: 0;
}

.ui-solid-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    margin: 0;
    padding: 14px 22px;
    border-radius: 0 0 26px 26px;
    background:
        linear-gradient(180deg, rgba(19, 22, 28, 0.99), rgba(15, 18, 24, 0.98)),
        radial-gradient(circle at top left, rgba(242, 139, 60, 0.12), transparent 22%);
}

.ui-solid-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ui-solid-brand p {
    margin-bottom: 0;
}

.ui-solid-mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    font-weight: 900;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(242, 139, 60, 0.98), rgba(255, 190, 110, 0.92)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent);
    box-shadow: 0 12px 24px rgba(242, 139, 60, 0.18);
}

.ui-solid-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ui-solid-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
}

.ui-solid-nav a.is-active,
.ui-solid-nav a:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.06);
}

.ui-solid-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: end;
}

.ui-launchpad-stage {
    display: grid;
    gap: 24px;
    padding: 18px 20px 0;
}

.ui-launchpad-band {
    display: grid;
    gap: 16px;
}

.ui-launchpad-band-hero {
    min-height: calc(100vh - 120px);
}

.ui-launchpad-band-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 24px;
    align-items: stretch;
    padding: 38px 14px 10px;
}

.ui-home-glance-grid {
    display: grid;
    gap: 14px;
    align-content: start;
}

.ui-home-glance-card {
    padding: 22px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
        radial-gradient(circle at top left, rgba(242, 139, 60, 0.14), transparent 30%);
    box-shadow: var(--shadow);
}

.ui-home-glance-card small {
    display: block;
    margin-bottom: 10px;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ui-home-glance-card strong {
    display: block;
    font-size: clamp(1.5rem, 2vw, 2.4rem);
    margin-bottom: 10px;
}

.ui-home-glance-card p {
    margin-bottom: 0;
}

.ui-launchpad-band-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    padding: 0 8px;
}

.ui-demo-grid-full {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ui-grounding-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1.2fr) minmax(320px, 0.86fr);
    gap: 16px;
    padding: 16px;
    border-radius: 30px;
    background:
        linear-gradient(180deg, rgba(18, 22, 28, 0.99), rgba(13, 16, 21, 0.98)),
        radial-gradient(circle at top left, rgba(93, 165, 255, 0.08), transparent 26%);
}

.ui-grounding-rail,
.ui-grounding-dock {
    display: grid;
    gap: 12px;
    align-content: start;
}

.ui-grounding-rail-card {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ui-grounding-rail-card.is-current {
    background: rgba(242, 139, 60, 0.12);
    border-color: rgba(242, 139, 60, 0.34);
}

.ui-grounding-rail-card p {
    margin: 6px 0 0;
}

.ui-grounding-browser {
    display: grid;
    gap: 16px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ui-grounding-browser-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.ui-grounding-browser-top h3 {
    margin-bottom: 0;
}

.ui-grounding-browser-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ui-grounding-browser-tabs span {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ui-grounding-browser-tabs span.is-active {
    color: var(--ink);
    background: rgba(242, 139, 60, 0.12);
    border-color: rgba(242, 139, 60, 0.28);
}

.ui-grounding-canvas {
    display: grid;
    grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 14px;
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
        radial-gradient(circle at top left, rgba(242, 139, 60, 0.1), transparent 26%);
}

.ui-grounding-canvas-preview img {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: block;
    border-radius: 20px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.03);
}

.ui-grounding-note {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

.ui-grounding-dock-group {
    display: grid;
    gap: 12px;
}

.ui-grounding-dock .ui-job-card,
.ui-grounding-dock .ui-asset-card {
    background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 1380px) {
    .ui-solid-topbar,
    .ui-launchpad-band-inner,
    .ui-grounding-shell,
    .ui-grounding-canvas {
        grid-template-columns: 1fr;
    }

    .ui-solid-nav {
        justify-content: start;
    }

    .ui-solid-actions {
        justify-content: start;
    }

    .ui-demo-grid-full {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .ui-launchpad-stage {
        padding: 14px 10px 0;
    }

    .ui-demo-grid-full {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ui-grounding-browser-top {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .ui-solid-topbar {
        padding: 14px;
        border-radius: 0 0 20px 20px;
    }

    .ui-demo-grid-full {
        grid-template-columns: 1fr;
    }

    .ui-launchpad-band-inner {
        padding: 24px 4px 4px;
    }

    .ui-home-glance-card,
    .ui-grounding-browser,
    .ui-grounding-shell {
        border-radius: 20px;
    }
}

.ui-workroom-hero {
    display: grid;
    grid-template-columns: minmax(320px, 24%) minmax(0, 76%);
    gap: 10px;
    margin: 0 20px;
    padding: 12px;
    align-items: start;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.045);
    background:
        linear-gradient(180deg, rgba(27, 24, 28, 0.9), rgba(21, 18, 22, 0.86)),
        radial-gradient(circle at top left, rgba(242, 139, 60, 0.035), transparent 30%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.02),
        0 8px 20px rgba(0, 0, 0, 0.08);
}

.ui-workroom-hero-copy {
    width: 100%;
    max-width: none;
}

.ui-capture-card {
    display: grid;
    gap: 14px;
    padding: 18px 18px 16px;
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.015)),
        radial-gradient(circle at top left, rgba(242, 139, 60, 0.08), transparent 28%);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.ui-capture-card .button-row {
    margin-top: 2px;
}

.ui-capture-list {
    display: grid;
    gap: 8px;
}

.ui-capture-list div {
    display: grid;
    gap: 3px;
    padding: 10px 11px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.022);
    border: 1px solid rgba(255, 255, 255, 0.045);
}

.ui-capture-list strong {
    font-size: 0.92rem;
    line-height: 1.2;
}

.ui-capture-list span {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.25;
}

.ui-template-filmstrip {
    position: sticky;
    top: 84px;
    z-index: 22;
    margin: 8px 20px 0;
    padding: 6px 8px 8px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.045);
    background:
        linear-gradient(180deg, rgba(20, 28, 31, 0.97), rgba(16, 22, 26, 0.95)),
        radial-gradient(circle at top left, rgba(108, 173, 167, 0.045), transparent 24%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.02),
        0 6px 16px rgba(0, 0, 0, 0.06);
}

.ui-template-filmstrip::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 8px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    pointer-events: none;
}

.ui-template-filmstrip-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.ui-template-filmstrip-head h2 {
    margin-bottom: 0;
    font-size: 1.02rem;
}

.ui-template-filmstrip-head p {
    margin-bottom: 0;
    max-width: 34ch;
    font-size: 0.68rem;
}

.ui-template-dock-shell {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
}

.ui-template-dock-shell::before,
.ui-template-dock-shell::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 4px;
    width: 42px;
    pointer-events: none;
    z-index: 2;
}

.ui-template-dock-shell::before {
    left: 34px;
    background: linear-gradient(90deg, rgba(18, 26, 30, 0.98), rgba(18, 26, 30, 0));
}

.ui-template-dock-shell::after {
    right: 34px;
    background: linear-gradient(270deg, rgba(18, 26, 30, 0.98), rgba(18, 26, 30, 0));
}

.ui-template-filmstrip-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    padding: 2px 0 4px;
}

.ui-template-filmstrip-scroll::-webkit-scrollbar {
    display: none;
}

.ui-template-filmstrip-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(214px, 235px);
    gap: 5px;
    padding-bottom: 4px;
}

.ui-dock-scroll {
    position: relative;
    z-index: 3;
    width: 22px;
    height: 58px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)),
        rgba(16, 20, 25, 0.92);
    color: #f0f4fa;
    font: inherit;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ui-dock-scroll:disabled {
    opacity: 0.32;
    cursor: default;
}

.ui-dock-scroll:not(:disabled):hover {
    border-color: rgba(242, 139, 60, 0.24);
    background:
        linear-gradient(180deg, rgba(242, 139, 60, 0.16), rgba(255, 255, 255, 0.03)),
        rgba(16, 20, 25, 0.96);
}

.ui-template-chip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    align-items: start;
    min-width: 0;
    min-height: 132px;
    padding: 6px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.026);
    border: 1px solid rgba(255, 255, 255, 0.045);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.ui-template-chip:hover {
    transform: translateY(-2px);
    border-color: rgba(242, 139, 60, 0.18);
    background: rgba(255, 255, 255, 0.038);
}

.ui-template-chip.is-featured {
    border-color: rgba(242, 139, 60, 0.18);
    background:
        linear-gradient(180deg, rgba(242, 139, 60, 0.06), rgba(255, 255, 255, 0.02)),
        rgba(255, 255, 255, 0.026);
}

.ui-template-chip-media {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.02)),
        rgba(255, 255, 255, 0.03);
}

.ui-template-chip img {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 8px;
    display: block;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.03);
}

.ui-template-chip-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.ui-template-chip-topline {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.ui-template-chip-copy strong {
    line-height: 1.2;
    font-size: 0.64rem;
}

.ui-template-chip-copy p {
    margin: 0;
    line-height: 1.3;
    font-size: 0.5rem;
}

.ui-template-chip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

.ui-template-chip-footer span {
    color: var(--accent);
    font-size: 0.56rem;
    font-weight: 700;
}

.ui-template-chip-footer small {
    color: var(--muted);
    font-size: 0.56rem;
}

.ui-template-status-pill {
    flex: 0 0 auto;
    padding: 3px 6px;
    border-radius: 999px;
    font-size: 0.5rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.ui-template-status-pill.is-rendering {
    color: #ffd59f;
    border-color: rgba(242, 139, 60, 0.36);
    background: rgba(242, 139, 60, 0.12);
}

.ui-template-status-pill.is-queued {
    color: #b3d4ff;
    border-color: rgba(93, 165, 255, 0.32);
    background: rgba(93, 165, 255, 0.1);
}

.ui-template-status-pill.is-ready {
    color: #b9f6d3;
    border-color: rgba(56, 189, 114, 0.32);
    background: rgba(56, 189, 114, 0.1);
}

.ui-workroom-hero-copy h1 {
    max-width: none;
    margin-bottom: 4px;
    font-size: clamp(2rem, 2.9vw, 3.2rem);
    line-height: 0.92;
    letter-spacing: -0.03em;
}

.ui-workroom-hero-copy .lede {
    max-width: none;
    font-size: 0.92rem;
    line-height: 1.4;
}

.ui-workroom-hero-visual {
    display: grid;
    gap: 8px;
    padding: 8px;
    width: 100%;
    min-width: 0;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0.014)),
        radial-gradient(circle at top left, rgba(242, 139, 60, 0.045), transparent 26%);
}

.ui-workroom-hero-visual-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
}

.ui-workroom-hero-visual-head h2 {
    margin-bottom: 0;
    max-width: 22ch;
    font-size: clamp(0.74rem, 0.88vw, 0.88rem);
    line-height: 1.06;
}

.ui-workroom-hero-visual-head p {
    margin-bottom: 0;
    max-width: 28ch;
    font-size: 0.52rem;
    line-height: 1.16;
}

.ui-journey-flow {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1.02fr) auto minmax(0, 1.02fr) auto minmax(0, 1.02fr) auto minmax(0, 1.02fr) auto minmax(0, 1.02fr);
    gap: 5px;
    align-items: stretch;
}

.ui-journey-step {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 7px 7px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.012)),
        rgba(10, 12, 17, 0.24);
}

.ui-journey-step img {
    width: 70%;
    justify-self: center;
    aspect-ratio: 1 / 1;
    max-height: 118px;
    border-radius: 7px;
    display: block;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.03);
}

.ui-journey-step strong {
    font-size: 0.56rem;
    line-height: 1.2;
}

.ui-journey-tool {
    justify-self: start;
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #d7deea;
    font-size: 0.4rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ui-journey-step p {
    margin-bottom: 0;
    font-size: 0.44rem;
    line-height: 1.1;
}

.ui-journey-state {
    justify-self: start;
    padding: 2px 4px;
    border-radius: 999px;
    background: rgba(242, 139, 60, 0.12);
    border: 1px solid rgba(242, 139, 60, 0.22);
    color: #f7c08f;
    font-size: 0.39rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ui-journey-arrow {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 2px;
    min-width: 12px;
    color: var(--muted);
}

.ui-journey-arrow strong {
    font-size: 0.5rem;
    line-height: 1;
    color: var(--accent);
}

.ui-journey-arrow span {
    font-size: 0.32rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: center;
}

.ui-journey-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 2px;
    color: var(--muted);
    font-size: 0.5rem;
}

.ui-motion-strip {
    display: grid;
    gap: 6px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.ui-motion-strip-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
}

.ui-motion-strip-head p {
    margin-bottom: 0;
}

.ui-motion-strip-head .muted {
    max-width: 44ch;
    font-size: 0.56rem;
    line-height: 1.25;
}

.ui-motion-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.ui-motion-card {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
        rgba(10, 12, 17, 0.18);
}

.ui-motion-frame {
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    aspect-ratio: 16 / 10;
}

.ui-motion-frame video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #090b0f;
}

.ui-motion-card strong {
    font-size: 0.58rem;
    line-height: 1.15;
}

.ui-workroom-hero-grid,
.ui-entry-explainer,
.ui-what-this-does {
    display: grid;
    gap: 14px;
}

.ui-workroom-hero-grid {
    align-content: start;
}

.ui-entry-explainer,
.ui-what-this-does {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 20px;
    padding: 10px 0 0;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.ui-account-shell {
    display: grid;
    grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
    gap: 18px;
    padding: 20px;
}

.ui-account-side,
.ui-account-main {
    padding: 22px;
}

.ui-account-nav {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.ui-account-nav a {
    padding: 12px 14px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    font-weight: 700;
}

.ui-account-nav a.is-active,
.ui-account-nav a:hover {
    color: var(--ink);
    border-color: rgba(242, 139, 60, 0.26);
    background: rgba(242, 139, 60, 0.1);
}

.ui-account-note {
    padding: 18px;
}

.ui-account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.ui-account-card {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ui-account-card h3 {
    margin-bottom: 10px;
}

.ui-account-banner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(242, 139, 60, 0.1);
    border: 1px solid rgba(242, 139, 60, 0.2);
    color: var(--ink);
}

.ui-billing-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.ui-billing-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 1380px) {
    .ui-account-shell {
        grid-template-columns: 1fr;
    }

    .ui-workroom-hero-visual-head {
        flex-direction: column;
        align-items: start;
    }

    .ui-journey-flow {
        grid-template-columns: 1fr;
    }

    .ui-journey-arrow {
        grid-auto-flow: column;
        justify-content: start;
        min-width: 0;
        padding-left: 8px;
    }

    .ui-entry-explainer,
    .ui-what-this-does {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ui-template-filmstrip-head {
        flex-direction: column;
        align-items: start;
    }
}

@media (max-width: 900px) {
    .ui-billing-row {
        flex-direction: column;
        align-items: start;
    }

    .ui-template-filmstrip {
        top: 76px;
        margin: 12px 10px 0;
    }
}

@media (max-width: 640px) {
    .ui-entry-explainer,
    .ui-what-this-does {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .ui-account-shell {
        padding: 12px 10px;
    }

    .ui-account-card {
        border-radius: 18px;
    }

    .ui-template-filmstrip {
        top: 70px;
        padding: 12px;
    }

    .ui-template-filmstrip-row {
        grid-auto-columns: minmax(380px, 1fr);
    }

    .ui-template-chip {
        min-height: 288px;
    }
}

.recipe-panel-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.recipe-panel-head h2,
.recipe-panel-head h3 {
    margin-bottom: 6px;
}

.recipe-panel-note {
    margin-bottom: 0;
    max-width: 72ch;
}

.recipe-state-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.recipe-state-pill.is-ready {
    border-color: rgba(117, 211, 161, 0.34);
    background: rgba(74, 156, 112, 0.16);
    color: #b8f1cf;
}

.recipe-state-pill.is-waiting {
    border-color: rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.05);
    color: #c8cfdb;
}

.recipe-state-pill.is-optional {
    border-color: rgba(242, 139, 60, 0.24);
    background: rgba(242, 139, 60, 0.12);
    color: #ffd2ae;
}

.demo-recipe-page-shell {
    display: grid;
    gap: 0;
}

.demo-recipe-dock {
    margin-top: 0;
}

.demo-visible-recipe {
    gap: 18px;
}

.demo-recipe-intro {
    display: grid;
    gap: 18px;
}

.demo-recipe-intro h2 {
    margin-bottom: 8px;
}

.demo-recipe-map {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.demo-recipe-map-card {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.025);
}

.demo-recipe-map-card strong {
    font-size: 0.86rem;
}

.demo-recipe-map-card span {
    color: var(--muted);
    font-size: 0.82rem;
}

.demo-recipe-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) minmax(320px, 0.78fr);
    gap: 18px;
    align-items: start;
}

.demo-recipe-main {
    min-width: 0;
}

.demo-recipe-side {
    display: grid;
    gap: 16px;
    position: sticky;
    top: 170px;
}

.demo-recipe-checklist {
    display: grid;
    gap: 10px;
}

.demo-recipe-checklist article {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.026);
}

.demo-recipe-checklist strong {
    font-size: 0.9rem;
}

.demo-recipe-checklist span {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.demo-stage-panel {
    padding: 20px;
}

.demo-stage-subpanel {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.022);
    border: 1px solid rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.015);
}

.demo-scene-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.demo-scene-card {
    position: relative;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.025);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.015);
}

.demo-scene-card input[type="radio"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.demo-scene-card:has(input[type="radio"]:checked) {
    border-color: rgba(242, 139, 60, 0.4);
    box-shadow:
        0 0 0 1px rgba(242, 139, 60, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.02);
    background: rgba(242, 139, 60, 0.08);
}

.demo-scene-card img {
    width: 100%;
    height: auto;
    display: block;
}

.demo-scene-card .thumb-title {
    font-weight: 700;
}

.demo-review-panel textarea.is-disabled {
    opacity: 0.82;
}

.demo-review-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 18px;
    align-items: start;
}

.demo-review-side {
    min-width: 0;
}

.demo-recipe-dock .ui-template-chip.is-current {
    border-color: rgba(242, 139, 60, 0.3);
    background:
        linear-gradient(180deg, rgba(242, 139, 60, 0.08), rgba(255, 255, 255, 0.02)),
        rgba(255, 255, 255, 0.03);
    box-shadow:
        0 0 0 1px rgba(242, 139, 60, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.demo-recipe-dock .ui-template-chip.is-current .ui-template-chip-footer span {
    color: #ffd2ae;
}

@media (max-width: 1180px) {
    .demo-recipe-map,
    .demo-review-grid,
    .demo-recipe-grid {
        grid-template-columns: 1fr;
    }

    .demo-recipe-side {
        position: static;
        top: auto;
    }
}

@media (max-width: 760px) {
    .recipe-panel-head {
        flex-direction: column;
        align-items: start;
    }

    .demo-recipe-map {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.demo-effect-shell {
    height: 100vh;
    overflow: hidden;
}

.demo-effect-screen {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 6px;
    height: 100vh;
    padding: 4px 10px 6px;
    overflow: hidden;
}

.demo-effect-topbar {
    display: grid;
    gap: 2px;
    min-height: 44px;
    padding: 2px 10px;
    border-radius: 0 0 16px 16px;
    background:
        linear-gradient(180deg, rgba(18, 21, 28, 0.99), rgba(13, 16, 22, 0.98)),
        radial-gradient(circle at top left, rgba(242, 139, 60, 0.1), transparent 22%);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.demo-effect-topbar .back-link {
    margin-bottom: 2px;
}

.demo-effect-title-row {
    display: flex;
    align-items: center;
    position: relative;
    gap: 10px;
    min-height: 90px;
}

/* Nav left-anchored in both row variants */
.demo-effect-title-row > .demo-effect-nav,
.demo-effect-title-row-compact > .demo-effect-nav {
    flex-shrink: 0;
}

.demo-effect-title-row-compact {
    gap: 10px;
    align-items: center;
}

/* Brand block — absolutely centered in every topbar */
.topbar-brand-center {
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 1;
    flex: 0 0 auto;
}

.demo-effect-branding {
    display: grid;
    gap: 1px;
    align-content: center;
}

.demo-site-brand {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    color: #f7f0e7;
    text-decoration: none;
}

.demo-site-brand:hover {
    color: #fff7ef;
}

.demo-site-brand-logo {
    display: block;
    height: 44px;
    width: auto;
    object-fit: contain;
}

.topbar-brand-tagline {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    margin: 0;
    white-space: nowrap;
}
.tagline-brand {
    color: var(--accent);
    font-weight: 800;
}

.demo-site-brand-word {
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

/* Logo in shared topbar (pricing, workflows) */
.topbar-logo {
    display: block;
    height: 44px;
    width: auto;
    object-fit: contain;
}

/* Logo on auth pages (login / signup) */
.auth-brand-logo {
    display: block;
    height: 64px;
    width: auto;
    object-fit: contain;
    margin: 0 auto;
}

/* ── Shared site topbar (pricing, workflows, standalone pages) ────────────── */
.wf-topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 20px;
    min-height: 56px;
    background: rgba(17, 19, 24, 0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.22);
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    box-sizing: border-box;
}
.wf-topbar > .topbar-brand-center {
    flex: 0 0 auto;
    margin-left: 12px;
}
.wf-topbar > .topbar-brand-center .topbar-brand-tagline {
    display: none;
}
.wf-topbar > .demo-effect-nav {
    flex: 1 1 auto;
    justify-content: flex-start;
}

/* legacy inline brand anchor (pricing/workflows still use it in some places) */
.wf-topbar-brand {
    display: none;  /* hidden — use effect_shell_brand.html partial instead */
}

.demo-effect-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
    align-self: center;
}

.demo-effect-nav a {
    padding: 5px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.demo-effect-nav a:hover {
    color: #f5efe8;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
}

.demo-effect-nav a.nav-admin-link,
.demo-effect-nav button.nav-admin-link {
    border: none;
    background: none;
    padding: 4px 5px;
    font-size: .65rem;
    opacity: .5;
}
.demo-effect-nav a.nav-admin-link:hover,
.demo-effect-nav button.nav-admin-link:hover {
    opacity: 1;
    background: none;
    border: none;
    color: var(--accent, #f28b3c);
}
.nav-show-splash-btn {
    display: none;
}

/* ── Nav user cluster (credits + name + logout) ─────────────────────── */
.nav-user-cluster {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,.1);
}

.nav-credits-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.04);
    font-size: .68rem;
    font-weight: 700;
    color: rgba(255,255,255,.75);
    white-space: nowrap;
}

.nav-credits-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.45);
    flex-shrink: 0;
}

.nav-username {
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.07);
    background: rgba(255,255,255,.03);
    color: var(--ink, #edf1f7);
    text-decoration: none;
    font-size: .72rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
}
.nav-username:hover {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.12);
}

.nav-logout-btn {
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.07);
    background: transparent;
    color: var(--muted, #98a2b3);
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    transition: color .15s, background .15s, border-color .15s;
    white-space: nowrap;
}
.nav-logout-btn:hover {
    color: #f5efe8;
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.12);
}

.demo-effect-title-row h1 {
    margin-bottom: 0;
    font-size: clamp(1.12rem, 1.2vw, 1.46rem);
    line-height: 1;
    letter-spacing: -0.03em;
}

.demo-effect-title-render .demo-effect-render-note {
    display: none;
}

.demo-effect-topbar-note {
    display: none;
}

.demo-effect-screen .demo-recipe-dock {
    position: sticky;
    top: 8px;
    z-index: 21;
    margin: 0;
}

.demo-effect-screen .ui-template-filmstrip {
    padding: 4px 6px 6px;
}

.demo-effect-screen .ui-template-filmstrip-head {
    margin-bottom: 1px;
}

.demo-effect-screen .ui-template-filmstrip-head h2 {
    font-size: 0.8rem;
}

.demo-effect-screen .ui-template-filmstrip-head p {
    font-size: 0.58rem;
}

.demo-effect-screen .ui-template-filmstrip-row {
    grid-auto-columns: minmax(154px, 164px);
}

.demo-effect-screen .ui-template-chip {
    min-height: 84px;
    padding: 4px;
}

.demo-effect-screen .ui-template-chip img {
    aspect-ratio: 16 / 9;
}

.demo-effect-screen .ui-template-chip-copy {
    gap: 3px;
}

.demo-effect-screen .ui-template-chip-copy p,
.demo-effect-screen .ui-template-chip-footer small {
    display: none;
}

.demo-effect-screen .ui-template-chip strong,
.demo-effect-screen .ui-template-chip span,
.demo-effect-screen .ui-template-chip-footer span {
    font-size: 0.67rem;
}

.demo-effect-screen .ui-dock-scroll {
    height: 38px;
}

.demo-effect-browser-head {
    display: block;
    margin-bottom: 4px;
}

.demo-effect-browser-title {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}

.demo-effect-browser-title .eyebrow {
    margin: 0;
    flex-shrink: 0;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: inherit;
    opacity: 0.55;
    font-weight: 600;
}

.demo-effect-browser-title h1 {
    font-size: 1.3rem;
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
}

.demo-effect-browser-title h1 {
    margin-bottom: 0;
    font-size: clamp(1.06rem, 1.16vw, 1.4rem);
    line-height: 1;
    letter-spacing: -0.03em;
}

.demo-effect-inline-progress {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.demo-effect-stagecard {
    display: grid;
    gap: 4px;
    min-height: 54px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.012)),
        rgba(22, 20, 26, 0.68);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018);
}

.demo-effect-stagecard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.demo-effect-stagecard .eyebrow {
    margin-bottom: 0;
}

.demo-effect-stagecard strong {
    font-size: 0.92rem;
    line-height: 1.15;
}

.demo-effect-stagecheck {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
    flex: 0 0 auto;
}

.demo-effect-stagecard.is-ready {
    border-color: rgba(106, 197, 126, 0.28);
    background:
        linear-gradient(180deg, rgba(106, 197, 126, 0.08), rgba(106, 197, 126, 0.03)),
        rgba(19, 28, 22, 0.76);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.018),
        0 0 0 1px rgba(106, 197, 126, 0.08);
}

.demo-effect-stagecard.is-ready strong {
    color: #f3fff5;
}

.demo-effect-stagecard.is-ready .eyebrow {
    color: rgba(133, 221, 152, 0.9);
}

.demo-effect-stagecard.is-ready .demo-effect-stagecheck {
    position: relative;
    border-color: rgba(106, 197, 126, 0.5);
    background: rgba(106, 197, 126, 0.16);
}

.demo-effect-stagecard.is-ready .demo-effect-stagecheck::before {
    content: "✓";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #a9f0ba;
    font-size: 0.78rem;
    font-weight: 800;
}

.workspace-shelf {
    display: grid;
    --workspace-shelf-card-height: 80px;
    --workspace-shelf-media-height: 60px;
    --workspace-shelf-body-height: calc(var(--workspace-shelf-card-height) + 6px);
}

.workspace-shelf-rail {
    display: grid;
    gap: 4px;
}

.workspace-shelf-body {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    min-height: var(--workspace-shelf-body-height);
    height: var(--workspace-shelf-body-height);
}

.workspace-shelf-rail {
    align-content: start;
    align-self: center;
}

.workspace-shelf-tabs {
    display: grid;
    gap: 4px;
    align-content: start;
}

.workspace-shelf-tab {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.022);
    color: var(--muted);
    font: inherit;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
}

.workspace-shelf-tab:hover {
    color: #f4efe9;
    border-color: rgba(255, 255, 255, 0.08);
}

.workspace-shelf-tab.is-active {
    background: rgba(242, 139, 60, 0.14);
    color: #fff6ec;
    box-shadow: inset 0 0 0 1px rgba(242, 139, 60, 0.18);
}

.workspace-shelf-tab small {
    min-width: 18px;
    padding: 1px 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    font-size: 0.56rem;
    font-weight: 700;
    line-height: 1.2;
}

.workspace-shelf-panels {
    min-height: var(--workspace-shelf-body-height);
    height: var(--workspace-shelf-body-height);
}

.workspace-shelf-panel {
    display: none;
    height: 100%;
}

.workspace-shelf-panel.is-active {
    display: block;
}

.workspace-shelf-scroll-shell {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    min-height: var(--workspace-shelf-body-height);
    height: var(--workspace-shelf-body-height);
}

.workspace-shelf-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    min-height: var(--workspace-shelf-body-height);
    height: var(--workspace-shelf-body-height);
}

.workspace-shelf-scroll::-webkit-scrollbar {
    display: none;
}

.workspace-shelf-card-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(166px, 176px);
    gap: 8px;
    align-items: stretch;
    min-height: var(--workspace-shelf-card-height);
}

.workspace-shelf-card {
    display: grid;
    grid-template-rows: var(--workspace-shelf-media-height) auto;
    gap: 3px;
    min-height: var(--workspace-shelf-card-height);
    height: var(--workspace-shelf-card-height);
    padding: 4px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.024);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.014);
    overflow: hidden;
}

.workspace-shelf-card.is-active {
    border-color: rgba(242, 139, 60, 0.22);
    box-shadow:
        0 0 0 1px rgba(242, 139, 60, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.workspace-shelf-card-media {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    height: var(--workspace-shelf-media-height);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.workspace-shelf-card-media img,
.workspace-shelf-card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.workspace-shelf-asset-card .workspace-shelf-card-media,
.workspace-shelf-render-card .workspace-shelf-card-media {
    padding: 4px;
}

.workspace-shelf-asset-card .workspace-shelf-card-media img,
.workspace-shelf-render-card .workspace-shelf-card-media img,
.workspace-shelf-asset-card .workspace-shelf-card-media video,
.workspace-shelf-render-card .workspace-shelf-card-media video {
    position: static !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    transform: none !important;
    object-fit: contain !important;
    object-position: center !important;
    background: transparent;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.workspace-shelf-asset-card,
.workspace-shelf-render-card {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.workspace-shelf-asset-card.is-dragging,
.workspace-shelf-render-card.is-dragging {
    opacity: 0.72;
}

.workspace-shelf-asset-card.is-selected,
.workspace-shelf-render-card.is-selected {
    border-color: rgba(242, 139, 60, 0.24);
    box-shadow:
        0 0 0 1px rgba(242, 139, 60, 0.12),
        inset 0 0 0 1px rgba(242, 139, 60, 0.08);
}

.workspace-shelf-asset-card *,
.workspace-shelf-render-card * {
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.workspace-shelf-card-copy {
    display: grid;
    gap: 0;
}

.workspace-shelf-card-copy strong {
    font-size: 0.58rem;
    line-height: 1.08;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-shelf-card-copy span {
    color: var(--muted);
    font-size: 0.5rem;
    line-height: 1.02;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-shelf-import-card {
    cursor: pointer;
}

.workspace-shelf-import-card.is-loading {
    opacity: 0.75;
}

/* Delete (×) button on Media shelf cards */
.shelf-asset-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}
.workspace-shelf-card:hover .shelf-asset-delete {
    opacity: 1;
}
.shelf-asset-delete:hover {
    background: rgba(200, 40, 40, 0.9);
}

/* "Example" badge on sample asset cards */
.shelf-example-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(242, 139, 60, 0.88);
    color: #fff;
    border-radius: 4px;
    padding: 2px 5px;
    pointer-events: none;
    line-height: 1.3;
}

.workspace-shelf-card-media {
    position: relative;
}

.workspace-shelf-import-card.is-drop-target {
    border-color: rgba(242, 139, 60, 0.26);
    box-shadow: 0 0 0 1px rgba(242, 139, 60, 0.12);
}

.workspace-shelf-import-media {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
    background:
        linear-gradient(180deg, rgba(242, 139, 60, 0.06), rgba(242, 139, 60, 0.015)),
        rgba(0, 0, 0, 0.22);
}

.workspace-shelf-import-plus {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(242, 139, 60, 0.16);
    color: #fff4e8;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.workspace-shelf-import-media p {
    margin: 0;
    color: var(--muted);
    font-size: 0.5rem;
    line-height: 1.05;
    text-align: center;
}

.workspace-shelf-import-card .workspace-shelf-card-copy {
    display: grid;
    gap: 0;
}

.workspace-shelf-import-card .workspace-shelf-card-copy span {
    display: block;
    text-transform: none;
    letter-spacing: 0;
}

.workspace-shelf-asset-card .workspace-shelf-card-copy,
.workspace-shelf-render-card .workspace-shelf-card-copy {
    display: flex;
    align-items: center;
    min-height: 14px;
}

.workspace-shelf-asset-card .workspace-shelf-card-copy span,
.workspace-shelf-render-card .workspace-shelf-card-copy span {
    display: none;
}

/* ── History panel ─────────────────────────────────────────────────────── */

/* -- Renders panel - taller cards so outputs are legible ------------- */
.workspace-shelf-panel-renders {
    --workspace-shelf-renders-card-height: 148px;
    --workspace-shelf-renders-media-height: 118px;
}

.workspace-shelf-panel-renders.is-active {
    height: var(--workspace-shelf-renders-card-height);
}

.workspace-shelf-panels:has(.workspace-shelf-panel-renders.is-active) {
    height: var(--workspace-shelf-renders-card-height);
    min-height: var(--workspace-shelf-renders-card-height);
}

.workspace-shelf-body:has(.workspace-shelf-panel-renders.is-active) .workspace-shelf-rail {
    height: var(--workspace-shelf-renders-card-height);
    min-height: var(--workspace-shelf-renders-card-height);
}

.workspace-shelf-panel-renders .workspace-shelf-scroll-shell,
.workspace-shelf-panel-renders .workspace-shelf-scroll {
    height: var(--workspace-shelf-renders-card-height);
    min-height: var(--workspace-shelf-renders-card-height);
}

.workspace-shelf-panel-renders .workspace-shelf-render-card {
    height: var(--workspace-shelf-renders-card-height);
    grid-template-rows: var(--workspace-shelf-renders-media-height) auto;
}

.workspace-shelf-panel-renders .workspace-shelf-render-card .workspace-shelf-card-media {
    height: var(--workspace-shelf-renders-media-height);
}

.workspace-shelf-panel-renders .workspace-shelf-card-row {
    grid-auto-columns: minmax(192px, 210px);
}

.workspace-shelf-panel-history {
    --workspace-shelf-history-card-height: 210px;
}

.workspace-shelf-panel-history.is-active {
    height: var(--workspace-shelf-history-card-height);
}

.workspace-shelf-panels:has(.workspace-shelf-panel-history.is-active) {
    height: var(--workspace-shelf-history-card-height);
    min-height: var(--workspace-shelf-history-card-height);
}

.workspace-shelf-body:has(.workspace-shelf-panel-history.is-active) .workspace-shelf-rail {
    height: var(--workspace-shelf-history-card-height);
    min-height: var(--workspace-shelf-history-card-height);
}

.workspace-shelf-panel-history .workspace-shelf-scroll-shell,
.workspace-shelf-panel-history .workspace-shelf-scroll {
    height: var(--workspace-shelf-history-card-height);
    min-height: var(--workspace-shelf-history-card-height);
}

.workspace-shelf-history-card {
    height: var(--workspace-shelf-history-card-height);
    min-width: 148px;
    max-width: 168px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.workspace-shelf-history-card[data-run-again-url]:hover {
    border-color: rgba(242,139,60,.35);
    box-shadow: 0 0 0 1px rgba(242,139,60,.15);
}

.workspace-shelf-history-card .workspace-shelf-card-media {
    flex: 0 0 auto;
    height: 100px;
    padding: 4px;
    position: relative;
}

.workspace-shelf-history-card .workspace-shelf-card-media img,
.workspace-shelf-history-card .workspace-shelf-card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.workspace-shelf-history-card .workspace-shelf-card-copy {
    flex: 0 0 auto;
    padding: 0 8px;
}

.workspace-shelf-history-card.is-active {
    border-color: rgba(242, 139, 60, 0.35);
    box-shadow: 0 0 0 1px rgba(242, 139, 60, 0.15), inset 0 0 12px rgba(242, 139, 60, 0.04);
}

.workspace-shelf-history-prompts {
    flex: 1 1 auto;
    overflow: hidden;
    padding: 0 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.workspace-shelf-history-prompt {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
}

.workspace-shelf-history-prompt-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-shelf-history-prompt-value {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Video play badge on shelf cards ─────────────────────────────────── */
.workspace-shelf-card-media {
    position: relative;
}
.shelf-play-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: .65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.workspace-shelf-empty {
    display: flex;
    align-items: center;
    min-height: var(--workspace-shelf-card-height);
    height: var(--workspace-shelf-card-height);
    padding: 14px;
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.018);
}

.workspace-shelf-empty p {
    margin: 0;
    font-size: 0.74rem;
}

.workspace-shelf-placeholder {
    display: grid;
    place-items: center;
    min-height: 0;
    height: var(--workspace-shelf-media-height);
    width: 100%;
    color: var(--muted);
    font-size: 0.66rem;
    text-align: center;
    padding: 8px;
}

.demo-effect-workspace {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    min-height: 0;
    padding: 14px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(28, 24, 28, 0.96), rgba(20, 19, 24, 0.96)),
        radial-gradient(circle at top left, rgba(242, 139, 60, 0.06), transparent 28%);
}

.demo-effect-stagebar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.demo-effect-stagecard {
    display: grid;
    gap: 3px;
    padding: 11px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.026);
}

.demo-effect-stagecard .eyebrow {
    margin-bottom: 0;
    font-size: 0.62rem;
}

.demo-effect-stagecard strong {
    font-size: 0.9rem;
    line-height: 1.2;
}

.demo-effect-grid {
    display: grid;
    grid-template-columns: minmax(340px, 0.95fr) minmax(410px, 1.1fr) minmax(340px, 0.82fr);
    gap: 12px;
    min-height: 0;
}

.demo-effect-screen-magazine .demo-effect-grid-magazine {
    grid-template-columns: minmax(260px, 0.55fr) minmax(480px, 1.45fr);
    align-items: start;
}

/* Bigger product image drop area */
.demo-effect-screen-magazine .mag-product-panel .canvas-wrap {
    min-height: 280px;
}

.demo-effect-screen-magazine .mag-product-panel .preview-image {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
}

/* Reference panel: override the horizontal dock into a wrapping grid */
.demo-effect-screen-magazine .demo-effect-look-panel {
    display: grid;
    align-content: start;
    gap: 8px;
}

/* Lock steps: parent pointer-events does not block children; force subtree off. */
.demo-effect-screen-magazine .mag-step-locked {
    opacity: 0.48;
    pointer-events: none;
    user-select: none;
}

.demo-effect-screen-magazine .mag-step-locked * {
    pointer-events: none !important;
    user-select: none;
}

.demo-effect-screen-magazine .demo-effect-look-panel.mag-step-locked h2::after {
    content: " — add a product image and description first";
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(242, 139, 60, 0.85);
    margin-top: 6px;
}

.demo-effect-screen-magazine [data-mag-copy-panel].mag-step-locked h2::after {
    content: " — describe the product and pick a reference style first";
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(242, 139, 60, 0.85);
    margin-top: 6px;
}

.demo-effect-screen-magazine [data-mag-render-panel].mag-step-locked h2::after {
    content: " — generate or enter ad copy first";
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(242, 139, 60, 0.85);
    margin-top: 6px;
}

.demo-effect-screen-magazine .mag-describe-panel .d1-note {
    margin-bottom: 8px;
}

/* The choice-scroller is normally a 3-col dock — flatten it for magazine */
.demo-effect-screen-magazine .demo-effect-look-panel .demo-effect-choice-scroller {
    display: block;
}

/* The scene-scroll is normally overflow-x:auto / overflow-y:hidden — flip it */
.demo-effect-screen-magazine .demo-effect-look-panel .demo-effect-scene-scroll {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    max-height: 300px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.demo-effect-screen-magazine .demo-effect-look-panel .demo-effect-scene-scroll::-webkit-scrollbar {
    width: 6px;
}
.demo-effect-screen-magazine .demo-effect-look-panel .demo-effect-scene-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255,255,255,0.15);
}

/* The scene-row is normally grid-auto-flow:column — override to wrapping rows */
.demo-effect-screen-magazine .demo-effect-look-panel .demo-effect-scene-row {
    grid-auto-flow: row !important;
    grid-auto-columns: unset !important;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 10px;
    padding: 4px 2px;
}

.demo-effect-screen-magazine .demo-effect-look-panel .demo-scene-card img {
    width: 100%;
    height: auto;
    display: block;
}

.demo-effect-screen-magazine .demo-effect-look-panel .thumb-title {
    font-size: 0.62rem;
    line-height: 1.2;
}

.demo-effect-column {
    display: grid;
    gap: 12px;
    align-content: start;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.demo-effect-column::-webkit-scrollbar {
    width: 8px;
}

.demo-effect-column::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.demo-effect-column::-webkit-scrollbar-track {
    background: transparent;
}

.demo-effect-column .panel {
    margin: 0;
}

.demo-effect-screen .demo-stage-panel {
    padding: 14px;
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.016)),
        rgba(20, 18, 24, 0.44);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.02),
        0 8px 22px rgba(0, 0, 0, 0.08);
}

.demo-effect-screen .recipe-panel-head {
    margin-bottom: 10px;
}

.demo-effect-screen .recipe-panel-head h2 {
    margin-bottom: 4px;
    font-size: 1.1rem;
}

.demo-effect-screen .recipe-panel-note {
    max-width: none;
    font-size: 0.84rem;
    line-height: 1.35;
}

.demo-effect-screen .image-panel {
    min-height: 0;
    padding: 14px;
}

.demo-effect-screen .dropzone-layout {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.74fr);
    gap: 12px;
}

.demo-effect-screen .dropzone-layout.shelf-input-layout {
    grid-template-columns: minmax(0, 1fr);
}

.demo-effect-screen .dropzone-copy {
    gap: 8px;
}

.panel-file-browse-btn {
    display: inline-block;
    margin-top: 4px;
    cursor: pointer;
}

.demo-effect-screen .dropzone-copy p {
    margin-bottom: 0;
    font-size: 0.94rem;
    line-height: 1.4;
}

.demo-effect-screen .dropzone-art {
    min-height: 152px;
}

.demo-effect-screen .dropzone-art img {
    min-height: 152px;
}

.demo-effect-screen .preview-image {
    max-width: min(100%, 360px);
    max-height: 220px;
}

.demo-effect-screen .canvas-wrap {
    margin-top: 10px;
}

.demo-effect-screen .panel-actions {
    margin-top: 10px;
}

.demo-effect-screen .panel-actions .secondary-btn,
.demo-effect-screen .panel-actions .primary-btn {
    min-height: 38px;
}

.demo-effect-copy-panel,
.demo-effect-result-panel,
.demo-effect-review-panel {
    display: grid;
    gap: 12px;
}

.demo-effect-help {
    margin-bottom: 0;
    font-size: 0.82rem;
    line-height: 1.35;
}

.demo-effect-choice-frame {
    display: grid;
    gap: 10px;
}

.demo-effect-choice-copy {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.demo-effect-choice-copy strong {
    font-size: 0.9rem;
}

.demo-effect-choice-copy p {
    margin-bottom: 0;
    max-width: 44ch;
    font-size: 0.8rem;
    line-height: 1.35;
}

.demo-effect-choice-scroller {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.demo-effect-scene-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    padding-bottom: 3px;
}

.demo-effect-scene-scroll::-webkit-scrollbar {
    display: none;
}

.demo-effect-scene-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(200px, 220px);
    gap: 10px;
}

.demo-effect-look-panel .ui-dock-scroll {
    height: 46px;
}

.demo-effect-look-panel .ui-dock-scroll span {
    transform: translateY(-1px);
}

.demo-scene-card {
    padding: 8px;
    gap: 6px;
    min-height: 0;
}

.demo-scene-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.demo-scene-card .thumb-title {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.15;
}

.demo-scene-caption {
    margin: 0;
    font-size: 0.72rem;
}

.demo-effect-summary-list {
    display: grid;
    gap: 10px;
}

.demo-effect-summary-list article {
    display: grid;
    gap: 4px;
    padding: 12px 13px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.demo-effect-summary-list strong {
    font-size: 0.9rem;
    line-height: 1.2;
}

.demo-effect-summary-list span {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.3;
}

.demo-effect-review-panel textarea,
.demo-effect-copy-panel textarea {
    min-height: 108px;
}

.demo-effect-review-panel .field,
.demo-effect-copy-panel .field {
    gap: 7px;
}

.demo-effect-render-note {
    margin-bottom: 0;
    font-size: 0.74rem;
    line-height: 1.25;
}

.demo-effect-title-status {
    display: grid;
    gap: 0;
    align-content: center;
}

.demo-effect-title-stages {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.demo-effect-mini-stage {
    display: grid;
    gap: 2px;
    min-height: 34px;
    padding: 4px 7px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.022);
}

.demo-effect-mini-stage .eyebrow {
    margin-bottom: 0;
    font-size: 0.5rem;
}

.demo-effect-mini-stage strong {
    font-size: 0.66rem;
    line-height: 1.05;
}

.demo-effect-title-render {
    display: none;
}

.demo-effect-workspace-demo1 {
    padding: 12px;
    gap: 10px;
}

.demo-effect-inline-progress {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.demo-effect-inline-progress .demo-effect-stagecard {
    padding: 9px 10px;
}

.demo-effect-inline-progress .demo-effect-stagecard strong {
    font-size: 0.82rem;
}

.demo1-browser-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr) minmax(360px, 1.4fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    align-items: stretch;
}

.demo1-browser-source,
.demo1-browser-prompt,
.demo1-browser-visual {
    min-height: 0;
}

.demo1-browser-source {
    display: flex;
    flex-direction: column;
}

.demo1-browser-prompt {
    display: grid;
    grid-template-rows: auto auto;
    gap: 10px;
    align-content: start;
}

.demo1-description-panel {
    min-height: 0;
}

.demo1-review-panel {
    display: grid;
    gap: 8px;
    align-content: start;
    min-height: 0;
}

.demo1-browser-visual {
    display: flex;
    flex-direction: column;
}

.demo1-summary-list {
    grid-template-columns: 1fr;
}

.demo1-look-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.demo1-description-panel .button-row {
    margin-top: 10px;
}

.demo1-description-panel [data-prompt-status-for] {
    min-height: 1.2em;
    margin-top: 4px;
}

.demo-effect-screen-demo1 .demo-stage-panel {
    padding: 12px;
    border-radius: 18px;
}

.demo-effect-screen-demo1 .recipe-panel-note {
    font-size: 0.75rem;
    line-height: 1.3;
    margin: 4px 0 0;
}

.demo-effect-screen-demo1 .demo1-upload-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.demo-effect-screen-demo1 .image-panel {
    padding: 12px;
    flex: 1;
    display: grid;
    grid-template-rows: 1fr auto;
    grid-auto-rows: auto;
    min-height: 0;
    overflow: hidden;
}

.demo-effect-screen-demo1 .dropzone-layout {
    grid-template-columns: 1fr;
    gap: 8px;
}

.demo-effect-screen-demo1 .dropzone-copy {
    gap: 6px;
}

.demo-effect-screen-demo1 .dropzone-copy p {
    font-size: 0.84rem;
    line-height: 1.3;
}

.demo-effect-screen-demo1 .dropzone-art {
    display: none;
}

.demo-effect-screen-demo1 .image-panel.has-preview .dropzone-layout {
    display: none;
}

.demo-effect-screen-demo1 .canvas-wrap {
    position: relative;
    min-height: 160px;
    overflow: hidden;
}

.demo-effect-screen-demo1 .preview-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
}

.demo-effect-screen-demo1 .draw-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.demo-effect-screen-demo1 .panel-actions {
    margin-top: 8px;
}

.demo-effect-screen-demo1 .panel-actions .secondary-btn,
.demo-effect-screen-demo1 .panel-actions .primary-btn {
    min-height: 34px;
    padding: 0 12px;
}

.demo-effect-screen-demo1 .field {
    gap: 6px;
}

.demo-effect-screen-demo1 .field textarea,
.demo-effect-screen-demo1 .field input[type="text"] {
    font-size: 0.92rem;
}

.demo-effect-screen-demo1 .demo-effect-copy-panel textarea {
    min-height: 170px;
}

.demo-effect-screen-demo1 .demo-effect-help,
.demo-effect-screen-demo1 .demo-effect-render-note {
    font-size: 0.78rem;
    line-height: 1.3;
}

.demo-effect-screen-demo1 .demo-effect-choice-frame {
    gap: 0;
}

.demo-effect-screen-demo1 .demo-effect-scene-row {
    grid-auto-columns: minmax(144px, 168px);
    gap: 10px;
}

.demo-effect-screen-demo1 .demo-scene-card {
    padding: 8px;
    gap: 6px;
}

.demo-effect-screen-demo1 .demo-scene-card img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    display: block;
    border-radius: 10px;
}

.demo-effect-screen-demo1 .demo-scene-card .thumb-title {
    font-size: 0.76rem;
}

.demo-effect-screen-demo1 .demo-scene-caption {
    font-size: 0.66rem;
}

.demo-effect-screen-demo1 .demo-effect-summary-list {
    gap: 8px;
}

.demo-effect-screen-demo1 .demo-effect-summary-list article {
    padding: 10px 11px;
}

.demo-effect-screen-demo1 .demo-effect-summary-list strong {
    font-size: 0.84rem;
}

.demo-effect-screen-demo1 .demo-effect-summary-list span {
    font-size: 0.75rem;
}

.demo-effect-screen-demo1 .button-row.wrap-row {
    gap: 8px;
}

.demo-effect-screen-demo1 .demo1-browser-visual .recipe-panel-head {
    margin-bottom: 10px;
}

.demo-effect-screen-demo1 .recipe-panel-head .recipe-state-pill {
    display: none;
}

.demo-effect-screen-demo1 .demo-stage-panel .recipe-state-pill,
.demo-effect-screen-demo1 .demo-stage-panel .step-state-pill,
.demo-effect-screen-demo1 [data-source-status],
.demo-effect-screen-demo1 [data-description-status],
.demo-effect-screen-demo1 [data-look-status],
.demo-effect-screen-demo1 [data-render-summary-status] {
    display: none !important;
}

.demo-effect-screen-demo1 .demo-effect-choice-frame {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.demo-effect-screen-demo1 .demo-effect-choice-scroller {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.demo-effect-screen-demo1 .demo-effect-choice-scroller .ui-dock-scroll {
    display: none;
}

.demo-effect-screen-demo1 .demo-effect-scene-scroll {
    flex: 1;
    min-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.demo-effect-screen-demo1 .demo-effect-scene-row {
    grid-auto-flow: row;
    grid-auto-columns: unset;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.demo-effect-screen-demo1 .button-row.wrap-row .primary-btn,
.demo-effect-screen-demo1 .button-row.wrap-row .secondary-btn {
    min-height: 36px;
}

.demo-effect-screen-demo1 .demo-scene-card {
    padding: 9px;
}

.demo-effect-screen-demo1 .demo-scene-card img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    display: block;
    border-radius: 10px;
}

.demo-effect-screen-demo1 .demo1-review-panel .field {
    margin-top: 0;
}

.demo-effect-screen-demo1 .demo1-review-panel .button-row {
    margin-top: 2px;
}

.demo-effect-screen-demo1 .demo1-description-panel h2,
.demo-effect-screen-demo1 .demo1-review-panel h2,
.demo-effect-screen-demo1 .demo1-look-panel h2 {
    font-size: 1rem;
    margin: 0;
}

.demo-effect-screen-demo1 .demo1-review-panel .field span {
    font-size: 0.76rem;
}

.demo-effect-screen-demo2 .demo-stage-panel {
    padding: 12px;
    border-radius: 18px;
}

.demo-effect-workspace-demo2 {
    display: grid;
    gap: 12px;
}

.demo2-browser-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(320px, 0.86fr);
    gap: 12px;
    align-items: start;
}

.demo2-browser-column,
.demo2-summary-column {
    display: grid;
    align-content: start;
    min-width: 0;
}

.demo2-summary-panel,
.demo2-render-panel {
    display: grid;
    align-content: start;
    gap: 12px;
    height: 100%;
}

.demo2-review-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 0.95fr) minmax(340px, 1fr);
    gap: 12px;
    align-items: start;
}

.demo2-trace-card {
    display: grid;
    align-content: start;
    gap: 10px;
}

.demo2-trace-image {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px;
}

.demo-effect-screen-demo2 .recipe-panel-head {
    margin-bottom: 8px;
}

.demo-effect-screen-demo2 .recipe-panel-head h2 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.demo-effect-screen-demo2 .recipe-panel-note {
    font-size: 0.78rem;
    line-height: 1.3;
}

.demo-effect-screen-demo2 .image-panel {
    padding: 12px;
}

.demo-effect-screen-demo2 .dropzone-layout {
    grid-template-columns: 1fr;
    gap: 8px;
}

.demo-effect-screen-demo2 .dropzone-copy {
    gap: 6px;
}

.demo-effect-screen-demo2 .dropzone-copy p {
    font-size: 0.84rem;
    line-height: 1.3;
}

.demo-effect-screen-demo2 .dropzone-art {
    display: none;
}

.demo-effect-screen-demo2 .canvas-wrap {
    margin-top: 8px;
    min-height: 260px;
    display: grid;
    place-items: center;
}

.demo-effect-screen-demo2 .preview-image {
    max-width: 100%;
    max-height: 320px;
}

.demo-effect-screen-demo2 .draw-canvas {
    max-width: 100%;
}

.demo-effect-screen-demo2 .panel-actions {
    margin-top: 8px;
}

.demo-effect-screen-demo2 .panel-actions .secondary-btn,
.demo-effect-screen-demo2 .panel-actions .primary-btn {
    min-height: 34px;
    padding: 0 12px;
}

.demo-effect-screen-demo2 .field {
    gap: 6px;
}

.demo-effect-screen-demo2 .field textarea,
.demo-effect-screen-demo2 .field input[type="text"] {
    font-size: 0.92rem;
}

.demo-effect-screen-demo2 .demo-effect-summary-list {
    gap: 8px;
}

.demo-effect-screen-demo2 .demo-effect-summary-list article {
    padding: 10px 11px;
}

.demo-effect-screen-demo2 .demo-effect-summary-list strong {
    font-size: 0.84rem;
}

.demo-effect-screen-demo2 .demo-effect-summary-list span,
.demo-effect-screen-demo2 .demo-effect-help,
.demo-effect-screen-demo2 .demo-effect-render-note {
    font-size: 0.75rem;
    line-height: 1.3;
}

.demo-effect-screen-demo2 .button-row.wrap-row {
    gap: 8px;
}

.demo-effect-screen-demo2 .button-row.wrap-row .primary-btn,
.demo-effect-screen-demo2 .button-row.wrap-row .secondary-btn {
    min-height: 36px;
}

.demo-effect-workspace-texturize {
    padding: 12px;
    gap: 10px;
}

.texturize-browser-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.34fr) minmax(260px, 0.6fr);
    gap: 12px;
    align-items: start;
}

.texturize-browser-main {
    display: grid;
    gap: 12px;
}

.texturize-browser-review {
    display: grid;
    gap: 12px;
    align-content: start;
}

/* Bigger logo image */
.demo-effect-screen-texturize .texturize-upload-panel .canvas-wrap {
    min-height: 260px;
}

.demo-effect-screen-texturize .texturize-upload-panel .preview-image {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
}

/* Texture thumbnail grid — square cards, tight */
.texturize-thumb-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important;
    gap: 8px !important;
}

.texturize-thumb-grid .thumb-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.texturize-thumb-grid .thumb-title {
    font-size: 0.68rem;
    text-align: center;
    margin-top: 4px;
}

/* Three select fields in a row */
.texturize-selects-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 4px;
}

/* Custom texture as collapsible */
.texturize-custom-texture-panel > summary {
    cursor: pointer;
    list-style: none;
    padding: 4px 0;
}

.texturize-custom-texture-panel > summary::-webkit-details-marker { display: none; }

.texturize-summary-panel {
    display: grid;
    gap: 12px;
    align-content: start;
}

.demo-effect-workspace-chromafy {
    padding: 12px;
    gap: 10px;
}

.chromafy-browser-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.34fr) minmax(340px, 0.8fr);
    gap: 12px;
    align-items: start;
}

.chromafy-browser-main {
    display: grid;
    gap: 12px;
}

.chromafy-setup-band {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 12px;
    align-items: start;
}

.chromafy-review-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr) minmax(320px, 0.78fr);
    gap: 12px;
    align-items: start;
}

.demo-effect-screen-chromafy .demo-stage-panel {
    padding: 12px;
    border-radius: 18px;
}

.demo-effect-screen-chromafy .recipe-panel-head {
    margin-bottom: 8px;
}

.demo-effect-screen-chromafy .recipe-panel-head h2 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.demo-effect-screen-chromafy .recipe-panel-note {
    font-size: 0.78rem;
    line-height: 1.3;
}

.demo-effect-screen-chromafy .image-panel {
    padding: 12px;
}

.demo-effect-screen-chromafy .dropzone-layout {
    grid-template-columns: 1fr;
    gap: 8px;
}

.demo-effect-screen-chromafy .dropzone-copy {
    gap: 6px;
}

.demo-effect-screen-chromafy .dropzone-copy p {
    font-size: 0.84rem;
    line-height: 1.3;
}

.demo-effect-screen-chromafy .dropzone-art {
    display: none;
}

.demo-effect-screen-chromafy .canvas-wrap {
    margin-top: 8px;
    min-height: 260px;
    display: grid;
    place-items: center;
}

.demo-effect-screen-chromafy .preview-image {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
}

.demo-effect-screen-chromafy .draw-canvas {
    max-width: 100%;
}

.demo-effect-screen-chromafy .panel-actions {
    margin-top: 8px;
}

.demo-effect-screen-chromafy .panel-actions .secondary-btn,
.demo-effect-screen-chromafy .panel-actions .primary-btn {
    min-height: 34px;
    padding: 0 12px;
}

.demo-effect-screen-chromafy .field {
    gap: 6px;
}

.demo-effect-screen-chromafy .field textarea,
.demo-effect-screen-chromafy .field input[type="text"] {
    font-size: 0.92rem;
}

.demo-effect-screen-chromafy .demo-effect-summary-list {
    gap: 8px;
}

.demo-effect-screen-chromafy .demo-effect-summary-list article {
    padding: 10px 11px;
}

.demo-effect-screen-chromafy .demo-effect-summary-list strong {
    font-size: 0.84rem;
}

.demo-effect-screen-chromafy .demo-effect-summary-list span,
.demo-effect-screen-chromafy .demo-effect-render-note,
.demo-effect-screen-chromafy .demo-effect-help {
    font-size: 0.75rem;
    line-height: 1.3;
}

.demo-effect-screen-chromafy .button-row.wrap-row {
    gap: 8px;
}

.demo-effect-screen-chromafy .button-row.wrap-row .primary-btn,
.demo-effect-screen-chromafy .button-row.wrap-row .secondary-btn {
    min-height: 36px;
}

.chromafy-choice-grid,
.chromafy-choice-stack {
    display: grid;
    gap: 10px;
}

.chromafy-choice-grid {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.78fr);
}

.chromafy-choice-group {
    display: grid;
    gap: 8px;
}

.chromafy-choice-group strong {
    font-size: 0.84rem;
    color: #eef2f7;
}

.chromafy-effect-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.chromafy-effect-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}

.chromafy-effect-thumb-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px 6px 10px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
}

.chromafy-effect-thumb-card:hover {
    border-color: rgba(242, 139, 60, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.chromafy-effect-thumb-card input {
    position: absolute;
    opacity: 0;
    inset: 0;
    z-index: 2;
    cursor: pointer;
    width: 100%;
    height: 100%;
    margin: 0;
}

.chromafy-effect-thumb-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #0a0b10;
    border-radius: 9px;
    display: block;
    pointer-events: none;
}

.chromafy-effect-thumb-card span {
    font-size: 0.76rem;
    font-weight: 700;
    color: #eef2f7;
    text-align: center;
    line-height: 1.2;
    pointer-events: none;
}

.chromafy-effect-thumb-card.is-selected,
.chromafy-effect-thumb-card:has(input:checked) {
    border-color: rgba(242, 139, 60, 0.75);
    background: linear-gradient(180deg, rgba(242, 139, 60, 0.15), rgba(255, 255, 255, 0.02));
    box-shadow: 0 0 0 1px rgba(242, 139, 60, 0.25), 0 4px 18px rgba(0, 0, 0, 0.3);
}

.chromafy-extra-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.chromafy-extra-grid-single {
    grid-template-columns: minmax(0, 1fr);
    max-width: 220px;
}

.chromafy-prepare-busy {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(6, 9, 18, 0.72);
    backdrop-filter: blur(4px);
}

.chromafy-prepare-busy[hidden] {
    display: none !important;
}

.chromafy-prepare-busy-card {
    width: min(420px, 100%);
    padding: 24px 26px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(160deg, rgba(22, 28, 40, 0.98), rgba(12, 16, 26, 0.96));
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.55);
    text-align: center;
}

.chromafy-prepare-busy-title {
    margin: 14px 0 6px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #f4f6fb;
}

.chromafy-prepare-spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: rgba(242, 139, 60, 0.95);
    animation: chromafy-spin 0.85s linear infinite;
}

@keyframes chromafy-spin {
    to {
        transform: rotate(360deg);
    }
}

.chromafy-mode-grid {
    display: grid;
    gap: 8px;
}

.chromafy-toggle-card,
.chromafy-mode-card {
    position: relative;
    display: grid;
    gap: 4px;
    padding: 10px 11px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.chromafy-toggle-card:hover,
.chromafy-mode-card:hover {
    border-color: rgba(242, 139, 60, 0.28);
    transform: translateY(-1px);
}

.chromafy-toggle-card input,
.chromafy-mode-card input {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}

.chromafy-toggle-card span,
.chromafy-mode-card span {
    font-weight: 700;
    font-size: 0.84rem;
    color: #f1f5fb;
}

.chromafy-mode-card small {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.25;
}

.chromafy-toggle-card:has(input:checked),
.chromafy-mode-card:has(input:checked) {
    border-color: rgba(242, 139, 60, 0.68);
    background:
        linear-gradient(180deg, rgba(242, 139, 60, 0.12), rgba(255, 255, 255, 0.02)),
        rgba(255, 255, 255, 0.03);
    box-shadow: 0 0 0 1px rgba(242, 139, 60, 0.18);
}

.chromafy-mode-note {
    display: grid;
    gap: 8px;
    padding: 10px 11px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.025);
}

.chromafy-mode-note strong {
    font-size: 0.84rem;
}

.chromafy-note-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.28;
}

.chromafy-prepared-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 10px;
}

.chromafy-frame-card {
    padding: 10px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.025);
}

.chromafy-frame-card strong {
    font-size: 0.82rem;
}

.chromafy-frame-media {
    min-height: 118px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.chromafy-frame-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.chromafy-frame-placeholder {
    color: var(--muted);
    font-size: 0.76rem;
    text-align: center;
    padding: 12px;
}

.chromafy-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.chromafy-summary-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(242, 139, 60, 0.22);
    background: rgba(242, 139, 60, 0.1);
    color: #ffd1aa;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.demo-effect-screen-chromafy .chromafy-prompt-panel textarea {
    min-height: 184px;
}

.demo-effect-screen-chromafy .chromafy-render-panel .field textarea,
.demo-effect-screen-chromafy .chromafy-render-panel .field input[type="text"] {
    min-height: 0;
}

.demo-effect-workspace-car360 {
    padding: 8px;
    gap: 6px;
}

.car360-browser-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.58fr) minmax(250px, 0.56fr);
    gap: 8px;
    min-height: 0;
}

.car360-browser-main,
.car360-browser-review {
    min-height: 0;
}

.car360-browser-main {
    display: grid;
}

.car360-grid-panel {
    display: grid;
    align-content: start;
    gap: 6px;
}

.car360-slot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
}

.car360-slot-card,
.car360-summary-panel {
    display: grid;
    align-content: start;
    gap: 4px;
}

.demo-effect-screen-car360 .demo-stage-panel {
    padding: 8px;
    border-radius: 16px;
}

.demo-effect-screen-car360 .recipe-panel-head {
    margin-bottom: 4px;
}

.demo-effect-screen-car360 .recipe-panel-head h2 {
    font-size: 0.84rem;
    margin-bottom: 2px;
    line-height: 1.08;
}

.demo-effect-screen-car360 .recipe-panel-note {
    font-size: 0.66rem;
    line-height: 1.12;
}

.car360-slot-card .recipe-panel-note {
    display: none;
}

/* Slot card header: eyebrow + title on one compact line */
.car360-slot-card > div {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.car360-slot-card > div .eyebrow {
    font-size: 0.6rem;
    opacity: 0.55;
    white-space: nowrap;
    flex-shrink: 0;
}

.car360-slot-card > div h2 {
    font-size: 0.78rem;
    margin: 0;
    line-height: 1.1;
}

/* Hide drag instructions once image is loaded */
.demo-effect-screen-car360 .image-panel.has-preview .car360-dropzone-topline {
    display: none;
}

.demo-effect-screen-car360 .image-panel {
    min-height: 0;
    padding: 6px;
}

.demo-effect-screen-car360 .paste-box {
    min-height: 0;
    padding: 6px;
    border-radius: 14px;
}

.car360-dropzone {
    display: grid;
    gap: 4px;
}

.car360-dropzone-topline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.car360-dropzone-copy {
    display: grid;
    gap: 2px;
}

.car360-dropzone-copy strong {
    font-size: 0.68rem;
    line-height: 1.08;
}

.car360-dropzone-copy p {
    display: none;
}

.demo-effect-screen-car360 [data-file-input] {
    max-width: 180px;
    font-size: 0.72rem;
}

.demo-effect-screen-car360 .car360-guide-badge {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 8px;
    font-size: 0.68rem;
}

.demo-effect-screen-car360 .car360-v2-upload-status,
.demo-effect-screen-car360 .car360-v2-draw-status {
    font-size: 0.62rem;
    line-height: 1.12;
}

.demo-effect-screen-car360 .car360-v2-upload-status {
    display: none;
}

.demo-effect-screen-car360 .car360-v2-draw-status {
    display: none;
}

.demo-effect-screen-car360 .car360-v2-canvas-wrap {
    margin: 0 auto;
    width: min(100%, 200px) !important;
    height: min(100%, 200px) !important;
    min-height: 0 !important;
    max-height: 200px !important;
    aspect-ratio: 1 / 1 !important;
    padding: 6px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.embedded-only {
    display: none;
}

html.embedded-workspace .embedded-only {
    display: grid;
}

.demo-effect-screen-car360 .car360-v2-guide {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    display: grid;
    place-items: center;
}

.demo-effect-screen-car360 .car360-v2-guide-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
}

.demo-effect-screen-car360 .car360-v2-guide-text {
    display: none;
}

.demo-effect-screen-car360 .preview-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

.demo-effect-screen-car360 .draw-canvas {
    width: 100%;
    height: 100%;
    max-width: 100%;
}

.demo-effect-screen-car360 .panel-actions {
    display: none;
}

.demo-effect-screen-car360 .panel-actions .secondary-btn,
.demo-effect-screen-car360 .panel-actions .primary-btn {
    min-height: 34px;
    padding: 0 12px;
}

.car360-summary-list {
    gap: 4px;
}

.car360-summary-list article {
    padding: 6px 8px;
}

.car360-summary-list strong {
    font-size: 0.74rem;
}

.car360-summary-list span {
    font-size: 0.64rem;
    line-height: 1.16;
}

.car360-recipe-notes {
    display: grid;
    gap: 5px;
    padding: 7px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.024);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.car360-recipe-notes strong {
    font-size: 0.76rem;
}

.car360-note-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    display: grid;
    gap: 4px;
    font-size: 0.64rem;
    line-height: 1.16;
}

html.embedded-workspace .demo-effect-topbar,
html.embedded-workspace .workspace-shelf,
html.embedded-workspace .demo-recipe-dock {
    display: none !important;
}

html.embedded-workspace .demo-effect-shell,
html.embedded-workspace .demo-effect-screen {
    height: auto;
    min-height: 100%;
}

html.embedded-workspace .demo-effect-screen {
    grid-template-rows: minmax(0, 1fr);
    padding: 0;
    gap: 0;
    overflow: visible;
}

html.embedded-workspace .demo-effect-workspace {
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 6px;
}

/* ── Embedded iframe: one type rhythm (labels → titles → notes → controls) ─ */
html.embedded-workspace .demo-effect-browser-head {
    margin: 0 0 2px;
    padding: 0;
}

html.embedded-workspace .demo-effect-browser-title {
    align-items: center;
    gap: 10px;
}

html.embedded-workspace .demo-effect-browser-title .eyebrow {
    margin: 0;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--muted);
    opacity: 0.72;
}

html.embedded-workspace .demo-effect-browser-title h1 {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -0.02em;
}

html.embedded-workspace .demo-effect-screen .demo-stage-panel {
    padding: 10px 12px;
}

html.embedded-workspace .demo-effect-workspace .recipe-panel-head {
    margin-bottom: 8px;
    gap: 10px;
    align-items: flex-start;
}

html.embedded-workspace .demo-effect-workspace .recipe-panel-head .eyebrow,
html.embedded-workspace .demo-effect-workspace .demo-stage-panel > .eyebrow {
    margin: 0 0 3px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.11em;
}

html.embedded-workspace .demo-effect-workspace .recipe-panel-head h2,
html.embedded-workspace .demo-effect-workspace .demo-stage-panel > h2 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.28;
}

html.embedded-workspace .demo-effect-workspace .recipe-panel-note,
html.embedded-workspace .demo-effect-workspace .demo-stage-panel > p.muted {
    margin: 0 0 8px;
    font-size: 0.8rem;
    line-height: 1.42;
    max-width: none;
}

html.embedded-workspace .demo-effect-workspace .demo-stage-panel > p.muted:last-child {
    margin-bottom: 0;
}

html.embedded-workspace .demo-effect-screen .image-panel {
    padding: 10px;
}

html.embedded-workspace .demo-effect-workspace .paste-box {
    padding: 10px 12px;
    min-height: 0;
}

html.embedded-workspace .demo-effect-workspace .paste-box--shelf-compact {
    padding: 8px 10px;
}

html.embedded-workspace .shelf-dropzone-compact-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
}

html.embedded-workspace .shelf-dropzone-compact-row--with-hint {
    margin-top: 2px;
}

html.embedded-workspace .shelf-dropzone-status {
    font-size: 0.78rem;
    line-height: 1.3;
    flex: 1 1 auto;
    min-width: 0;
}

html.embedded-workspace .shelf-dropzone-hint {
    margin: 0 0 2px;
    font-size: 0.78rem;
    line-height: 1.35;
}

html.embedded-workspace .panel-file-browse-btn--inline {
    margin-top: 0;
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.78rem;
    flex: 0 0 auto;
}

html.embedded-workspace .dropzone-copy--embedded {
    gap: 0;
}

html.embedded-workspace .demo-effect-workspace .dropzone-copy {
    gap: 6px;
}

html.embedded-workspace .demo-effect-workspace .dropzone-copy p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.42;
}

html.embedded-workspace .demo-effect-workspace .dropzone-copy p strong {
    font-size: 0.84rem;
    font-weight: 600;
}

html.embedded-workspace .demo-effect-workspace .canvas-wrap {
    margin-top: 8px;
}

html.embedded-workspace .relite-ref-card .thumb-title {
    font-size: 0.7rem;
    margin-top: 3px;
}

html.embedded-workspace .relite-mode-card strong {
    font-size: 0.88rem;
    line-height: 1.2;
}

html.embedded-workspace .relite-mode-card small {
    font-size: 0.72rem;
    line-height: 1.32;
}

html.embedded-workspace .step-panel-summary {
    padding: 10px 12px;
    gap: 10px;
}

html.embedded-workspace .step-panel-summary .eyebrow {
    margin: 0 0 3px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.11em;
}

html.embedded-workspace .step-panel-summary h2 {
    font-size: 1.05rem;
    line-height: 1.28;
    font-weight: 700;
}

html.embedded-workspace .step-panel-note {
    margin-top: 4px;
    font-size: 0.8rem;
    line-height: 1.42;
}

html.embedded-workspace .step-panel-body {
    padding: 0 12px 12px;
}

html.embedded-workspace .step-state-pill {
    min-height: 24px;
    padding: 0 10px;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
}

@media (max-width: 1380px) {
    .demo-effect-title-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .demo-effect-nav {
        justify-content: start;
    }

    .demo-effect-topbar-note {
        max-width: none;
    }

    .demo-effect-browser-head {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .demo-effect-browser-note {
        max-width: none;
        text-align: left;
    }

    .demo-effect-grid {
        grid-template-columns: minmax(300px, 0.92fr) minmax(360px, 1fr) minmax(300px, 0.78fr);
    }

    .demo-effect-screen-demo1 .demo-effect-title-row-compact,
    .demo-effect-screen-demo1 .demo1-browser-grid,
    .demo-effect-screen-chromafy .demo-effect-title-row-compact,
    .demo-effect-screen-chromafy .chromafy-browser-grid,
    .demo-effect-screen-chromafy .chromafy-setup-band,
    .demo-effect-screen-chromafy .chromafy-review-grid,
    .demo-effect-screen-chromafy .chromafy-choice-grid,
    .demo-effect-screen-car360 .demo-effect-title-row-compact,
    .demo-effect-screen-car360 .car360-browser-grid,
    .demo-effect-screen-car360 .car360-slot-grid,
    .demo-effect-screen-demo2 .demo2-browser-grid,
    .demo-effect-screen-demo2 .demo2-review-grid,
    .demo-effect-screen-texturize .texturize-browser-grid {
        grid-template-columns: 1fr;
    }

    .demo-effect-screen-demo1 .demo-effect-title-stages,
    .demo-effect-screen-chromafy .demo-effect-title-stages,
    .demo-effect-screen-car360 .demo-effect-title-stages,
    .demo-effect-screen-demo2 .demo-effect-title-stages {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .demo1-browser-prompt {
        grid-template-rows: auto;
    }
}

@media (max-width: 1180px) {
    .demo-effect-shell,
    .demo-effect-screen {
        height: auto;
        overflow: visible;
    }

    .demo-effect-screen {
        grid-template-rows: auto;
    }

    .demo-effect-workspace {
        grid-template-rows: auto;
        overflow: visible;
    }

    .demo-effect-grid {
        grid-template-columns: 1fr;
    }

    .demo-effect-column {
        overflow: visible;
        padding-right: 0;
    }

    .demo-effect-stagebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .demo-effect-screen-demo1 .demo-effect-inline-progress,
    .demo-effect-screen-chromafy .demo-effect-inline-progress,
    .demo-effect-screen-car360 .demo-effect-inline-progress,
    .demo-effect-screen-demo2 .demo-effect-inline-progress {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .demo-effect-screen {
        padding: 8px 8px 14px;
    }

    .demo-effect-title-row h1 {
        font-size: 1.8rem;
    }

    .demo-effect-stagebar {
        grid-template-columns: 1fr;
    }

    .demo-effect-screen .dropzone-layout {
        grid-template-columns: 1fr;
    }

    .demo-effect-choice-copy {
        display: grid;
    }

    .demo-effect-screen-demo1 .demo-effect-title-stages,
    .demo-effect-screen-demo1 .demo-effect-inline-progress,
    .demo-effect-screen-chromafy .demo-effect-title-stages,
    .demo-effect-screen-chromafy .demo-effect-inline-progress,
    .demo-effect-screen-car360 .demo-effect-title-stages,
    .demo-effect-screen-car360 .demo-effect-inline-progress,
    .demo-effect-screen-demo2 .demo-effect-title-stages,
    .demo-effect-screen-demo2 .demo-effect-inline-progress {
        grid-template-columns: 1fr;
    }

    .demo-effect-screen-demo1 .demo-effect-title-render,
    .demo-effect-screen-chromafy .demo-effect-title-render,
    .demo-effect-screen-car360 .demo-effect-title-render,
    .demo-effect-screen-demo2 .demo-effect-title-render {
        display: grid;
    }
}

/* Demo 1-style green-ready states for mini stages */
.demo-effect-mini-stage.is-ready {
    border-color: rgba(88, 214, 141, 0.35);
    background: linear-gradient(180deg, rgba(88,214,141,0.14), rgba(255,255,255,0.02));
    box-shadow: inset 0 0 0 1px rgba(88,214,141,0.08);
}

.demo-effect-mini-stage.is-ready .eyebrow,
.demo-effect-mini-stage.is-ready strong {
    color: #c9f7dd;
}

.demo-effect-stagecard.is-ready .demo-effect-stagecheck::before {
    content: "✓";
}

.chromafy-btn-spinner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════
   DEMO 1 V2 — clean grid layout, d1- namespace
   All rules scoped to .d1-workspace or .d1-* to avoid old-rule conflicts.
═══════════════════════════════════════════════════════════════════════ */

/* Demo1 screen: grow with content so the iframe resizer can expand it */
.demo-effect-screen-demo1 {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto auto auto;
    overflow: visible;
}

/* Workspace root — all rows auto so content dictates height */
.d1-workspace {
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 8px;
    padding: 8px 12px;
    overflow: visible;
}

.d1-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 0 2px;
}
.d1-title .eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: inherit;
    opacity: 0.55;
    white-space: nowrap;
    flex-shrink: 0;
}
.d1-title h1 {
    font-size: 1.3rem;
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
}

/* TOP ROW — Product (left) + Scenes wide (right) */
.d1-top-area {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(0, 3.5fr);
    gap: 10px;
    min-height: 180px;
    height: 28vh;
    max-height: 320px;
}

/* BOTTOM ROW — Description | Prompt | Render */
.d1-bottom-area {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

/* Stack description textarea + new AI panel in first column */
.d1-bottom-col-desc {
    display: grid;
    gap: 12px;
    align-content: start;
    min-width: 0;
}

.d1-ai-describe-v2 h2 {
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.d1-ai-describe-v2-actions {
    flex-wrap: wrap;
}

.d1-ai-file-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.d1-ai-describe-v2-status {
    margin: 8px 0 0;
    font-size: 0.8rem;
    line-height: 1.35;
    min-height: 1.2em;
}

/* Shared column base */
.d1-col {
    min-height: 0;
    overflow: hidden;
}

/* ── Column 1: Product image ─────────────────────────────────────── */

.d1-source-col {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 4px;
    padding: 10px;
    align-self: stretch;
}

.d1-note {
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0;
}

/* The image well fills the 1fr row */
.d1-image-well {
    min-height: 0;
    overflow: hidden;
    position: relative;
}

/* The image zone fills the well completely */
.d1-image-zone {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    border: 2px dashed rgba(72, 200, 230, 0.28);
    background: rgba(72, 200, 230, 0.04);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.18s ease, background 0.18s ease;
    outline: none;
}

.d1-image-zone:focus,
.d1-image-zone.is-drop-target {
    border-color: rgba(72, 199, 102, 0.7);
    background: rgba(72, 199, 102, 0.06);
}

/* Drop prompt — centered placeholder text */
.d1-drop-prompt {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.38);
    pointer-events: none;
    line-height: 1.5;
}
.d1-image-zone.has-preview .d1-drop-prompt {
    display: none;
}

/* Preview image — fills zone, hidden until loaded */
.d1-preview {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
    padding: 8px;
    box-sizing: border-box;
}
.d1-image-zone.has-preview .d1-preview {
    display: block;
}

/* Canvas — hidden for demo1 (drawing disabled) */
.d1-draw-canvas {
    display: none;
}

/* ── Bottom row panels ───────────────────────────────────────────── */

.d1-description-panel,
.d1-prompt-panel,
.d1-render-panel {
    padding: 8px 10px;
    display: grid;
    gap: 5px;
    align-content: start;
}

.d1-description-panel textarea,
.d1-prompt-panel textarea {
    resize: vertical;
    min-height: 48px;
    font-size: 0.84rem;
    line-height: 1.4;
}

.d1-accept-prompt-btn {
    padding: 6px 14px;
    font-size: 0.82rem;
}

.d1-prompt-panel textarea {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.76rem;
}

/* ── Column 3: Scene chooser ────────────────────────────────────── */

.d1-scenes-col {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 4px;
    padding: 10px;
    align-self: stretch;
    overflow: hidden;
}

.d1-scenes-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    scrollbar-width: thin;
    padding-right: 2px;
}

.d1-scenes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 160px);
    gap: 8px;
    align-content: start;
}

.d1-scene-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.d1-scene-card .thumb-title {
    font-size: 0.65rem;
    font-weight: 600;
    margin: 3px 0 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── ReLite AI-Fy ─────────────────────────────────────────────── */
.relite-browser-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.55fr);
    gap: 12px;
    align-items: start;
}

.relite-browser-main {
    display: grid;
    gap: 12px;
}

.relite-browser-review {
    display: grid;
    gap: 12px;
    align-content: start;
}

/* Larger product image drop area */
.demo-effect-screen-relite .relite-upload-panel .canvas-wrap {
    min-height: 280px;
}

.demo-effect-screen-relite .relite-upload-panel .preview-image {
    max-width: 100%;
    max-height: 420px;
    object-fit: contain;
}

/* Embedded in menu iframe: keep step 1 usable but leave room for lighting refs + sidebar */
html.embedded-workspace .demo-effect-screen-relite .relite-upload-panel .canvas-wrap {
    min-height: 140px;
}

html.embedded-workspace .demo-effect-screen-relite .relite-upload-panel .preview-image {
    max-height: min(240px, 38vh);
}

html.embedded-workspace .demo-effect-screen-relite .relite-browser-grid {
    gap: 8px;
}

html.embedded-workspace .demo-effect-screen-relite .relite-browser-main {
    gap: 8px;
}

html.embedded-workspace .demo-effect-screen-relite .relite-browser-review {
    gap: 8px;
}

html.embedded-workspace .demo-effect-screen-relite .relite-summary-panel,
html.embedded-workspace .demo-effect-screen-relite .relite-mode-panel,
html.embedded-workspace .demo-effect-screen-relite .relite-pose-panel {
    gap: 8px;
}

/* Lighting reference thumbnail grid */
.relite-ref-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
    gap: 8px !important;
}

.relite-ref-card {
    padding: 6px !important;
}

.relite-ref-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.relite-ref-card .thumb-title {
    font-size: 0.68rem;
    text-align: center;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Render sidebar panel */
.relite-summary-panel {
    display: grid;
    gap: 12px;
    align-content: start;
}

/* Background mode + pose mode cards */
.relite-mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.relite-mode-grid--col1 {
    grid-template-columns: 1fr;
}

.relite-mode-card {
    display: grid;
    gap: 4px;
    padding: 10px 12px !important;
    cursor: pointer;
}

.relite-mode-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.relite-mode-card strong {
    font-size: 0.82rem;
    display: block;
}

.quality-cost-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--accent, #7c6bef);
    opacity: 0.85;
    white-space: nowrap;
}


.relite-mode-card small {
    font-size: 0.71rem;
    color: var(--muted, #888);
    display: block;
    line-height: 1.4;
}

.relite-mode-card:has(input:checked) {
    border-color: var(--accent, #4ade80);
    background: rgba(74, 222, 128, 0.06);
}

.relite-mode-card:has(input:checked) strong {
    color: var(--accent, #4ade80);
}

/* ============================================================
   matrix-aifi-it
   ============================================================ */

.demo-effect-workspace-matrix {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.matrix-browser-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.5fr);
    gap: 16px;
    align-items: start;
}

.matrix-browser-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.matrix-browser-review {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 16px;
}

.matrix-upload-panel .canvas-wrap {
    min-height: 260px;
}

.matrix-upload-panel .preview-image {
    max-height: 360px;
    object-fit: contain;
}

.matrix-pipeline-panel ol.matrix-pipeline-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 0;
    list-style: none;
    counter-reset: step;
    margin-top: 12px;
}

.matrix-pipeline-steps li {
    counter-increment: step;
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 6px 10px;
    align-items: start;
}

.matrix-pipeline-steps li::before {
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    background: rgba(74, 222, 128, 0.15);
    color: var(--accent, #4ade80);
    border: 1px solid rgba(74, 222, 128, 0.35);
    flex-shrink: 0;
    margin-top: 1px;
}

.matrix-pipeline-steps li strong {
    grid-column: 2;
    font-size: 13px;
    font-weight: 600;
}

.matrix-pipeline-steps li span {
    grid-column: 2;
    font-size: 12px;
    color: var(--text-muted, #888);
    line-height: 1.4;
}

.matrix-pipeline-note {
    font-size: 12px;
    line-height: 1.5;
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(74, 222, 128, 0.05);
    border-left: 2px solid rgba(74, 222, 128, 0.3);
    border-radius: 3px;
}

/* ============================================================
   dunk-aifi-it
   ============================================================ */

/* ── Dunk confirm page ─────────────────────────────── */

.dunk-confirm-workspace {
    padding: 14px 24px 16px;
}

.dunk-confirm-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    align-items: start;
    max-width: 860px;
}

@media (max-width: 640px) {
    .dunk-confirm-layout {
        grid-template-columns: 1fr;
    }
}

.dunk-confirm-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dunk-confirm-img {
    width: 100%;
    border-radius: 10px;
    object-fit: contain;
    background: #0d0f12;
    border: 1px solid rgba(255,255,255,0.08);
}

.dunk-confirm-heading {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 4px 0 6px;
}

.dunk-confirm-lede {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin: 0 0 16px;
    line-height: 1.5;
}

.dunk-confirm-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.dunk-confirm-field-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255,255,255,0.5);
}

.dunk-confirm-textarea {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #fff;
    font-size: 0.875rem;
    padding: 10px 12px;
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

.dunk-confirm-textarea:focus {
    outline: none;
    border-color: rgba(242, 139, 60, 0.5);
}

.dunk-confirm-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.dunk-confirm-settings {
    display: flex;
    gap: 8px;
    font-size: 0.75rem;
}

.dunk-confirm-details {
    padding-top: 4px;
}

/* ── Dunk workspace ─────────────────────────────────── */

.demo-effect-workspace-dunk {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Dunk 3-column layout ──────────────────────────────────────────────── */
.dunk-3col-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(240px, 0.85fr);
    gap: 16px;
    align-items: start;
}

.dunk-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dunk-col-settings {
    position: sticky;
    top: 16px;
}

/* Make the describe panel fill available height so textarea can stretch */
.dunk-col-prompt {
    align-self: stretch;
}

.dunk-col-fill {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dunk-detect-body-tall {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dunk-desc-textarea-tall {
    flex: 1;
    min-height: 160px;
    resize: none;
}

.dunk-upload-panel .canvas-wrap {
    min-height: 260px;
}

.dunk-upload-panel .preview-image {
    max-height: 420px;
    object-fit: contain;
}

.dunk-pipeline-panel ol.dunk-pipeline-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 0;
    list-style: none;
    counter-reset: step;
    margin-top: 12px;
}

.dunk-pipeline-steps li {
    counter-increment: step;
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 6px 10px;
    align-items: start;
}

.dunk-pipeline-steps li::before {
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    flex-shrink: 0;
    margin-top: 1px;
}

.dunk-pipeline-steps li strong {
    grid-column: 2;
    font-size: 13px;
    font-weight: 600;
}

.dunk-pipeline-steps li span {
    grid-column: 2;
    font-size: 12px;
    color: var(--text-muted, #888);
    line-height: 1.4;
}

.dunk-pipeline-note {
    font-size: 12px;
    line-height: 1.5;
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(56, 189, 248, 0.05);
    border-left: 2px solid rgba(56, 189, 248, 0.3);
    border-radius: 3px;
}

/* ── Dunk inline UX ──────────────────────────────────────────────────────── */
@media (max-width: 860px) {
    .dunk-3col-grid {
        grid-template-columns: 1fr;
    }
    .dunk-col-settings {
        position: static;
    }
    .dunk-col-prompt {
        align-self: auto;
    }
    .dunk-desc-textarea-tall {
        min-height: 120px;
    }
}

.dunk-detect-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.dunk-detect-spinner-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted, #888);
}

.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(56, 189, 248, 0.3);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.dunk-detect-error {
    font-size: 12px;
    color: #f87171;
}

.dunk-desc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.dunk-desc-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.dunk-autodetect-btn {
    font-size: 12px;
    padding: 5px 12px;
    white-space: nowrap;
}

.dunk-desc-textarea {
    width: 100%;
    min-height: 90px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: inherit;
    font-size: 13px;
    line-height: 1.5;
    padding: 8px 10px;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

.dunk-desc-textarea:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.5);
    background: rgba(56, 189, 248, 0.04);
}

.dunk-desc-textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.recipe-state-pill-ok {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.35);
}

.dunk-render-panel ol.dunk-pipeline-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 0;
    list-style: none;
    counter-reset: step;
    margin-top: 12px;
}

/* ============================================================
   backdrop-aifi-it
   ============================================================ */

.demo-effect-workspace-backdrop {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.backdrop-browser-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.5fr);
    gap: 16px;
    align-items: start;
}

.backdrop-browser-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.backdrop-browser-review {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 16px;
}

.backdrop-upload-panel .canvas-wrap,
.backdrop-custombg-upload-panel .canvas-wrap {
    min-height: 240px;
}

.backdrop-upload-panel .preview-image,
.backdrop-custombg-upload-panel .preview-image {
    max-height: 320px;
    object-fit: contain;
}

/* Source toggle tabs */
.backdrop-source-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.backdrop-source-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid var(--border, rgba(255,255,255,0.12));
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    color: var(--text-muted, #888);
}

.backdrop-source-tab input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.backdrop-source-tab.active,
.backdrop-source-tab:has(input:checked) {
    border-color: var(--accent, #4ade80);
    background: rgba(74, 222, 128, 0.08);
    color: var(--accent, #4ade80);
}

/* Background scene grid */
.backdrop-scenes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.backdrop-scene-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 4px !important;
}

.backdrop-scene-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 4px;
}

.backdrop-scene-card:has(input:checked) {
    border-color: var(--accent, #4ade80);
    background: rgba(74, 222, 128, 0.06);
}

.backdrop-scene-card:has(input:checked) .thumb-title {
    color: var(--accent, #4ade80);
}

.backdrop-pipeline-note {
    font-size: 12px;
    line-height: 1.5;
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(74, 222, 128, 0.05);
    border-left: 2px solid rgba(74, 222, 128, 0.3);
    border-radius: 3px;
}

/* ===========================================================================
   muzzleflash-aifi
   =========================================================================== */

/* Upload page */
.mf-browser-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 16px;
    align-items: start;
}
@media (max-width: 900px) {
    .mf-browser-grid { grid-template-columns: 1fr; }
}

.mf-file-drop {
    display: block;
    border: 2px dashed rgba(255,255,255,0.18);
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-top: 12px;
}
.mf-file-drop:hover, .mf-file-drop.drag-over {
    border-color: rgba(249,115,22,0.7);
    background: rgba(249,115,22,0.06);
}
.mf-file-drop.has-file { border-color: rgba(74,222,128,0.5); background: rgba(74,222,128,0.04); }
.mf-drop-label { margin: 8px 0 4px; font-size: 0.95em; }
.mf-drop-meta  { font-size: 0.82em; margin-top: 4px; }
.mf-style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }

/* Review page */
.mf-review-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 16px;
    padding: 16px;
    height: calc(100vh - 56px);
    overflow: hidden;
}
@media (max-width: 1000px) {
    .mf-review-layout { grid-template-columns: 1fr; height: auto; overflow: visible; }
}
.mf-review-player-col { overflow-y: auto; }
.mf-review-shots-col  { overflow: hidden; display: flex; flex-direction: column; }
.mf-review-shots-col .mf-shots-panel { flex: 1; }

.mf-player-panel { display: flex; flex-direction: column; gap: 10px; }
.mf-filename     { font-size: 0.9em; font-weight: 600; word-break: break-all; }
.mf-meta         { font-size: 0.8em; }

.mf-video-wrapper {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
}
.mf-video-wrapper video {
    width: 100%; height: 100%; object-fit: contain; display: block;
}
#mf-frame-marker-overlay {
    position: absolute; inset: 0; pointer-events: none;
}

.mf-player-controls {
    display: flex; align-items: center; gap: 10px;
}
.mf-scrubber-wrap { flex: 1; }
.mf-scrubber { width: 100%; accent-color: #f97316; }
.mf-timecode { font-size: 0.82em; font-variant-numeric: tabular-nums; min-width: 90px; }
.mf-frame-nav { display: flex; align-items: center; gap: 8px; font-size: 0.85em; }

/* Shot list */
.mf-shots-panel { display: flex; flex-direction: column; gap: 0; height: 100%; overflow: hidden; }
.mf-shots-header { padding-bottom: 10px; flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; }
.mf-shot-list   { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 0; padding-bottom: 4px; }
.mf-shots-footer {
    flex-shrink: 0;
    padding-top: 12px;
    margin-top: 4px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.mf-shot-row {
    display: flex; align-items: center; gap: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px; padding: 8px 10px;
    transition: border-color 0.2s;
}
.mf-shot-row.approved { border-color: rgba(249,115,22,0.4); }
.mf-shot-row:hover    { border-color: rgba(255,255,255,0.2); }

.mf-shot-thumb { width: 60px; height: 40px; flex-shrink: 0; border-radius: 4px; overflow: hidden; cursor: pointer; }
.mf-shot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mf-shot-thumb-placeholder {
    width: 100%; height: 100%; background: rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72em; color: rgba(255,255,255,0.4);
}
.mf-shot-info { flex: 1; font-size: 0.82em; display: flex; flex-direction: column; gap: 1px; cursor: pointer; }
.mf-shot-info strong { font-size: 0.95em; }
.mf-gun-tag {
    display: inline-block; padding: 1px 6px; border-radius: 4px;
    background: rgba(249,115,22,0.15); color: #f97316;
    font-size: 0.78em; font-weight: 600;
}
.mf-confidence { font-size: 0.75em; color: rgba(255,255,255,0.45); }

.mf-shot-actions { display: flex; gap: 4px; flex-shrink: 0; }
.mf-shot-actions button {
    width: 26px; height: 26px; border-radius: 5px; border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7);
    cursor: pointer; font-size: 0.82em; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.mf-shot-actions button:hover { background: rgba(255,255,255,0.12); }
.mf-shot-approve-btn.active  { background: rgba(249,115,22,0.25); color: #f97316; border-color: #f97316; }

/* Setup page */
.mf-setup-header { margin: 8px 16px; }
.mf-setup-footer { margin: 0 16px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mf-setup-footer .button-row { margin-left: auto; }

.mf-setup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 0 16px 16px;
}

.mf-setup-card { display: flex; flex-direction: column; gap: 10px; }
.mf-setup-card-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.88em; }
.mf-setup-card-header strong { font-size: 1em; }

.mf-setup-frame-wrap { border-radius: 8px; overflow: hidden; position: relative; }
.mf-setup-frame-img  { width: 100%; display: block; border-radius: 8px; user-select: none; }
.mf-muzzle-overlay   { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.mf-muzzle-handle    { cursor: grab; }
.mf-muzzle-handle:active { cursor: grabbing; }
.mf-bbox             { pointer-events: none; }

.mf-setup-card-controls { display: flex; flex-direction: column; gap: 6px; font-size: 0.85em; }
.mf-slider-row { display: flex; align-items: center; gap: 8px; }
.mf-slider-row input[type=range] { flex: 1; accent-color: #f97316; }
.mf-intensity-val { min-width: 34px; font-size: 0.85em; font-variant-numeric: tabular-nums; }
.mf-barrel-angle  { font-size: 0.78em; }

/* ==========================================================================
   season-aifi-it
   ========================================================================== */

.demo-effect-workspace-season {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.season-browser-grid {
    display: grid;
    grid-template-columns: minmax(200px, 1.2fr) minmax(0, 2fr) minmax(200px, 1.2fr);
    gap: 12px;
    align-items: start;
}

@media (max-width: 900px) {
    .season-browser-grid {
        grid-template-columns: 1fr;
    }
}

/* Upload column */
.season-browser-main {}

.season-upload-panel {}

/* Season + message column */
.season-browser-options {}

.season-season-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.season-note {
    font-size: 0.82rem;
    margin: 0;
    line-height: 1.4;
}

/* Season picker cards */
.season-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.season-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
    text-align: center;
}

.season-card input[type="radio"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    margin: 0;
    z-index: 1;
}

.season-card:hover {
    border-color: rgba(242,139,60,0.3);
    background: rgba(242,139,60,0.05);
}

.season-card:has(input:checked) {
    border-color: rgba(242,139,60,0.55);
    background: rgba(242,139,60,0.09);
    box-shadow: 0 0 0 1px rgba(242,139,60,0.2);
}

.season-card-emoji {
    font-size: 2rem;
    line-height: 1;
    pointer-events: none;
}

.season-card-label {
    font-size: 0.82rem;
    font-weight: 600;
    pointer-events: none;
    color: var(--text);
}

/* Message input */
.season-message-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.season-message-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.18s;
    box-sizing: border-box;
}

.season-message-input:focus {
    border-color: rgba(242,139,60,0.5);
}

.season-message-input::placeholder {
    color: rgba(255,255,255,0.3);
}

.season-char-hint {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    margin: 0;
}

/* Render column */
.season-browser-render {}

.season-render-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Pipeline note */
.season-pipeline-note {
    font-size: 0.8rem;
    line-height: 1.5;
}

.season-pipeline-steps {
    margin: 6px 0 4px;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.78rem;
}

/* Quality radio cards reuse relite-mode-card patterns */
.relite-mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 6px;
}

.relite-mode-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    font-size: 0.85rem;
}

.relite-mode-card strong {
    font-size: 0.9rem;
}

.relite-mode-card small {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
    font-weight: 400;
}

/* ── Auth pages (login / signup) ─────────────────────────────────────────── */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 32px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.auth-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--accent);
    color: #111318;
    border-radius: 8px;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.auth-brand-word {
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f7f0e7;
}

.auth-title {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
}

.auth-lede {
    margin: -10px 0 0;
    font-size: 0.88rem;
}

.auth-error {
    margin: 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(220, 60, 60, 0.14);
    border: 1px solid rgba(220, 60, 60, 0.3);
    color: #ffb3b3;
    font-size: 0.88rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 600;
}

/* ── Insufficient-credits global banner ──────────────────────────────────── */
.global-credits-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(90deg, rgba(242,139,60,0.96) 0%, rgba(220,90,30,0.96) 100%);
    color: #111318;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}
.global-credits-banner span { flex: 1; }
.global-credits-cta {
    background: rgba(0,0,0,0.18);
    color: #111318;
    padding: 5px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.82rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}
.global-credits-cta:hover { background: rgba(0,0,0,0.28); }
.global-credits-close {
    background: none; border: none; cursor: pointer;
    color: #111318; font-size: 1rem; padding: 2px 6px;
    opacity: 0.7; transition: opacity 0.15s;
}
.global-credits-close:hover { opacity: 1; }

.global-info-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(90deg, #2a7d4f 0%, #1e6040 100%);
    color: #e8f5ee;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}
.global-info-banner span { flex: 1; }
.global-info-banner .global-credits-close { color: #e8f5ee; }

/* ── First-login welcome banner ──────────────────────────────────────────── */
.global-welcome-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    background: linear-gradient(90deg, #5b3ddb 0%, #7c3aed 50%, #4f46e5 100%);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 20px rgba(91,61,219,0.45);
}
.global-welcome-banner span { flex: 1; }
.global-welcome-cta {
    background: rgba(255,255,255,0.18);
    color: #fff;
    padding: 5px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.82rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}
.global-welcome-cta:hover { background: rgba(255,255,255,0.28); }
.global-welcome-banner .global-credits-close { color: rgba(255,255,255,0.75); }
.global-welcome-banner .global-credits-close:hover { color: #fff; opacity: 1; }

/* ── Error flash banner ────────────────────────────────────────────────── */
.global-error-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
}
.global-error-banner span { flex: 1; }
.global-error-banner .global-credits-close { color: rgba(255,255,255,0.75); }

/* ── Success flash banner ──────────────────────────────────────────────── */
.global-success-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
}
.global-success-banner span { flex: 1; }
.global-success-banner .global-credits-close { color: rgba(255,255,255,0.75); }

/* ── AI upsell banner (free tool result pages) ─────────────────────────── */
.ai-upsell-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, rgba(242,139,60,0.08) 0%, rgba(242,139,60,0.02) 100%);
    border: 1px solid rgba(242,139,60,0.18);
    border-radius: 16px;
    padding: 18px 22px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.ai-upsell-sparkle { font-size: 1.8rem; flex-shrink: 0; }
.ai-upsell-body { flex: 1; min-width: 200px; }
.ai-upsell-head { margin: 0 0 2px; font-size: 0.92rem; font-weight: 700; color: var(--ink); }
.ai-upsell-text { margin: 0; font-size: 0.82rem; color: var(--muted); line-height: 1.5; }
.ai-upsell-text strong { color: var(--accent); }
.ai-upsell-cta {
    display: inline-block; padding: 8px 20px; border-radius: 10px;
    font-size: 0.85rem; font-weight: 700; text-decoration: none;
    background: var(--accent); color: #111318; white-space: nowrap;
    transition: background 0.15s;
}
.ai-upsell-cta:hover { background: var(--accent-dark); }

/* Sparkle badge on carousel cards for free tools with AI counterparts */
.demo-card-ai-badge {
    position: absolute; top: 6px; right: 6px; z-index: 3;
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; padding: 2px 7px; border-radius: 6px;
    background: rgba(242,139,60,0.85); color: #111318;
}

/* ── Plan badge on signup page ───────────────────────────────────────────── */
.auth-plan-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(42,125,79,0.12);
    border: 1px solid rgba(42,125,79,0.3);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.88rem;
    color: var(--ink);
}
.auth-plan-badge .plan-check {
    color: #2a7d4f;
    font-size: 1rem;
    font-weight: 900;
}

.auth-field input {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
    font: inherit;
    font-size: 0.94rem;
    transition: border-color 0.15s;
    outline: none;
}

.auth-field input::placeholder {
    color: rgba(255, 255, 255, 0.28);
}

.auth-field input:focus {
    border-color: rgba(242, 139, 60, 0.6);
    background: rgba(242, 139, 60, 0.04);
}

.auth-submit {
    width: 100%;
    margin-top: 4px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.78rem;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.auth-google-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.25);
}

.auth-footer {
    margin: 0;
    font-size: 0.84rem;
    text-align: center;
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ── Admin Dashboard ───────────────────────────────────────────────── */

/* Admin shell — top-nav layout */
.admin-shell-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg, #0e0e0e);
}

.admin-topbar {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0 1.75rem;
    height: 52px;
    background: var(--surface, #141414);
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}

.admin-topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: 0.5rem;
    white-space: nowrap;
}
.admin-topbar-mark {
    background: var(--accent, #7c6ff7);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.18em 0.45em;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

.admin-topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

/* ── Admin nav: Logs dropdown ── */
.admin-topbar-dropdown { position: relative; }
.admin-topbar-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    border: none;
    background: none;
    font: inherit;
}
.admin-dropdown-caret { width: 14px; height: 14px; }
.admin-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 160px;
    background: var(--surface-2, #1e1e24);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 0.5rem;
    padding: 0.35rem 0;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.admin-topbar-dropdown:hover .admin-dropdown-menu,
.admin-topbar-dropdown:focus-within .admin-dropdown-menu { display: block; }
.admin-dropdown-item {
    display: block;
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    color: rgba(255,255,255,.75);
    text-decoration: none;
    transition: background 0.12s;
}
.admin-dropdown-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-dropdown-item.is-active { color: var(--accent, #f28b3c); font-weight: 600; }

.admin-topbar-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    color: var(--muted, #888);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.admin-topbar-link svg { width: 15px; height: 15px; flex-shrink: 0; }
.admin-topbar-link:hover { background: rgba(255,255,255,0.06); color: var(--text, #eee); }
.admin-topbar-link.is-active { background: rgba(124,111,247,0.14); color: var(--accent, #7c6ff7); }

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.admin-topbar-home {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    border: 1px solid var(--border, rgba(255,255,255,0.12));
    color: var(--text, #eee);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.admin-topbar-home svg { width: 15px; height: 15px; flex-shrink: 0; }
.admin-topbar-home:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.22); }

.admin-main {
    padding: 2rem 2.5rem;
    flex: 1;
    overflow-y: auto;
}

.admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.admin-page-header h1 { font-size: 1.6rem; font-weight: 800; margin: 0 0 0.25rem; }
.admin-breadcrumb { color: var(--muted); text-decoration: none; font-size: 0.85rem; display: block; margin-bottom: 0.4rem; }
.admin-breadcrumb:hover { color: var(--text); }

.admin-flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.admin-flash--success { background: rgba(34,197,94,0.12); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.admin-flash--error   { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.admin-flash--info    { background: rgba(59,130,246,0.12); color: #93c5fd; border: 1px solid rgba(59,130,246,0.2); }

.admin-search-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    align-items: center;
}

.admin-search-input {
    flex: 1;
    max-width: 360px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 8px;
    color: var(--text);
    padding: 0.55rem 0.85rem;
    font-size: 0.9rem;
}

.admin-table-wrap { overflow-x: auto; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.admin-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
    color: var(--muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.admin-table th a { color: inherit; text-decoration: none; }
.admin-table th a:hover { color: var(--text); }

.admin-table td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.row-inactive td { opacity: 0.5; }
.admin-table-compact td, .admin-table-compact th { padding: 0.5rem 0.6rem; }

.admin-sort-arrow { font-size: 0.7rem; margin-left: 0.2rem; }

.admin-email-cell { display: flex; align-items: center; gap: 0.5rem; }
.admin-credits-cell { font-variant-numeric: tabular-nums; font-weight: 600; }
.admin-date-cell { color: var(--muted); font-size: 0.82rem; }
.admin-action-link { color: var(--accent, #e07b00); text-decoration: none; font-weight: 600; font-size: 0.82rem; }
.admin-action-link:hover { text-decoration: underline; }
.admin-empty { color: var(--muted); padding: 2rem; text-align: center; }
.admin-credit-pos { color: #4ade80; font-weight: 600; }
.admin-credit-neg { color: #f87171; font-weight: 600; }

.admin-badge {
    background: rgba(224,123,0,0.18);
    color: var(--accent, #e07b00);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-status-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.18rem 0.6rem;
    border-radius: 20px;
}
.admin-status-pill.is-active   { background: rgba(34,197,94,0.15);  color: #4ade80; }
.admin-status-pill.is-inactive { background: rgba(239,68,68,0.12);  color: #f87171; }

.admin-pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
    justify-content: flex-end;
}

/* Secrets grid */
.admin-secrets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}
.admin-secret-card { padding: 1.25rem; border-radius: 10px; }
.admin-secret-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.admin-secret-head strong { font-size: .95rem; }
.admin-secret-status {
    font-size: .72rem; font-weight: 700; padding: .2em .6em;
    border-radius: 999px; white-space: nowrap; flex-shrink: 0;
}
.admin-secret-status.is-set     { background: rgba(34,197,94,.15); color: #4ade80; }
.admin-secret-status.is-missing { background: rgba(239,68,68,.15);  color: #f87171; }
.admin-secret-form { display: flex; flex-direction: column; gap: .6rem; }
.admin-secret-actions { display: flex; gap: .5rem; }
.admin-secret-clear-btn { color: #e05c5c !important; }

/* Create User panel */
.admin-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.admin-create-user-panel {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: 10px;
    animation: adminFadeIn .15s ease;
}
@keyframes adminFadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.admin-create-user-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .9rem 1.5rem;
    margin-top: 1rem;
}
.admin-form-row { display: flex; flex-direction: column; gap: .35rem; }
.admin-form-row--check { justify-content: flex-end; padding-top: 1.1rem; }
.admin-form-label { font-size: .78rem; font-weight: 600; letter-spacing: .04em; color: var(--text-muted, #888); text-transform: uppercase; }
.admin-required { color: #e05c5c; }
.admin-form-input {
    background: var(--bg, #0e0e0e);
    border: 1px solid var(--border, #1e1e1e);
    border-radius: 6px;
    color: var(--text, #eee);
    padding: .55rem .75rem;
    font-size: .88rem;
    outline: none;
    transition: border-color .15s;
    width: 100%;
}
.admin-form-input:focus { border-color: var(--accent, #7c6ff7); }
.admin-check-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .88rem;
    cursor: pointer;
    user-select: none;
}
.admin-form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: .75rem;
    padding-top: .5rem;
    border-top: 1px solid var(--border, #1e1e1e);
    margin-top: .25rem;
}

@media (max-width: 600px) {
    .admin-create-user-form { grid-template-columns: 1fr; }
}

/* User detail */
.admin-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.admin-detail-card { padding: 1.5rem; }
.admin-detail-card--full { grid-column: 1 / -1; }
.admin-section-title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 0 0 1rem; }

.admin-dl { display: grid; grid-template-columns: 130px 1fr; gap: 0.4rem 0.75rem; font-size: 0.88rem; margin-bottom: 1.25rem; }
.admin-dl dt { color: var(--muted); }
.admin-dl dd { margin: 0; word-break: break-all; }

.admin-inline-form { margin-top: 1rem; }
.admin-field-label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.4rem; }

.admin-inline-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-input {
    flex: 1;
    min-width: 120px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 8px;
    color: var(--text);
    padding: 0.5rem 0.75rem;
    font-size: 0.88rem;
}

.admin-input-narrow { max-width: 130px; flex: none; }

.admin-credit-balance {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.admin-credit-number {
    font-size: 2.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--accent, #e07b00);
}

.admin-credit-form { display: flex; flex-direction: column; gap: 0.75rem; }

.admin-preset-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.admin-preset-btn { font-size: 0.82rem; padding: 0.4rem 0.75rem; }

.admin-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-toggle-row:last-child { border-bottom: none; }
.admin-toggle-row p { margin: 0.15rem 0 0; font-size: 0.82rem; }
.admin-toggle-row strong { font-size: 0.9rem; }

.admin-toggle-btn {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.admin-toggle-btn.is-on  { background: rgba(34,197,94,0.18);  color: #4ade80; }
.admin-toggle-btn.is-off { background: rgba(255,255,255,0.08); color: var(--muted); }
.admin-toggle-btn:hover { opacity: 0.8; }

@media (max-width: 900px) {
    .admin-detail-grid { grid-template-columns: 1fr; }
    .admin-topbar { padding: 0 1rem; gap: 0.75rem; }
    .admin-topbar-brand strong { display: none; }
    .admin-main { padding: 1.25rem 1rem; }
}

/* ── Workspace Home / Launchpad Panel ──────────────────────────────── */

.workspace-home {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    padding: 2rem 2rem 3rem;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}
.workspace-home[hidden] { display: none !important; }

/* ── workspace-grid: hide rail + strip on the launchpad ────────────── */
.workspace-grid.is-home {
    grid-template-columns: 1fr;
}
.workspace-grid.is-home .shell-demo-strip,
.workspace-grid.is-home .shell-carousel-btn,
.workspace-grid.is-home .shell-demo-carousel {
    display: none;
}

/* ── AI Assistant panel (shared across free tools) ────────────────────── */
.ai-asst-panel {
    border-top: 1px solid rgba(255,255,255,.07);
    background: rgba(0,0,0,.18);
    padding: 18px 20px 14px;
}
.ai-asst-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}
.ai-asst-title {
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--accent, #f28b3c);
}
.ai-asst-cost {
    font-size: .65rem;
    font-weight: 600;
    color: var(--muted, #777);
}
.ai-asst-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.ai-asst-input {
    flex: 1;
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    color: var(--ink, #eee);
    font-size: .82rem;
    outline: none;
    transition: border-color .15s;
}
.ai-asst-input:focus {
    border-color: var(--accent, #f28b3c);
}
.ai-asst-input::placeholder {
    color: var(--muted, #555);
}
.ai-asst-go {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(242,139,60,.18), rgba(242,139,60,.08));
    border: 1px solid rgba(242,139,60,.3);
    color: var(--accent, #f28b3c);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.ai-asst-go:hover {
    background: rgba(242,139,60,.25);
    border-color: var(--accent);
}
.ai-asst-go:disabled {
    opacity: .35;
    pointer-events: none;
}
.ai-asst-label {
    font-size: .65rem;
    font-weight: 600;
    color: var(--muted, #666);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 8px;
}
.ai-asst-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
}
.ai-asst-chip {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    cursor: pointer;
    transition: all .15s;
    text-align: left;
}
.ai-asst-chip:hover {
    border-color: rgba(242,139,60,.35);
    background: rgba(242,139,60,.06);
    transform: translateY(-1px);
}
.ai-asst-chip-name {
    display: block;
    font-size: .78rem;
    font-weight: 700;
    color: var(--ink, #eee);
    margin-bottom: 3px;
}
.ai-asst-chip-desc {
    display: block;
    font-size: .68rem;
    color: var(--muted, #888);
    line-height: 1.4;
}
.ai-asst-chip.is-loading {
    pointer-events: none;
    opacity: .5;
    animation: ai-asst-pulse 1.2s ease-in-out infinite;
}
@keyframes ai-asst-pulse {
    0%, 100% { opacity: .5; }
    50% { opacity: .8; }
}
.ai-asst-chip.is-active {
    border-color: var(--accent, #f28b3c);
    background: rgba(242,139,60,.1);
}

/* AI Assistant — frosted unlock overlay */
.ai-asst-body {
    position: relative;
}
.ai-asst-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(10, 12, 18, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 10px;
    transition: opacity .3s ease;
}
.ai-asst-overlay-heading {
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--accent, #f28b3c);
}
.ai-asst-overlay-sub {
    font-size: .78rem;
    color: rgba(255,255,255,.7);
    text-align: center;
    line-height: 1.4;
    max-width: 280px;
}
.ai-asst-overlay-btn {
    margin-top: 6px;
    padding: 8px 28px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    border: 1px solid rgba(242,139,60,.4);
    background: linear-gradient(135deg, rgba(242,139,60,.2), rgba(242,139,60,.08));
    color: var(--accent, #f28b3c);
    cursor: pointer;
    transition: all .18s;
}
.ai-asst-overlay-btn:hover {
    background: rgba(242,139,60,.3);
    border-color: var(--accent);
    transform: scale(1.04);
}
.ai-asst-panel.is-unlocked .ai-asst-overlay {
    opacity: 0;
    pointer-events: none;
}

/* ── Changelog / What's new ───────────────────────────────────────────── */
.lp-changelog {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    overflow: hidden;
}
.lp-changelog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.lp-changelog-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted, #98a2b3);
}
.lp-changelog-toggle {
    background: none;
    border: none;
    color: var(--muted, #98a2b3);
    font-size: .65rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background .15s;
}
.lp-changelog-toggle:hover { background: rgba(255,255,255,.06); }
.lp-changelog-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}
.lp-cl-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 7px 16px;
    font-size: .78rem;
    color: rgba(255,255,255,.7);
    line-height: 1.4;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.lp-cl-item:last-child { border-bottom: none; }
.lp-cl-tag {
    flex-shrink: 0;
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 32px;
    text-align: center;
}
.lp-cl-new .lp-cl-tag  { background: rgba(72,199,102,.15);  color: #48c766; border: 1px solid rgba(72,199,102,.25); }
.lp-cl-fix .lp-cl-tag  { background: rgba(99,179,237,.12);  color: #63b3ed; border: 1px solid rgba(99,179,237,.22); }
.lp-cl-note .lp-cl-tag { background: rgba(255,200,60,.10);  color: #ffc83c; border: 1px solid rgba(255,200,60,.2); }
.lp-cl-gone .lp-cl-tag { background: rgba(252,129,74,.10);  color: #fc814a; border: 1px solid rgba(252,129,74,.2); }

/* ── Beta notice bar ──────────────────────────────────────────────────── */
.lp-beta-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    background: rgba(255, 200, 60, .06);
    border: 1px solid rgba(255, 200, 60, .2);
    border-radius: 10px;
    width: 100%;
    box-sizing: border-box;
}
.lp-beta-badge {
    flex-shrink: 0;
    font-size: .62rem;
    font-weight: 900;
    letter-spacing: .1em;
    color: #ffc83c;
    background: rgba(255, 200, 60, .12);
    border: 1px solid rgba(255, 200, 60, .3);
    border-radius: 5px;
    padding: 2px 7px;
}
.lp-beta-text {
    flex: 1;
    font-size: .75rem;
    color: rgba(255, 200, 60, .75);
    line-height: 1.4;
}
.lp-beta-ver {
    flex-shrink: 0;
    font-size: .65rem;
    font-family: monospace;
    color: rgba(255, 200, 60, .4);
    letter-spacing: .04em;
}

/* ── Launchpad welcome screen ─────────────────────────────────────────── */
.workspace-home {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    align-items: center;
    justify-content: center;
}

/* lp-welcome base — overridden by the Mobile Overhaul block at bottom of file */
.lp-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 24px 24px 32px;
    max-width: 820px;
    width: 100%;
    text-align: center;
}

/* Headline block */
.lp-welcome-headline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.lp-eyebrow {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--accent, #f28b3c);
    opacity: .75;
}
.lp-h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 900;
    letter-spacing: -.025em;
    line-height: 1.1;
    margin: 0;
    color: var(--ink, #edf1f7);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .25em;
}
/* ── AIFI word-mark — WiFi arc above as a decorative accent ───────────── */
.aifi-word {
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, #f28b3c 30%, #ffb870);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-top: .5em; /* room for the arc above */
}
.aifi-word::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 1.4em;
    height: .52em;
    margin-bottom: -.38em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 42'%3E%3Ccircle cx='30' cy='39' r='5' fill='%2348c8e8'/%3E%3Cpath d='M16,28 Q30,15 44,28' stroke='%2348c8e8' fill='none' stroke-width='5.5' stroke-linecap='round'/%3E%3Cpath d='M4,17 Q30,0 56,17' stroke='%2348c8e8' fill='none' stroke-width='5.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    opacity: .92;
}

/* Smaller variant for body/pill text */
.aifi-word--sm {
    padding-top: .45em;
}
.aifi-word--sm::before {
    width: 1.3em;
    height: .48em;
    margin-bottom: -.34em;
}

/* Legacy image approach — kept for topbar, hidden on home */
.lp-aifi-logo { display: none; }
.lp-aifi-logo--sm { display: none; }

.lp-h1 em { font-style: normal; }
.lp-subhead {
    font-size: .95rem;
    color: var(--muted, #98a2b3);
    max-width: 480px;
    line-height: 1.6;
    margin: 0;
}

/* 3-step row */
/* ── Sequential guide card ─────────────────────────────────────────────── */
.lp-guide-card {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding: 20px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.07);
    background: rgba(255,255,255,.02);
}

/* Each step: dim by default, green box when .is-lp-active */
.lp-guide-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 10px;
    border-radius: 12px;
    border: 2px solid transparent;
    min-width: 0;
    overflow: hidden;
    text-align: center;
    opacity: .3;
    transition: opacity .3s, border-color .3s, background .3s;
}
.lp-guide-step.is-lp-active {
    opacity: 1;
    border-color: rgba(72,199,102,.85);
    background: rgba(72,199,102,.06);
    animation: lpCardPulse 1.4s step-start infinite;
}
@keyframes lpCardPulse {
    0%, 49%  { border-color: rgba(72,199,102,.9);  box-shadow: 0 0 0 4px rgba(72,199,102,.2); }
    50%, 100% { border-color: rgba(72,199,102,.25); box-shadow: none; }
}

.lp-guide-step strong {
    font-size: .88rem;
    font-weight: 700;
    color: var(--ink, #edf1f7);
}
.lp-guide-step span {
    font-size: .72rem;
    color: var(--muted, #98a2b3);
    line-height: 1.4;
}

/* Number badges — grey when dim, green when active */
.lp-guide-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: rgba(255,255,255,.3);
    font-size: .8rem;
    font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background .3s, color .3s;
}
.lp-guide-step.is-lp-active .lp-guide-num {
    background: #48c766;
    color: #0a1a0e;
}

/* Intro rule box (no number) */
.lp-guide-rule-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 2px solid rgba(72,199,102,.6);
    border-radius: 8px;
    background: rgba(72,199,102,.08);
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(72,199,102,.95);
}

/* Arrow between steps */
.lp-guide-arrow {
    font-size: 1.2rem;
    color: rgba(255,255,255,.15);
    flex-shrink: 0;
    padding: 0 10px;
    display: flex;
    align-items: center;
    transition: color .3s;
}

/* Step 2 — drag/drop SVG icon */
.lp-guide-drop-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(72,200,230,.5);
    width: 44px; height: 44px;
}
.lp-guide-step.is-lp-active .lp-guide-drop-visual {
    color: rgba(72,200,230,.9);
}

/* Step 3 — render play icon */
.lp-guide-render-icon {
    font-size: 1.6rem;
    opacity: .4;
    transition: opacity .3s;
}
.lp-guide-step.is-lp-active .lp-guide-render-icon {
    opacity: 1;
}

/* mock filmstrip inside guide card */
.lp-mock-strip {
    display: flex;
    gap: 5px;
    padding: 5px 6px;
    align-items: center;
    background: rgba(0,0,0,.25);
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.lp-mock-thumb {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 6px;
    opacity: 0.35;
    border: 1.5px solid rgba(255,255,255,.06);
    transition: opacity .3s, transform .25s, border-color .3s, box-shadow .3s;
    pointer-events: none;
    user-select: none;
}
.lp-mock-strip .lp-mock-active {
    opacity: 1;
    transform: scale(1.12);
    border-color: #48c766;
    box-shadow: 0 0 10px rgba(72,199,102,.6);
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1);   opacity: .7; box-shadow: 0 0 0 0 rgba(72,199,102,0); }
    50%       { transform: scale(1.5); opacity: 1;  box-shadow: 0 0 0 5px rgba(72,199,102,.25); }
}

/* ── Pitch bullets row ─────────────────────────────────────────────── */
.lp-pitch-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 10px;
}
.lp-pitch-item {
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted, #98a2b3);
    letter-spacing: .01em;
}
.lp-pitch-sep {
    color: rgba(255,255,255,.15);
    font-size: .8rem;
}

/* ── Studio CTA button ─────────────────────────────────────────────── */
.lp-studio-btn {
    padding: 13px 36px;
    border-radius: 999px;
    border: none;
    background: #48c766;
    color: #0a1a0e;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .01em;
    cursor: pointer;
    transition: background .15s, transform .1s;
    box-shadow: 0 4px 20px rgba(72,199,102,.35);
}
.lp-studio-btn:hover {
    background: #5dd97a;
    transform: translateY(-1px);
}
.lp-studio-btn:active { transform: none; }

.lp-skip-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .72rem;
    color: var(--muted, #98a2b3);
    cursor: pointer;
    user-select: none;
}
.lp-skip-check {
    accent-color: #48c766;
    cursor: pointer;
}

/* Studio nav link — same style as other nav links */
.demo-effect-nav a.nav-studio-link {
    font-weight: 700;
}
.demo-effect-nav a.nav-studio-link:hover {
    color: #f5efe8;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Footer — credit pill */
.lp-welcome-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}
.lp-credit-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: .84rem;
    color: var(--muted, #98a2b3);
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 40px;
    padding: 9px 20px;
}
.lp-credit-pill strong {
    color: var(--ink, #edf1f7);
    font-weight: 800;
}
.lp-credit-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #48c766;
    flex-shrink: 0;
    animation: pulseDot 2s ease-in-out infinite;
}

/* Hide iframe when home is shown */
.demo-frame[hidden] { display: none !important; }

@media (max-width: 680px) {
    .lp-guide-card { flex-direction: column; }
    .lp-guide-arrow { transform: rotate(90deg); }
    .lp-welcome { gap: 18px; padding: 16px 16px 24px; }
}

/* ── OLD launchpad styles (kept as stubs, no longer rendered) ─────────── */
.lp-guide {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 9px 14px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    flex-wrap: wrap;
}
.lp-guide-step {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.lp-guide-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--accent, #f28b3c);
    color: #111;
    font-size: .72rem;
    font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.lp-guide-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.lp-guide-text strong {
    font-size: .78rem;
    font-weight: 700;
    color: var(--ink, #edf1f7);
    white-space: nowrap;
}
.lp-guide-text span {
    font-size: .68rem;
    color: var(--muted, #98a2b3);
    white-space: nowrap;
}
.lp-guide-arrow {
    font-size: .9rem;
    color: rgba(255,255,255,.2);
    flex-shrink: 0;
}
.lp-bar-pricing {
    margin-left: auto;
    font-size: .73rem;
    font-weight: 700;
    color: var(--accent, #f28b3c);
    text-decoration: none;
    border: 1px solid rgba(242,139,60,.28);
    border-radius: 6px;
    padding: 4px 11px;
    white-space: nowrap;
    transition: background .15s;
    flex-shrink: 0;
}
.lp-bar-pricing:hover { background: rgba(242,139,60,.10); }

/* Workflow grid — fills remaining height */
.lp-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 8px;
    overflow-y: auto;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.12) transparent;
}
.lp-grid::-webkit-scrollbar { width: 4px; }
.lp-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

/* Individual workflow card */
.lp-card {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: border-color .15s, transform .15s, box-shadow .15s;
}
.lp-card:hover {
    border-color: var(--accent, #f28b3c);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

/* Thumbnail area — 4:3, fills with cover image */
.lp-card-thumb {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: rgba(255,255,255,.03);
    position: relative;
    flex-shrink: 0;
}
.lp-card-thumb img,
.lp-card-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.lp-card:hover .lp-card-thumb img,
.lp-card:hover .lp-card-thumb video {
    transform: scale(1.04);
}
.lp-card-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem; color: var(--muted); padding: .5rem; text-align: center;
}
.lp-card-badge {
    position: absolute;
    bottom: 5px; right: 5px;
    background: rgba(0,0,0,.6);
    color: rgba(255,255,255,.85);
    font-size: .6rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em;
    padding: 2px 6px; border-radius: 4px;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

/* Before → After split inside card thumb */
.lp-ba {
    display: flex;
    width: 100%; height: 100%;
    align-items: stretch;
}
.lp-ba-half {
    flex: 1;
    position: relative;
    overflow: hidden;
}
.lp-ba-half img, .lp-ba-half video {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(.7) saturate(.7);
    transition: filter .3s;
}
.lp-ba-half--after img, .lp-ba-half--after video {
    filter: brightness(1) saturate(1);
}
.lp-card:hover .lp-ba-half img,
.lp-card:hover .lp-ba-half video { filter: brightness(.85) saturate(.85); }
.lp-card:hover .lp-ba-half--after img,
.lp-card:hover .lp-ba-half--after video { filter: brightness(1.05) saturate(1.05); }

.lp-ba-cap {
    position: absolute;
    bottom: 4px; left: 4px;
    font-size: .55rem; font-weight: 800; letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.6);
    background: rgba(0,0,0,.45);
    padding: 1px 5px; border-radius: 3px;
    pointer-events: none;
}
.lp-ba-cap--after { left: auto; right: 4px; color: rgba(255,255,255,.9); }

.lp-ba-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
    font-size: .7rem;
    color: rgba(255,255,255,.5);
    background: rgba(0,0,0,.4);
    z-index: 1;
    letter-spacing: 0;
}

/* Card footer — title + "Try →" */
.lp-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 7px 9px;
    background: rgba(0,0,0,.2);
    flex-shrink: 0;
}
.lp-card-name {
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    min-width: 0;
}
.lp-card-tag {
    display: none; /* hidden by default to keep cards compact */
}
.lp-try {
    flex-shrink: 0;
    font-size: .72rem;
    font-weight: 800;
    color: var(--accent, #f28b3c);
    white-space: nowrap;
    transition: opacity .15s;
}
.lp-card:hover .lp-try { opacity: .7; }

/* Hide iframe when home is shown */
.demo-frame[hidden] { display: none !important; }

/* LEGACY home classes (kept for safety but no longer rendered) */
.home-mkt-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(242,139,60,0.10);
    border: 1px solid rgba(242,139,60,0.22);
    padding: 4px 12px;
    border-radius: 40px;
    margin-bottom: 16px;
}

.workspace-home-intro h1 {
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin: 0 0 0.8rem;
}

.workspace-home-intro h1 em {
    font-style: normal;
    color: var(--accent);
}

.workspace-home-intro .lede {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.65;
    margin: 0 0 1rem;
}

.home-mkt-not-for {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.5;
}

.home-mkt-not-for strong { color: var(--ink); }

/* ── Home right col ─────────────────────────────────────────────── */
.workspace-home-pillars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.25rem;
}

.home-mkt-who-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin: 0 0 6px;
}

.home-mkt-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 0.75rem;
}

.home-mkt-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 40px;
    padding: 5px 12px;
    font-size: 0.8rem;
    color: var(--ink);
    font-weight: 500;
    white-space: nowrap;
}

.home-mkt-pricing-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    border: 1px solid rgba(242,139,60,0.3);
    border-radius: 8px;
    padding: 7px 14px;
    background: rgba(242,139,60,0.07);
    transition: background 0.15s;
}

.home-mkt-pricing-link:hover { background: rgba(242,139,60,0.14); }

.home-grid-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.home-grid-hint {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: rgba(255,255,255,0.25);
    font-style: italic;
}

.workspace-home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 1rem;
}

.workspace-home-card {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface-raised, rgba(255,255,255,0.04));
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

.workspace-home-card:hover {
    border-color: var(--accent, #e07b00);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

/* Thumb overlay — "▶ Launch" appears on hover */
.workspace-home-card-thumb::after {
    content: '▶  Launch';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.52);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    opacity: 0;
    transition: opacity 0.18s;
}

.workspace-home-card:hover .workspace-home-card-thumb::after {
    opacity: 1;
}

.workspace-home-card-thumb {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
    position: relative;
}

.workspace-home-card-thumb img,
.workspace-home-card-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.workspace-home-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--muted);
    padding: 0.5rem;
    text-align: center;
}

.home-card-output-badge {
    position: absolute;
    bottom: 7px;
    right: 7px;
    background: rgba(0,0,0,0.62);
    color: rgba(255,255,255,0.85);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 5px;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.workspace-home-card-copy {
    padding: 0.6rem 0.75rem 0.75rem;
}

.workspace-home-card-copy strong {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-bottom: 2px;
}

.home-card-launch-btn {
    display: block;
    margin-top: 9px;
    padding: 7px 12px;
    border-radius: 7px;
    background: rgba(242,139,60,0.10);
    border: 1px solid rgba(242,139,60,0.22);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    transition: background 0.15s, color 0.15s;
}

.workspace-home-card:hover .home-card-launch-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: #111318;
}

.home-card-tagline {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Hide iframe when home is shown */
.demo-frame[hidden] {
    display: none !important;
}

@media (max-width: 860px) {
    .workspace-home-hero {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .home-mkt-chips { flex-direction: row; }
}
@media (max-width: 720px) {
    .workspace-home-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* ============================================================
   User Dashboard
   ============================================================ */
.dash-page {
    min-height: 100vh;
    background: var(--bg, #0d1117);
    color: var(--ink, #edf1f7);
    display: flex;
    flex-direction: column;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px 60px;
}

/* Header */
.dash-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0 18px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-wrap: wrap;
}
.dash-back {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .8rem;
    color: var(--muted, #98a2b3);
    text-decoration: none;
    margin-right: 4px;
}
.dash-back svg { width: 14px; height: 14px; }
.dash-back:hover { color: var(--ink, #edf1f7); }
.dash-identity { display: flex; align-items: center; gap: 12px; flex: 1; }
.dash-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(72,199,102,.15);
    border: 1.5px solid rgba(72,199,102,.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 800; color: #48c766;
    flex-shrink: 0;
}
.dash-name { font-size: .95rem; font-weight: 700; margin: 0; }
.dash-email { font-size: .75rem; margin: 2px 0 0; }
.dash-header-credits { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.dash-credits-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 999px;
    background: rgba(72,199,102,.08);
    border: 1px solid rgba(72,199,102,.2);
    font-size: .78rem; font-weight: 700; color: #48c766;
}
.dash-credits-dot {
    width: 6px; height: 6px; border-radius: 50%; background: #48c766;
}
.dash-plan-badge {
    font-size: .65rem; font-weight: 800; letter-spacing: .07em;
    text-transform: uppercase;
    padding: 3px 8px; border-radius: 5px;
    background: rgba(255,255,255,.06);
    color: var(--muted, #98a2b3);
    border: 1px solid rgba(255,255,255,.1);
}

/* Tab bar */
.dash-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
    margin-top: 24px;
}
.dash-tab {
    background: none; border: none;
    padding: 10px 20px;
    font-size: .83rem; font-weight: 600;
    color: var(--muted, #98a2b3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
    margin-bottom: -1px;
}
.dash-tab:hover { color: var(--ink, #edf1f7); }
.dash-tab.is-active { color: #48c766; border-bottom-color: #48c766; }

/* Panels */
.dash-panel { display: none; padding-top: 28px; }
.dash-panel.is-active { display: block; }
.dash-panel-head { margin-bottom: 20px; }
.dash-panel-head h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 4px; }
.dash-panel-head p { font-size: .82rem; }
.dash-count {
    display: inline-block;
    background: rgba(72,199,102,.12);
    color: #48c766;
    font-size: .65rem; font-weight: 800;
    padding: 2px 7px; border-radius: 999px;
    vertical-align: middle; margin-left: 6px;
}

/* Render grid */
.dash-render-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.dash-render-card {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .2s;
}
.dash-render-card:hover { border-color: rgba(72,199,102,.3); }
.dash-render-thumb {
    display: block; position: relative;
    aspect-ratio: 1; overflow: hidden;
    background: rgba(0,0,0,.3);
    text-decoration: none;
}
.dash-render-media {
    width: 100%; height: 100%; object-fit: cover;
    display: block;
}
.dash-render-type-badge {
    position: absolute; top: 6px; right: 6px;
    background: rgba(0,0,0,.6);
    color: #fff; font-size: .55rem; font-weight: 800;
    letter-spacing: .06em;
    padding: 2px 5px; border-radius: 3px;
}
.dash-render-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0);
    color: #fff; opacity: 0;
    transition: opacity .2s, background .2s;
}
.dash-render-thumb:hover .dash-render-overlay {
    opacity: 1; background: rgba(0,0,0,.4);
}
.dash-render-meta { padding: 8px 10px 4px; }
.dash-render-title { font-size: .75rem; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-render-date { font-size: .65rem; margin: 2px 0 0; }
.dash-render-actions {
    display: flex; gap: 6px; padding: 6px 8px 8px;
}

/* Action buttons */
.dash-action-btn {
    flex: 1; text-align: center;
    padding: 5px 8px;
    font-size: .65rem; font-weight: 700;
    border-radius: 6px; border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.04);
    color: var(--ink, #edf1f7);
    text-decoration: none; cursor: pointer;
    transition: background .15s;
}
.dash-action-btn:hover { background: rgba(255,255,255,.09); }
.dash-action-danger { color: #fc814a; border-color: rgba(252,129,74,.2); }
.dash-action-danger:hover { background: rgba(252,129,74,.08); }

/* Stats row (credits tab) */
.dash-stats-row {
    display: flex; flex-wrap: wrap; gap: 12px;
    margin-bottom: 24px;
}
.dash-stat {
    flex: 1; min-width: 120px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    padding: 16px 20px;
}
.dash-stat-val { font-size: 1.6rem; font-weight: 800; margin: 4px 0; }
.dash-add-credits-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #48c766; color: #0a1a0e;
    font-weight: 800; font-size: .85rem;
    border-radius: 8px; text-decoration: none;
    transition: background .15s;
}
.dash-add-credits-btn:hover { background: #5dd97a; }

/* Analytics split bar */
.dash-analytics { margin-bottom: 28px; }
.dash-split-bar {
    display: flex; height: 32px; border-radius: 8px;
    overflow: hidden; margin: 10px 0 8px;
    background: rgba(255,255,255,.05);
}
.dash-split-seg {
    display: flex; align-items: center; justify-content: center;
    font-size: .68rem; font-weight: 800; color: rgba(0,0,0,.8);
    transition: width .6s ease;
    min-width: 0;
}
.dash-split-image { background: #48c766; }
.dash-split-video { background: #63b3ed; }
.dash-split-legend { font-size: .75rem; color: var(--muted, #98a2b3); display: flex; align-items: center; }
.dash-legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.dash-legend-image { background: #48c766; }
.dash-legend-video { background: #63b3ed; }

/* Transaction list */
.dash-tx-list { max-height: 380px; overflow-y: auto; }
.dash-tx-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 12px; align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
    font-size: .78rem;
}
.dash-tx-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-tx-date { font-size: .68rem; }
.dash-tx-delta { font-weight: 800; min-width: 36px; text-align: right; }
.dash-tx-pos { color: #48c766; }
.dash-tx-neg { color: #fc814a; }
.dash-tx-bal { min-width: 36px; text-align: right; }

/* Profile grid */
.dash-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.dash-profile-card {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    padding: 20px;
    display: flex; flex-direction: column; gap: 10px;
}
.dash-input {
    width: 100%; box-sizing: border-box;
    padding: 9px 12px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 7px;
    color: var(--ink, #edf1f7);
    font-size: .85rem;
}
.dash-input:focus { outline: none; border-color: #48c766; }
.dash-profile-row { display: flex; gap: 8px; }
.dash-profile-row .dash-input { flex: 1; }
.dash-profile-save-btn {
    padding: 9px 16px;
    background: rgba(72,199,102,.12);
    border: 1px solid rgba(72,199,102,.25);
    border-radius: 7px;
    color: #48c766; font-weight: 700; font-size: .82rem;
    cursor: pointer; white-space: nowrap;
    transition: background .15s;
}
.dash-profile-save-btn:hover { background: rgba(72,199,102,.22); }

/* Empty state */
.dash-empty {
    padding: 48px 24px; text-align: center;
    color: var(--muted, #98a2b3); font-size: .9rem;
}
.dash-empty a { color: #48c766; }

/* Responsive */
@media (max-width: 600px) {
    .dash-render-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-stats-row .dash-stat { min-width: 100%; }
    .dash-tx-row { grid-template-columns: 1fr auto auto; }
    .dash-tx-bal { display: none; }
}

/* ============================================================
   Account page (legacy — kept for any other templates)
   ============================================================ */
.account-page {
    min-height: 100vh;
    background: var(--bg, #0e0e0e);
    display: flex;
    flex-direction: column;
}

.account-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border, #1e1e1e);
}

.account-back-link {
    display: flex;
    align-items: center;
    gap: .4rem;
    color: var(--text-muted, #888);
    text-decoration: none;
    font-size: .85rem;
    transition: color .15s;
}
.account-back-link:hover { color: var(--text, #eee); }
.account-back-link svg { width: 16px; height: 16px; }

.account-page-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .9rem;
}
.account-page-brand .brand-mark {
    background: var(--accent, #7c6ff7);
    color: #fff;
    font-weight: 700;
    font-size: .75rem;
    padding: .2em .45em;
    border-radius: 4px;
    letter-spacing: .04em;
}

.account-page-body {
    max-width: 680px;
    width: 100%;
    margin: 2.5rem auto;
    padding: 0 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.account-card {
    background: var(--surface, #141414);
    border: 1px solid var(--border, #1e1e1e);
    border-radius: 12px;
    padding: 1.5rem;
}

.account-card-head {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.account-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--accent, #7c6ff7);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.account-name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}
.account-email { margin: .15rem 0 0; font-size: .85rem; }

.account-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.account-stat-card {
    background: var(--surface, #141414);
    border: 1px solid var(--border, #1e1e1e);
    border-radius: 12px;
    padding: 1.25rem 1rem;
}
.account-stat-label { margin: 0 0 .35rem; font-size: .7rem; letter-spacing: .08em; }
.account-stat-value { margin: 0 0 .25rem; font-size: 1.4rem; font-weight: 700; }
.account-stat-card .muted { margin: 0; font-size: .78rem; }
.account-stat-upgrade-link {
    font-size: .78rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
}
.account-stat-upgrade-link:hover { text-decoration: underline; }

.account-actions-card h2 {
    margin: 0 0 1rem;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted, #888);
}

.account-actions-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.account-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-radius: 8px;
    background: var(--bg, #0e0e0e);
    border: 1px solid var(--border, #1e1e1e);
    color: var(--text, #eee);
    text-decoration: none;
    font-size: .9rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background .15s, border-color .15s;
}
.account-action-row:hover { background: var(--surface-hover, #1a1a1a); border-color: var(--border-hover, #2e2e2e); }
.account-action-row svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-muted, #888); }

.account-action-admin { color: var(--accent, #7c6ff7); border-color: color-mix(in srgb, var(--accent, #7c6ff7) 30%, transparent); }
.account-action-admin:hover { background: color-mix(in srgb, var(--accent, #7c6ff7) 8%, transparent); }

.account-action-logout { color: #e05c5c; border-color: color-mix(in srgb, #e05c5c 25%, transparent); }
.account-action-logout:hover { background: color-mix(in srgb, #e05c5c 8%, transparent); }

/* Admin nav link */
.nav-admin-link {
    font-weight: 600;
}
button.nav-show-splash-btn {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    opacity: 0.65;
    padding: 0;
}
button.nav-show-splash-btn:hover { opacity: 1; }

@media (max-width: 600px) {
    .account-stats-row { grid-template-columns: 1fr; }
    .account-page-header { padding: .8rem 1rem; }
}

/* ═══════════════════════════════════════════════════════════════════════
   TABBED WORKFLOW INTERFACE
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Tab bar ─────────────────────────────────────────────────────────── */
.workspace-tab-bar {
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: .25rem .5rem .25rem .75rem;
    background: rgba(0,0,0,.25);
    border-bottom: 1px solid var(--panel-border, rgba(255,255,255,.08));
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.15) transparent;
}
.workspace-tab-bar::-webkit-scrollbar { height: 3px; }
.workspace-tab-bar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.workspace-tab-list {
    display: flex;
    gap: .2rem;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}
.workspace-tab-list::-webkit-scrollbar { display: none; }

/* Individual tab button */
.workspace-tab {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .28rem .65rem .28rem .55rem;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--panel-border, rgba(255,255,255,.08));
    border-radius: 8px 8px 0 0;
    border-bottom: none;
    color: var(--muted, #98a2b3);
    font-size: .78rem;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, color .15s;
    max-width: 180px;
    position: relative;
}
.workspace-tab:hover { background: rgba(255,255,255,.07); color: var(--ink, #edf1f7); }
.workspace-tab.is-active {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.16);
    color: var(--ink, #edf1f7);
    box-shadow: 0 -2px 0 var(--accent, #f28b3c) inset;
}

/* Floating tab — dashed border + ~prefix to signal it's temporary */
.workspace-tab.tab-state-floating {
    border-style: dashed;
    opacity: .85;
}

/* Compound queue tab — always visually distinct and anchored */
.workspace-tab.tab-compound {
    border-left: 2px solid var(--accent, #f28b3c);
    color: var(--accent, #f28b3c);
    font-weight: 600;
}
.workspace-tab.tab-compound.is-active {
    color: var(--accent, #f28b3c);
    box-shadow: 0 -2px 0 var(--accent, #f28b3c) inset;
    background: rgba(242, 139, 60, .1);
}
.tab-float-mark {
    font-size: .7rem;
    color: var(--muted);
    line-height: 1;
}

/* Running tab — pulsing orange dot */
/* ── Workflow queue node: spinner overlay on top of thumbnail ───────────── */
.cg-node-icon { position: relative; }
.cg-node-icon-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.35);
    border-radius: 6px;
}

/* ── Grouped tabs (compound session colour coding) ──────────────────────── */
.workspace-tab.is-grouped {
    --tab-group-color: #f28b3c;   /* overridden inline per-tab */
    position: relative;
    padding-left: .9rem;          /* room for the stripe */
}
.workspace-tab.is-grouped::before {
    content: '';
    display: block;
    position: absolute;
    left: 3px;
    top: 4px;
    bottom: 4px;
    width: 2.5px;
    border-radius: 2px;
    background: var(--tab-group-color);
    opacity: .75;
}
.workspace-tab.is-grouped.is-active::before { opacity: 1; }

/* Pulsing dot — shown on unvisited grouped tabs */
.tab-unvisited-dot {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tab-group-color, #f28b3c);
    animation: tab-dot-pulse 1.6s ease-in-out infinite;
    margin-left: .1rem;
}
@keyframes tab-dot-pulse {
    0%, 100% { opacity: 1;  transform: scale(1); }
    50%       { opacity: .4; transform: scale(.65); }
}

.tab-run-icon {
    display: inline-block;
    font-size: .75rem;
    color: var(--accent, #f28b3c);
    animation: tabSpin 1.2s linear infinite;
}
@keyframes tabSpin { to { transform: rotate(360deg); } }

/* Complete tab — green check */
.tab-done-icon {
    font-size: .72rem;
    color: #4caf50;
}

.tab-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.tab-close {
    flex-shrink: 0;
    padding: 0 .1rem;
    font-size: .85rem;
    line-height: 1;
    opacity: .5;
    cursor: pointer;
    border-radius: 3px;
    transition: opacity .1s, background .1s;
}
.tab-close:hover { opacity: 1; background: rgba(255,255,255,.12); }

/* "+ Tab" new-tab button — hidden, not needed for end users */
.workspace-tab-add-wrap {
    position: relative;
    flex-shrink: 0;
    display: none;
    align-items: center;
}
.workspace-tab-new-btn {
    flex-shrink: 0;
    padding: .25rem .65rem;
    background: transparent;
    border: 1px dashed rgba(255,255,255,.18);
    border-radius: 6px;
    color: var(--muted);
    font-size: .75rem;
    cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
    white-space: nowrap;
}
.workspace-tab-new-btn:hover,
.workspace-tab-new-btn:focus-visible {
    color: var(--ink);
    border-color: rgba(255,255,255,.35);
    background: rgba(255,255,255,.05);
    outline: none;
}

/* ── Workflow picker popover ────────────────────────────────────────────── */
.workspace-tab-picker[hidden] { display: none !important; }
.workspace-tab-picker {
    position: absolute;
    bottom: calc(100% + .4rem);
    right: 0;
    z-index: 500;
    min-width: 230px;
    max-height: 60dvh;
    overflow-y: auto;
    background: var(--bg-surface, #0e0e1a);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: .6rem;
    box-shadow: 0 8px 28px rgba(0,0,0,.55);
    padding: .35rem 0;
}
.workspace-tab-picker::-webkit-scrollbar { width: 4px; }
.workspace-tab-picker::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

.tab-picker-heading {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.35);
    padding: .35rem .8rem .2rem;
    margin: 0;
}
.tab-picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tab-picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    text-align: left;
    padding: .42rem .8rem;
    background: transparent;
    border: none;
    color: rgba(255,255,255,.8);
    font-size: .82rem;
    cursor: pointer;
    transition: background .1s, color .1s;
}
.tab-picker-item:hover,
.tab-picker-item:focus-visible {
    background: rgba(242,139,60,.1);
    color: #fff;
    outline: none;
}
.tab-picker-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tab-picker-tag {
    flex-shrink: 0;
    font-size: .62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: rgba(255,255,255,.3);
    padding: .1rem .35rem;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: .3rem;
}

/* ── Compound drag overlay ─────────────────────────────────────────── */
.workspace-compound-overlay[hidden] { display: none !important; }
.workspace-compound-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(242,139,60,.14);
    border: 2px dashed var(--accent, #f28b3c);
    border-radius: inherit;
    pointer-events: none;
    animation: overlayPulse 1.2s ease-in-out infinite alternate;
}
.workspace-compound-overlay-inner {
    text-align: center;
    color: var(--accent, #f28b3c);
}
.workspace-compound-icon {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: .5rem;
}
.workspace-compound-overlay-inner p {
    font-size: .9rem;
    font-weight: 600;
}
@keyframes overlayPulse {
    from { background: rgba(242,139,60,.10); }
    to   { background: rgba(242,139,60,.20); }
}

/* Workspace-shell needs relative positioning for the overlay */
.workspace-shell.panel { position: relative; }

/* ── "Chain into workflow" sticky bar on the result page ────────────── */
.dr-compound-bar {
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: .55rem 1rem .6rem;
    background: color-mix(in srgb, var(--panel, #1a1d24) 96%, transparent);
    border-top: 1px solid var(--panel-border, rgba(255,255,255,.10));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.dr-compound-bar-header {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .4rem;
    flex-wrap: wrap;
}
.dr-compound-bar-icon { font-size: .95rem; }
.dr-compound-bar-label { font-size: .82rem; font-weight: 700; color: var(--accent, #f28b3c); }
.dr-compound-bar-hint { font-size: .72rem; color: var(--muted, #98a2b3); }
.dr-compound-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.dr-compound-btn {
    padding: .3rem .65rem;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 6px;
    color: var(--ink, #edf1f7);
    font-size: .78rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    white-space: nowrap;
}
.dr-compound-btn:hover { background: rgba(242,139,60,.18); border-color: var(--accent, #f28b3c); color: var(--accent, #f28b3c); }

/* ── Resume-context review panel ───────────────────────────────────────── */
.rctx-panel {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #f28b3c) 8%, transparent), color-mix(in srgb, var(--accent, #f28b3c) 4%, transparent));
    border: 1px solid color-mix(in srgb, var(--accent, #f28b3c) 30%, transparent);
    border-radius: 12px;
    margin-bottom: 1.25rem;
    overflow: hidden;
}
.rctx-panel-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem .5rem;
}
.rctx-col-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255,255,255,.5);
    margin: .75rem 0 .35rem;
}

/* Big render preview in resume panel */
.rctx-render-preview {
    width: 100%;
    background: #0b0d11;
    border-bottom: 1px solid rgba(255,255,255,.06);
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 140px;
    overflow: hidden;
}
.rctx-render-media {
    display: block;
    width: 100%;
    max-height: 140px;
    object-fit: contain;
}

/* Chain CTA inside resume panel */
.rctx-chain-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    margin-top: .75rem;
    font-size: .95rem;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(242,139,60,.18), rgba(242,139,60,.08));
    border: 2px solid rgba(242,139,60,.5);
    border-radius: 10px;
    color: var(--accent, #f28b3c);
    cursor: pointer;
    justify-content: center;
    transition: background .2s, border-color .2s;
}
.rctx-chain-btn:hover:not(:disabled) {
    background: rgba(242,139,60,.24);
    border-color: var(--accent, #f28b3c);
}
.rctx-chain-btn:disabled { opacity: .7; cursor: default; }
.rctx-chain-hint {
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent, #f28b3c);
    text-align: center;
    margin: .4rem 0 0;
    animation: cg-pulse 1.6s ease-in-out infinite;
}

.rctx-summary {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.rctx-summary::-webkit-details-marker { display: none; }
.rctx-eyebrow {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent, #f28b3c);
    opacity: .9;
    white-space: nowrap;
}
.rctx-title {
    font-weight: 600;
    font-size: .9rem;
}
.rctx-hint {
    font-size: .78rem;
    color: var(--text-muted, #888);
    margin-left: auto;
}
.rctx-body {
    padding: .5rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.rctx-media-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}
.rctx-thumb-btn {
    position: relative;
    padding: 0;
    border: 2px solid var(--border, rgba(255,255,255,.12));
    border-radius: 8px;
    background: var(--surface2, #1a1a1a);
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    transition: border-color .15s, transform .1s;
}
.rctx-thumb-btn:hover { border-color: var(--accent, #f28b3c); transform: scale(1.04); }
.rctx-thumb-btn.is-loaded { border-color: #4caf50; }
.rctx-thumb-btn.is-error  { border-color: #e53935; }
.rctx-thumb-btn.is-loading .rctx-thumb-label { opacity: 1; background: rgba(0,0,0,.55); }
.rctx-thumb-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    font-size: .6rem;
    font-weight: 700;
    text-align: center;
    padding: .18rem 0;
    background: rgba(0,0,0,.0);
    color: #fff;
    letter-spacing: .04em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity .15s, background .15s;
}
.rctx-thumb-btn:hover .rctx-thumb-label { opacity: 1; background: rgba(0,0,0,.55); }
.rctx-thumb-btn.is-loaded .rctx-thumb-label,
.rctx-thumb-btn.is-error  .rctx-thumb-label { opacity: 1; }
.rctx-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}
.rctx-thumb-out {
    width: 96px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid color-mix(in srgb, var(--accent, #f28b3c) 50%, transparent);
    background: var(--surface2, #1a1a1a);
    flex-shrink: 0;
}
.rctx-arrow {
    font-size: 1.4rem;
    color: var(--text-muted, #888);
    flex-shrink: 0;
}
.rctx-action-hint {
    font-size: .78rem;
    color: var(--text-muted, #999);
    margin: 0;
}
.rctx-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.rctx-prompt-chip {
    font-size: .75rem;
    background: var(--surface2, rgba(255,255,255,.06));
    border: 1px solid var(--border, rgba(255,255,255,.1));
    border-radius: 6px;
    padding: .2rem .55rem;
    color: var(--text-muted, #aaa);
    max-width: 28ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rctx-prompt-chip strong { color: var(--text, #eee); }

/* ── Chain toast ────────────────────────────────────────────────────────── */
.chain-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(1rem);
    background: rgba(20,20,30,.93);
    color: #fff;
    border: 1px solid rgba(242,139,60,.4);
    border-radius: .6rem;
    padding: .65rem 1.2rem;
    font-size: .85rem;
    max-width: 28rem;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 9999;
}
.chain-toast.chain-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Chain graph node renderer ──────────────────────────────────────────── */
.cg-graph {
    position: relative;
    width: 100%;
    padding: 1rem 0 .5rem;
    overflow-x: auto;
}
.cg-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2.5rem;
    padding: .5rem 1rem;
    min-width: max-content;
}
.cg-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: .6rem .75rem;
    border-radius: .6rem;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.04);
    min-width: 80px;
    max-width: 110px;
    position: relative;
}
.cg-node-input  { border-color: rgba(255,255,255,.18); }
.cg-node-result { border-color: rgba(242,139,60,.4); background: rgba(242,139,60,.06); }
.cg-node-step   { border-color: rgba(120,180,255,.3); background: rgba(120,180,255,.05); }
.cg-node-target { border-color: rgba(100,220,140,.35); background: rgba(100,220,140,.05); }
.cg-node-output { border-color: rgba(255,255,255,.08); opacity: .5; }
.cg-node-pending { border-style: dashed; opacity: .45; }

.cg-node-badge {
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255,255,255,.45);
    position: absolute;
    top: -.55rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-surface, #141420);
    padding: 0 .35rem;
    white-space: nowrap;
}
.cg-node-result  .cg-node-badge { color: var(--accent, #f28b3c); }
.cg-node-target  .cg-node-badge { color: #6ddc8c; }
.cg-node-step    .cg-node-badge { color: #78b4ff; }

.cg-node-icon {
    width: 52px;
    height: 52px;
    border-radius: .4rem;
    overflow: hidden;
    background: rgba(255,255,255,.05);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cg-node-icon img,
.cg-node-icon video { width: 100%; height: 100%; object-fit: contain; display: block; background: #0a0a12; }
.cg-node-icon-empty { font-size: 1.6rem; color: rgba(255,255,255,.2); }

.cg-node-label {
    font-size: .72rem;
    font-weight: 500;
    color: rgba(255,255,255,.75);
    text-align: center;
    line-height: 1.2;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cg-node-note {
    font-size: .62rem;
    color: rgba(255,255,255,.35);
    text-align: center;
    line-height: 1.2;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* SVG edge lines */
.cg-edges {
    position: absolute;
    top: 0; left: 0;
    pointer-events: none;
    overflow: visible;
}
.cg-edge {
    stroke: rgba(255,255,255,.18);
    stroke-width: 1.5;
    stroke-dasharray: none;
}
.cg-edge-fan {
    stroke: rgba(120,180,255,.35);
    stroke-width: 1;
    stroke-dasharray: 4 3;
}

/* ── Chain graph section wrapper on result page ──────────────────────── */
/* ── Unified workflow queue (replaces live-thumb strip + self-graph) ──────── */
.dr-queue-section {
    border-top: 1px solid rgba(255,255,255,.07);
    margin-top: .5rem;
    /* inherits .cgc-graph overflow-x:auto for many-node scrolling */
}
.dr-queue-eyebrow {
    padding: .75rem 1.5rem .25rem;
    display: block;
}
/* The .dr-queue uses .cgc-inner for layout; just tweak the centering */
.dr-queue {
    justify-content: flex-start;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
/* Arrow connectors between queue nodes */
.dr-queue-arrow {
    font-size: 1.1rem;
    color: rgba(255,255,255,.28);
    flex-shrink: 0;
    align-self: center;
    margin: 0 -.25rem;  /* tighten gap around arrow */
}
/* Inside queue: nodes use the same size as compound graph */
.dr-queue-section .cg-node {
    width: min(140px, 100%);
    max-width: 160px;
    padding: .75rem .65rem .65rem;
}
.dr-queue-section .cg-node-icon {
    width: 100px;
    height: 100px;
}
.dr-queue-section .cg-node-label {
    font-size: .74rem;
    max-width: 140px;
}
@media (max-width: 599px) {
    .dr-queue-section .cg-node { width: min(110px, 100%); padding: .55rem .5rem .5rem; }
    .dr-queue-section .cg-node-icon { width: 74px; height: 74px; }
    .dr-queue { padding-left: .75rem; padding-right: .75rem; gap: .65rem; }
}

.dr-chain-graph-section {
    padding: 1rem 1.5rem .5rem;
    border-top: 1px solid rgba(255,255,255,.07);
    margin-top: .5rem;
    position: relative;
}
.dr-chain-graph-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
}
.dr-chain-graph-title {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.35);
    margin-bottom: .25rem;
}

/* + Add Next Effect button */
.dr-add-effect-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .7rem;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 2rem;
    background: rgba(255,255,255,.05);
    color: rgba(255,255,255,.7);
    font-size: .72rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.dr-add-effect-btn:hover {
    border-color: var(--accent, #f28b3c);
    color: var(--accent, #f28b3c);
    background: rgba(242,139,60,.08);
}

/* Effect picker dropdown */
.dr-effect-picker {
    position: absolute;
    top: 2.6rem;
    right: 1.5rem;
    z-index: 120;
    background: var(--bg-surface, #141420);
    border: 1px solid rgba(255,255,255,.14);
    border-radius: .75rem;
    padding: .5rem;
    min-width: 220px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.dr-effect-picker ul { list-style: none; padding: 0; margin: 0; }
.dr-effect-picker .tab-picker-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .45rem .6rem;
    border: none;
    border-radius: .45rem;
    background: transparent;
    color: rgba(255,255,255,.8);
    font-size: .8rem;
    text-align: left;
    cursor: pointer;
    transition: background .12s;
}
.dr-effect-picker .tab-picker-item:hover {
    background: rgba(255,255,255,.07);
}
.dr-effect-picker .tab-picker-tag {
    font-size: .62rem;
    color: rgba(255,255,255,.35);
    flex-shrink: 0;
}

/* Chain plan preview section */
.dr-chain-preview-section {
    margin: .5rem 1.5rem;
    padding: .75rem 1rem;
    border: 1px solid rgba(242,139,60,.25);
    border-radius: .75rem;
    background: rgba(242,139,60,.04);
}
.dr-chain-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
}
.dr-chain-cancel-btn {
    padding: .2rem .55rem;
    font-size: .72rem;
}

/* Preview graph — dimmed/pending treatment */
.cg-graph-preview .cg-node { opacity: .6; }
.cg-graph-preview .cg-node-target { opacity: 1; border-style: dashed; }

/* ── Compound session live graph ────────────────────────────────────── */
.cgc-graph {
    padding: .5rem 0 1rem;
    position: relative;
    width: 100%;
    overflow-x: auto;   /* scroll rather than collapse if tab is narrow */
}
.cgc-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem .75rem;
    flex-wrap: wrap;
}
.cgc-status {
    flex: 1;
    font-size: .82rem;
    color: rgba(255,255,255,.55);
    margin: 0;
}
.cgc-render-all-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: transparent;
    color: #f28b3c;
    border: 1.5px solid #f28b3c;
    border-radius: 999px;
    padding: .4rem 1rem;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.cgc-render-all-btn:hover:not(:disabled) { background: #f28b3c; color: #fff; }
.cgc-render-all-btn:disabled { opacity: .45; cursor: default; }

.cgc-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: .5rem 2rem 1.5rem;
    position: relative;
    min-width: max-content; /* never collapse — parent scrolls */
    box-sizing: border-box;
}
.cgc-col {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
    min-width: 140px;  /* always wide enough for a node */
    flex-shrink: 0;
}

/* Nodes inside the compound graph — fill their column */
.cgc-graph .cg-node {
    width: min(160px, 100%);
    max-width: 200px;
    padding: .9rem .75rem .75rem;
}
.cgc-graph .cg-node-icon {
    width: 110px;
    height: 110px;
}
.cgc-graph .cg-node-label { max-width: 160px; font-size: .78rem; }

/* Launch button inside a node */
.cgc-node-launchable { cursor: default; }
.cgc-launch-btn {
    display: block;
    width: 100%;
    margin-top: .45rem;
    background: var(--accent, #f28b3c);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: .32rem .5rem;
    font-size: .68rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .02em;
    transition: opacity .15s;
}
.cgc-launch-btn:hover { opacity: .82; }

/* Done banner */
.cgc-done-banner {
    text-align: center;
    padding: .75rem 1rem;
    background: rgba(109,220,140,.1);
    border-top: 1px solid rgba(109,220,140,.25);
    color: #6ddc8c;
    font-weight: 600;
    font-size: .88rem;
}

/* ── Mobile: compound graph & queue ─────────────────────────────────── */
@media (max-width: 599px) {
    /* Remove the 680px cap so the graph uses the full phone width */
    .compound-wrap {
        max-width: none;
        padding: 1rem .25rem 3rem;
    }
    /* Smaller nodes so more columns fit in the scrollable viewport */
    .cgc-graph .cg-node {
        width: min(110px, 100%);
        max-width: 130px;
        padding: .65rem .55rem .55rem;
    }
    .cgc-graph .cg-node-icon {
        width: 76px;
        height: 76px;
    }
    .cgc-graph .cg-node-label {
        font-size: .68rem;
        max-width: 110px;
    }
    .cgc-col { min-width: 110px; gap: .9rem; }
    .cgc-inner { gap: 1rem; padding: .5rem 1rem 1.25rem; }
    /* Launch button a bit taller for thumb tap comfort */
    .cgc-launch-btn { padding: .42rem .5rem; font-size: .72rem; }
    /* Scroll hint badge below the graph */
    .cgc-graph::after {
        content: '← swipe →';
        display: block;
        text-align: center;
        font-size: .65rem;
        color: rgba(255,255,255,.28);
        padding-bottom: .25rem;
        letter-spacing: .06em;
    }
    /* Header: stack status + Render All vertically */
    .cgc-header { flex-direction: column; align-items: flex-start; gap: .55rem; }
}

/* ── Source highlight — pulsing orange outline ───────────────────────── */
.cg-node-new-source {
    border: 2px solid var(--accent, #f28b3c) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #f28b3c) 25%, transparent);
    animation: cg-pulse 1.6s ease-in-out infinite;
    z-index: 2;
}
@keyframes cg-pulse {
    0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent, #f28b3c) 25%, transparent); }
    50%       { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent, #f28b3c) 10%, transparent); }
}

/* ── Drag-drop overlay on the result image ────────────────────────── */
/* Result hero gets relative positioning for the drop overlay.
   When there's a compound bar (sticky at bottom), cap the hero height
   so both image and chain bar are visible without scrolling.         */
.dr-result-hero { position: relative; }
/* height now controlled globally on .dr-result-hero */
.dr-compound-drop-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(242,139,60,.22);
    border: 3px dashed var(--accent, #f28b3c);
    border-radius: 12px;
    animation: overlayPulse 1s ease-in-out infinite alternate;
    pointer-events: none;
}
/* CSS display:flex overrides HTML [hidden] — enforce hidden explicitly */
.dr-compound-drop-overlay[hidden] { display: none !important; }
.dr-compound-drop-inner { text-align: center; padding: 1rem; }
.dr-compound-drop-icon { font-size: 2.8rem; color: var(--accent, #f28b3c); margin-bottom: .4rem; }
.dr-compound-drop-label { font-size: 1rem; font-weight: 700; color: var(--ink, #edf1f7); margin: 0 0 .25rem; }
.dr-compound-drop-hint { font-size: .82rem; color: var(--accent, #f28b3c); margin: 0; opacity: .9; }


/* ════════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE OVERHAUL — master block
   All new phone breakpoints live here. Breakpoints: 720px, 600px, 480px.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── 1. Two-column Welcome Hero ─────────────────────────────────────── */
.lp-welcome {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 28px 56px;
    padding: 36px 56px 40px;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
    align-items: start;
    text-align: left;
}
.lp-welcome-left {
    display: flex;
    flex-direction: column;
    gap: 18px;
    grid-column: 1;
    grid-row: 1;
}
.lp-welcome-right {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: stretch;
    justify-content: center;
}
.lp-welcome-full {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
}

/* Guide card — vertical layout in right column */
.lp-welcome-right .lp-guide-card {
    flex-direction: column;
    width: 100%;
    min-width: 300px;
    max-width: 420px;
    padding: 20px 18px;
    gap: 6px;
}
.lp-welcome-right .lp-guide-arrow {
    transform: rotate(90deg);
    margin: 4px auto;
    font-size: 1.1rem;
    opacity: 0.5;
}
.lp-welcome-right .lp-guide-step {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    text-align: left;
    padding: 14px 14px;
    width: 100%;
    min-height: 0;
    box-sizing: border-box;
}
/* Bigger, more readable text in the right column */
.lp-welcome-right .lp-guide-step strong {
    font-size: 1rem;
    font-weight: 700;
}
.lp-welcome-right .lp-guide-step span {
    font-size: .82rem;
    line-height: 1.45;
}
/* Bigger step number badge */
.lp-welcome-right .lp-guide-num {
    width: 34px;
    height: 34px;
    font-size: .9rem;
    flex-shrink: 0;
}
/* Thumbnail strip — show 6 thumbs, clip the rest */
.lp-welcome-right .lp-mock-strip {
    flex-direction: row;
    width: auto;
    max-width: 320px;
    overflow: hidden;
    gap: 4px;
    flex-shrink: 0;
}
.lp-welcome-right .lp-mock-strip .lp-mock-thumb:nth-child(n+7) { display: none; }
.lp-welcome-right .lp-guide-step .lp-guide-rule-box { flex-shrink: 0; }
.lp-welcome-right .lp-guide-num { flex-shrink: 0; }

/* Re-align text elements to left in two-column mode */
.lp-welcome .lp-welcome-headline { align-items: flex-start; text-align: left; gap: 10px; }
.lp-welcome .lp-eyebrow { text-align: left; }
.lp-welcome .lp-h1 { justify-content: flex-start; font-size: clamp(1.8rem, 3vw, 2.8rem); }
.lp-welcome .lp-subhead { text-align: left; }
.lp-welcome .lp-pitch-row { justify-content: flex-start; }
.lp-welcome .lp-welcome-foot { justify-content: flex-start; }
.lp-welcome .lp-beta-notice { text-align: left; }

/* ── 2. Hamburger nav (hidden on desktop) ───────────────────────────── */
.nav-hamburger {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 7px;
    cursor: pointer;
    padding: 6px 8px;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    flex-shrink: 0;
}
.nav-hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink, #edf1f7);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* nav-drawer — flex row on desktop (default), dropdown on mobile */
.nav-drawer {
    display: contents; /* transparent wrapper on desktop */
}
.nav-drawer-links {
    display: contents; /* transparent wrapper on desktop */
}
.nav-drawer-login { /* "Log in" link inside drawer on mobile */ }

/* season picker fix — 4-col no breakpoint */
@media (max-width: 640px) {
    .season-picker-grid { grid-template-columns: repeat(2, 1fr); }
    .mf-review-layout { grid-template-columns: 1fr; height: auto; overflow: visible; }
}

/* filmstrip minmax fix */
.ui-template-filmstrip-row {
    grid-auto-columns: minmax(min(214px, 100%), 235px);
}

/* ── Phone breakpoint: 720px ────────────────────────────────────────── */
@media (max-width: 720px) {

    /* ── Nav ── */
    .nav-hamburger { display: flex; }

    .shell-brandbar {
        position: relative;
        flex-wrap: nowrap;
        align-items: center;
    }
    /* Hide top-bar tagline on very small screens */
    .topbar-brand-tagline { display: none; }

    .demo-effect-nav {
        position: static;
        margin-left: 0;
        flex: 0 0 auto;
    }
    /* The drawer becomes a real dropdown */
    .nav-drawer {
        display: none;
        position: absolute;
        top: calc(100% + 4px);
        right: 8px;
        background: var(--panel, #1a1d24);
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 12px;
        padding: 10px;
        flex-direction: column;
        gap: 4px;
        min-width: 210px;
        z-index: 500;
        box-shadow: 0 8px 32px rgba(0,0,0,.5);
    }
    .nav-drawer.is-open { display: flex; }

    .nav-drawer-links {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .nav-drawer-links a,
    .nav-drawer .nav-admin-link,
    .nav-drawer .nav-studio-link {
        display: block;
        padding: 9px 14px;
        border-radius: 8px;
        color: var(--ink, #edf1f7);
        text-decoration: none;
        font-size: .9rem;
        font-weight: 500;
        white-space: nowrap;
    }
    .nav-drawer-links a:hover,
    .nav-drawer .nav-studio-link:hover { background: rgba(255,255,255,.06); }
    .nav-drawer .nav-studio-link { color: #48c766; }
    .nav-drawer .nav-admin-link { color: var(--accent, #f28b3c); }
    .nav-drawer-login {
        display: block;
        padding: 9px 14px;
        border-radius: 8px;
        color: var(--ink, #edf1f7);
        text-decoration: none;
        font-size: .9rem;
        margin-top: 4px;
        border-top: 1px solid rgba(255,255,255,.07);
        padding-top: 12px;
    }
    .nav-user-cluster {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        border-top: 1px solid rgba(255,255,255,.07);
        padding-top: 10px;
        margin-top: 4px;
    }
    .nav-credits-pill { font-size: .75rem; }
    .nav-username { padding: 6px 14px; border-radius: 8px; display: block; }
    .nav-logout-btn { margin-left: 14px; }

    /* ── Home two-column → single column ── */
    .lp-welcome {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 20px;
        padding: 20px 16px 28px;
        text-align: center;
        max-width: 100%;
    }
    .lp-welcome-left  { grid-column: 1; grid-row: auto; }
    .lp-welcome-right { grid-column: 1; grid-row: auto; }
    .lp-welcome-full  { grid-column: 1; grid-row: auto; }
    .lp-welcome .lp-welcome-headline { align-items: center; text-align: center; }
    .lp-welcome .lp-h1 { justify-content: center; font-size: clamp(1.5rem, 6vw, 2.2rem); }
    .lp-welcome .lp-eyebrow,
    .lp-welcome .lp-subhead { text-align: center; }
    .lp-welcome .lp-pitch-row { justify-content: center; }
    .lp-welcome .lp-welcome-foot { justify-content: center; }
    .lp-welcome .lp-beta-notice { text-align: left; }

    /* Guide card: stack vertically on mobile */
    .lp-guide-card {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    .lp-guide-arrow { transform: rotate(90deg); }

    /* ── Studio carousel ── */
    .shell-carousel-btn--prev { left: 0; }
    .shell-carousel-btn--next { right: 0; }
    .shell-demo-strip {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }
    .shell-demo-strip::-webkit-scrollbar { display: none; }
    .demo-card.compact { scroll-snap-align: start; }

    /* ── Workspace grid ── */
    /* On mobile, hide the rail when a workflow is active — iframe gets full height */
    .workspace-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }
    /* Hide rail entirely on mobile — too cramped alongside iframe */
    .workspace-rail { display: none !important; }

    /* Iframe fills available height */
    .page-shell.shell-mode .demo-frame {
        min-height: calc(100vh - 140px);
        max-height: none;
    }

    /* ── Shell header ── */
    .shell-header { padding-bottom: 0; }
    /* Keep the filmstrip visible on mobile — only hide the marketing copy text */
    .shell-copy { display: none; }
    /* Make carousel full-width and touch-scrollable on mobile */
    .shell-mainrow { flex-direction: column; padding: 0; }
    .shell-demo-carousel { width: 100%; margin: 0; }

    /* Hide tab bar on home screen — it shows above welcome content on mobile */
    .workspace-grid.is-home .workspace-tab-bar,
    .workspace-grid.is-home [data-tab-bar] { display: none !important; }

    /* ── Dashboard ── */
    .dash-page { padding: 0 12px 40px; }
    .dash-header {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px 0 12px;
    }
    .dash-header-credits { margin-left: 0; width: 100%; }
    .dash-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .dash-tabs::-webkit-scrollbar { display: none; }
    .dash-tab { white-space: nowrap; padding: 10px 14px; font-size: 0.78rem; }
    .dash-render-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .dash-render-actions { gap: 4px; }
    .dash-render-actions .dash-action-btn { font-size: 0.68rem; padding: 4px 8px; }
    .dash-stats-row { flex-wrap: wrap; gap: 10px; }
    .dash-stat { min-width: 80px; }
    .dash-profile-grid { grid-template-columns: 1fr; }
    .dash-plan-compare { grid-template-columns: 1fr; }
    .dash-filter-bar { gap: 5px; }
    .dash-filter-btn { font-size: 0.7rem; padding: 4px 10px; }
    .dash-upgrade-strip { flex-direction: column; text-align: center; }
    .dash-low-credit-warn { flex-wrap: wrap; font-size: 0.8rem; }
    .dash-tx-list { font-size: 0.82rem; }

    /* ── Admin topbar ── */
    .admin-topbar { flex-wrap: wrap; height: auto; min-height: 52px; padding: 8px 12px; gap: 6px; }
    .admin-topbar-right {
        width: 100%;
        justify-content: flex-start;
        border-top: 1px solid rgba(255,255,255,.06);
        padding-top: 6px;
        margin-top: 2px;
        margin-left: 0;
    }
    .admin-topbar-home { font-size: 0.78rem; padding: 0.3rem 0.6rem; }
    .admin-topbar-link { font-size: 0.78rem; padding: 0.3rem 0.55rem; }
    .admin-topbar-nav { flex-wrap: wrap; gap: 4px; }

    /* ── Auth ── */
    .auth-card { padding: 20px 16px; gap: 14px; }
    .auth-title { font-size: 1.3rem; }
    .auth-submit { width: 100%; }
    .auth-google-btn { width: 100%; justify-content: center; }
}

/* ── Tighter phone breakpoint: 480px ───────────────────────────────── */
@media (max-width: 480px) {

    /* Dashboard render grid → single col */
    .dash-render-grid { grid-template-columns: 1fr; }
    .dash-stats-row { flex-direction: column; gap: 8px; }
    .dash-stats-row .dash-stat { min-width: 0; width: 100%; }

    /* Dashboard header */
    .dash-identity { gap: 8px; }
    .dash-name { font-size: .85rem; }
    .dash-email { font-size: .7rem; }

    /* Studio btn full-width */
    .lp-studio-btn { width: 100%; text-align: center; }

    /* Admin table tighter */
    .admin-table th,
    .admin-table td { font-size: .75rem; padding: 6px 8px; }
}


/* ════════════════════════════════════════════════════════════════════════════
   MOBILE STUDIO — purpose-built phone UI
   Completely replaces the desktop shell on screens ≤ 720px.
   ════════════════════════════════════════════════════════════════════════════ */

/* Hidden on desktop — only visible on mobile */
.mobile-studio { display: none; }

@media (max-width: 720px) {

    /* ── Hide the entire desktop shell ── */
    .shell-header,
    .workspace-grid { display: none !important; }

    /* ── Show the mobile studio ── */
    .mobile-studio {
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
        background: var(--bg, #0d1117);
        color: var(--ink, #edf1f7);
    }

    /* ════ Gallery screen ════ */
    .mobile-gallery {
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
        padding-bottom: env(safe-area-inset-bottom, 16px);
    }

    .mobile-gallery-intro {
        padding: 28px 20px 20px;
        text-align: center;
        background: linear-gradient(180deg, rgba(72,199,102,.06) 0%, transparent 100%);
        border-bottom: 1px solid rgba(255,255,255,.06);
    }
    .mobile-gallery-eyebrow {
        font-size: .62rem;
        font-weight: 700;
        letter-spacing: .16em;
        text-transform: uppercase;
        color: var(--accent, #f28b3c);
        opacity: .8;
        margin: 0 0 8px;
    }
    .mobile-gallery-title {
        font-size: clamp(1.6rem, 7vw, 2.2rem);
        font-weight: 900;
        letter-spacing: -.02em;
        line-height: 1.15;
        margin: 0 0 8px;
        color: var(--ink, #edf1f7);
    }
    .mobile-aifi-word {
        position: relative;
        display: inline-block;
        background: linear-gradient(135deg, #f28b3c 30%, #ffb870);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        padding-top: .5em;
    }
    .mobile-aifi-word::before {
        content: '';
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        width: 1.4em;
        height: .52em;
        margin-bottom: -.38em;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 42'%3E%3Ccircle cx='30' cy='39' r='5' fill='%2348c8e8'/%3E%3Cpath d='M16,28 Q30,15 44,28' stroke='%2348c8e8' fill='none' stroke-width='5.5' stroke-linecap='round'/%3E%3Cpath d='M4,17 Q30,0 56,17' stroke='%2348c8e8' fill='none' stroke-width='5.5' stroke-linecap='round'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center bottom;
        opacity: .92;
    }
    .mobile-gallery-sub {
        font-size: .85rem;
        color: var(--muted, #98a2b3);
        margin: 0;
        line-height: 1.5;
    }

    /* 2-column card grid */
    .mobile-gallery-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 16px 12px;
        flex: 1;
    }

    .mobile-gallery-card {
        display: flex;
        flex-direction: column;
        background: var(--panel, #1a1d24);
        border: 1px solid rgba(255,255,255,.08);
        border-radius: 14px;
        overflow: hidden;
        cursor: pointer;
        text-align: left;
        transition: border-color .18s, transform .14s;
        padding: 0;
        width: 100%;
    }
    .mobile-gallery-card:active { transform: scale(.97); }
    .mobile-gallery-card:hover { border-color: rgba(72,199,102,.35); }

    .mobile-gallery-card--soon {
        opacity: .45;
        cursor: default;
        pointer-events: none;
    }

    .mobile-gallery-thumb,
    .mobile-gallery-video {
        width: 100%;
        aspect-ratio: 4 / 3;
        object-fit: cover;
        display: block;
        background: rgba(255,255,255,.04);
    }
    .mobile-gallery-placeholder {
        width: 100%;
        aspect-ratio: 4 / 3;
        background: rgba(255,255,255,.04);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .mobile-gallery-soon {
        font-size: .65rem;
        font-weight: 700;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: var(--muted, #98a2b3);
        border: 1px solid rgba(255,255,255,.12);
        padding: 3px 9px;
        border-radius: 999px;
    }

    .mobile-gallery-meta {
        padding: 10px 12px 12px;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .mobile-gallery-name-row {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: nowrap;
    }
    .mobile-gallery-ai-tag {
        flex-shrink: 0;
        font-size: .56rem;
        font-weight: 900;
        letter-spacing: .08em;
        padding: 2px 6px;
        border-radius: 5px;
        background: linear-gradient(135deg, #f28b3c 0%, #ffb870 100%);
        color: #1a0e00;
        line-height: 1;
    }
    .mobile-gallery-name {
        font-size: .82rem;
        font-weight: 700;
        color: var(--ink, #edf1f7);
        line-height: 1.3;
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mobile-gallery-tagline {
        font-size: .72rem;
        color: var(--muted, #98a2b3);
        line-height: 1.4;
        display: block;
    }

    /* ── Before / After wipe animation ── */
    .mobile-gallery-media {
        position: relative;
        width: 100%;
        aspect-ratio: 4 / 3;
        overflow: hidden;
        background: rgba(255,255,255,.04);
    }
    .mgm-before-wrap,
    .mgm-after-wrap {
        position: absolute;
        inset: 0;
    }
    .mgm-before,
    .mgm-after {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    .mgm-after-wrap {
        animation: mobBaReveal 6s ease-in-out infinite;
    }
    .mgm-wipe-line {
        position: absolute;
        top: 0; bottom: 0;
        width: 2px;
        background: rgba(255,255,255,.9);
        box-shadow: 0 0 6px rgba(0,0,0,.5), 0 0 14px rgba(255,255,255,.12);
        pointer-events: none;
        animation: mobBaLine 6s ease-in-out infinite;
        opacity: 0;
    }
    /* small BEFORE / AFTER corner labels */
    .mgm-lbl {
        position: absolute;
        bottom: 8px;
        font-size: .56rem;
        font-weight: 800;
        letter-spacing: .1em;
        padding: 2px 7px;
        border-radius: 4px;
        line-height: 1.6;
        pointer-events: none;
    }
    .mgm-lbl-b {
        left: 8px;
        background: rgba(0,0,0,.55);
        color: rgba(255,255,255,.75);
        opacity: 1;
    }
    .mgm-lbl-a {
        right: 8px;
        left: auto;
        background: rgba(242,139,60,.85);
        color: #fff;
        opacity: 1;
    }

    @keyframes mobBaReveal {
        /* Phase 1: hold before (after hidden) — 0-15% = 0.9s */
        0%   { clip-path: inset(0 100% 0 0); opacity: 1; }
        15%  { clip-path: inset(0 100% 0 0); opacity: 1; }
        /* Phase 2: wipe in — 15-33% = 1.1s */
        33%  { clip-path: inset(0 0 0 0);    opacity: 1; }
        /* Phase 3: hold after (extended) — 33-75% = 2.5s */
        75%  { clip-path: inset(0 0 0 0);    opacity: 1; }
        /* Phase 4: fade out — 75-88% = 0.8s */
        88%  { clip-path: inset(0 0 0 0);    opacity: 0; }
        /* Phase 5: reset while invisible */
        99%  { clip-path: inset(0 100% 0 0); opacity: 0; }
        100% { clip-path: inset(0 100% 0 0); opacity: 0; }
    }
    @keyframes mobBaLine {
        0%, 14.5% { left: 0%;               opacity: 0; }
        15%       { left: 0%;               opacity: 1; }
        32.5%     { left: calc(100% - 2px); opacity: 1; }
        33%, 100% { left: calc(100% - 2px); opacity: 0; }
    }
    @keyframes mobLblB {
        0%, 25%   { opacity: 1; }
        33%, 100% { opacity: 0; }
    }
    @keyframes mobLblA {
        0%, 32%   { opacity: 0; }
        42%, 68%  { opacity: 1; }
        80%, 100% { opacity: 0; }
    }

    /* Credits footer */
    .mobile-gallery-foot {
        padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgba(255,255,255,.06);
        text-align: center;
    }
    .mobile-credits-pill {
        font-size: .78rem;
        color: var(--muted, #98a2b3);
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }
    .mobile-credits-dot {
        width: 6px; height: 6px;
        border-radius: 50%;
        background: #48c766;
        display: inline-block;
        flex-shrink: 0;
    }
    .mobile-credits-pill a { color: var(--accent, #f28b3c); text-decoration: none; }

    /* ════ Workflow screen ════ */
    .mobile-workflow {
        display: flex;
        flex-direction: column;
        height: 100dvh;
        position: fixed;
        inset: 0;
        z-index: 300;
        background: var(--bg, #0d1117);
    }
    .mobile-workflow[hidden] { display: none !important; }

    .mobile-workflow-bar {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 12px;
        height: 48px;
        flex-shrink: 0;
        background: var(--panel, #1a1d24);
        border-bottom: 1px solid rgba(255,255,255,.08);
        z-index: 10;
    }
    .mobile-back-btn {
        display: flex;
        align-items: center;
        gap: 4px;
        background: none;
        border: none;
        color: var(--accent, #f28b3c);
        font-size: .88rem;
        font-weight: 700;
        cursor: pointer;
        padding: 6px 8px 6px 2px;
        flex-shrink: 0;
    }
    .mobile-back-btn svg { width: 16px; height: 16px; }
    .mobile-workflow-title {
        font-size: .82rem;
        font-weight: 600;
        color: var(--muted, #98a2b3);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex: 1;
        text-align: right;
    }

    .mobile-workflow-frame {
        flex: 1;
        width: 100%;
        border: none;
        background: var(--bg, #0d1117);
        min-height: 0;
    }

    /* On mobile the desktop shell is hidden and .mobile-studio replaces it.
       Override the desktop viewport-pinning so the gallery grid can scroll. */
    .page-shell.shell-mode {
        display: flex;
        flex-direction: column;
        height: auto !important;
        overflow: visible !important;
        overflow-x: hidden !important;
    }

    .mobile-gallery-try { display: none; }

    /* ── Coming Soon banner ── */
    .mobile-coming-soon-banner {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 0 12px;
        padding: 14px 16px;
        background: rgba(242,139,60,0.08);
        border: 1px solid rgba(242,139,60,0.2);
        border-radius: 12px;
        font-size: .82rem;
        color: rgba(255,255,255,0.85);
        line-height: 1.45;
    }
    .mobile-coming-soon-icon {
        font-size: 1.4rem;
        flex-shrink: 0;
    }
    .mobile-coming-soon-banner strong {
        display: block;
        font-size: .85rem;
        color: #f28b3c;
        margin-bottom: 2px;
    }
    .mobile-coming-soon-hint {
        font-size: .75rem;
        color: rgba(255,255,255,0.5);
    }

    /* ── Beta CTA (mobile) ── */
    .mobile-beta-cta {
        padding: 16px 12px 4px;
        text-align: center;
    }
    .mobile-beta-cta .beta-req-submit {
        width: 100%;
        font-size: 1rem;
        padding: 14px 24px;
    }

    /* ── Mobile footer links ── */
    .mobile-foot-links {
        display: flex;
        justify-content: center;
        gap: 20px;
        flex-wrap: wrap;
        margin-bottom: 10px;
    }
    .mobile-foot-links a {
        font-size: .8rem;
        font-weight: 600;
        color: rgba(255,255,255,0.5);
        text-decoration: none;
        transition: color 150ms;
    }
    .mobile-foot-links a:hover { color: var(--accent, #f28b3c); }
    .mobile-foot-copy {
        font-size: .7rem;
        color: rgba(255,255,255,0.25);
        margin: 0;
        text-align: center;
    }

    /* Make mobile cards non-interactive (showcase only) */
    .mobile-gallery-card {
        cursor: default;
        pointer-events: none;
    }
    .mobile-gallery-card video { pointer-events: auto; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile workflow layout — stack all multi-column grids to 1 column
   Applies inside iframe workflow pages (same app.css served to iframes)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 720px) {

    /* ── Main 3-column workflow grid ─────────────────────────────────────── */
    .demo-effect-grid {
        grid-template-columns: 1fr !important;
        overflow-x: hidden;
    }

    /* ── Magazine 2-column grid ──────────────────────────────────────────── */
    .demo-effect-grid-magazine {
        grid-template-columns: 1fr !important;
    }

    /* ── Workflow screens: allow vertical scroll ─────────────────────────── */
    .demo-effect-screen {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        height: auto !important;
        max-height: none !important;
    }

    /* ── Panel padding/font tightening ───────────────────────────────────── */
    .panel, .step-panel {
        padding: 14px 14px !important;
    }
    .panel h2, .step-panel-summary h2 {
        font-size: 1rem !important;
    }
    .recipe-panel-head h2, .step-panel-summary h2 {
        font-size: .96rem !important;
    }

    /* ── Choice card grids: max 2 cols instead of 3-4 ───────────────────── */
    .demo-effect-choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    /* ── Result / recipe / review grids ─────────────────────────────────── */
    .result-shell,
    .demo-recipe-grid,
    .demo-review-grid,
    .reveal-browser-grid,
    .prompt-editor-shell,
    .ui-grounding-canvas {
        grid-template-columns: 1fr !important;
    }

    /* ── Launchpad / workroom page grids ─────────────────────────────────── */
    .ui-launchpad-grid,
    .ui-launchpad-band-inner,
    .ui-workroom-grid,
    .ui-grounding-shell,
    .ui-lab-hero,
    .ui-launchpad-hero {
        grid-template-columns: 1fr !important;
        padding: 16px !important;
    }

    /* ── Dropzone layout (desktop 2-col upload area) ─────────────────────── */
    .dropzone-layout {
        grid-template-columns: 1fr !important;
    }

    /* ── Filmstrip in workflow pages ─────────────────────────────────────── */
    .ui-template-filmstrip-row {
        grid-auto-columns: minmax(min(280px, 100%), 1fr) !important;
    }

    /* ── Image preview fits screen ───────────────────────────────────────── */
    .demo-effect-screen .preview-image,
    .canvas-wrap img {
        max-height: 55vw !important;
        object-fit: contain;
    }

    /* ── Step panel summary row layout ──────────────────────────────────────*/
    .step-panel-summary {
        gap: 8px !important;
    }

    /* ── Button rows: allow wrapping ─────────────────────────────────────── */
    .button-row {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .button-row .secondary-btn,
    .button-row .primary-btn {
        font-size: .84rem !important;
        padding: 8px 14px !important;
    }

    /* ── Form inputs full width ──────────────────────────────────────────── */
    .demo-effect-screen input[type="text"],
    .demo-effect-screen input[type="number"],
    .demo-effect-screen textarea,
    .demo-effect-screen select {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* ── Eyebrow labels smaller ──────────────────────────────────────────── */
    .eyebrow { font-size: .68rem !important; letter-spacing: .04em; }

    /* ── Width containment — prevent grid children from expanding past viewport ── */
    .page-shell {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    .demo-effect-shell {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    .demo-effect-screen {
        grid-template-columns: minmax(0, 1fr) !important;
        max-width: 100vw !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }
    .demo-effect-topbar,
    .demo-effect-workspace,
    .workspace-shelf {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    .workspace-shelf-body {
        min-width: 0 !important;
        max-width: 100% !important;
    }
    .workspace-shelf-panels {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    .workspace-shelf-scroll-shell {
        min-width: 0 !important;
    }
    .workspace-shelf-scroll {
        min-width: 0 !important;
    }
    .demo-effect-browser-head {
        min-width: 0 !important;
        max-width: 100% !important;
    }
    .wf-flow {
        min-width: 0 !important;
    }

    /* ── Workspace shelf — stack tabs above panels on mobile ─────────────── */
    .workspace-shelf {
        max-width: 100% !important;
        overflow: hidden !important;
    }
    .workspace-shelf-body {
        grid-template-columns: 1fr !important;
        gap: 4px !important;
        height: auto !important;
        min-height: 0 !important;
    }
    .workspace-shelf-rail {
        display: flex !important;
        gap: 0 !important;
    }
    .workspace-shelf-tabs {
        display: flex !important;
        flex-direction: row !important;
        gap: 4px !important;
    }
    .workspace-shelf-tab {
        flex: 1;
        text-align: center;
        justify-content: center;
        padding: 6px 8px !important;
        font-size: .72rem !important;
    }
    .workspace-shelf-panels {
        height: auto !important;
        min-height: 0 !important;
    }
    .workspace-shelf-scroll-shell {
        height: auto !important;
        min-height: 60px !important;
    }
    .workspace-shelf-scroll {
        height: auto !important;
        min-height: 60px !important;
    }
    .workspace-shelf-card-row {
        grid-auto-columns: minmax(120px, 140px) !important;
    }
    .workspace-shelf-card {
        height: auto !important;
        min-height: 60px !important;
    }

    /* ── wf-flow — full-width, no centering overshoot ───────────────────── */
    .wf-flow {
        max-width: 100% !important;
        padding: .75rem !important;
        box-sizing: border-box !important;
    }

    /* ── Options toolbar — wrap on small screens ─────────────────────────── */
    .wf-options-toolbar {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: .5rem .75rem !important;
    }
    .wf-toolbar-divider { display: none !important; }

    /* ── Generate bar — stack vertically ──────────────────────────────────── */
    .wf-generate-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: .5rem !important;
        padding: .75rem !important;
    }
    .wf-generate-btn {
        width: 100% !important;
        text-align: center;
    }
    .wf-seed-compact {
        justify-content: flex-start !important;
    }

    /* ── Gallery strip — smaller thumbnails ───────────────────────────────── */
    .wf-gallery-strip {
        --gallery-thumb-size: 68px !important;
    }

    /* ── Browser title row — stack on mobile ──────────────────────────────── */
    .demo-effect-browser-title {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
    }
    .demo-effect-browser-title h1 {
        font-size: 1rem !important;
    }

    /* ── Title row — single column ────────────────────────────────────────── */
    .demo-effect-title-row,
    .demo-effect-title-row-compact {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Mobile image input — Camera + Library buttons
   ═══════════════════════════════════════════════════════════════════════════ */

/* Always hidden on desktop */
.mobile-upload-row { display: none; }
.mobile-upload-status-line { display: none; }

@media (max-width: 720px) {
    /* Hide the desktop drag/drop zone */
    .desktop-dropzone { display: none !important; }

    /* Show the two-button mobile row */
    .mobile-upload-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
        margin-bottom: 4px;
    }

    .mobile-upload-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 18px 12px;
        background: rgba(255,255,255,.05);
        border: 1.5px dashed rgba(255,255,255,.18);
        border-radius: 14px;
        cursor: pointer;
        color: var(--fg, #e6edf3);
        text-align: center;
        transition: background .15s, border-color .15s;
        font-family: inherit;
        font-size: .88rem;
        line-height: 1.2;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-upload-btn:active,
    .mobile-upload-btn:focus-visible {
        background: rgba(242,139,60,.12);
        border-color: var(--accent, #f28b3c);
        outline: none;
    }
    .mobile-upload-btn svg { opacity: .85; }
    .mobile-upload-label { font-weight: 600; font-size: .92rem; }
    .mobile-upload-hint { font-size: .76rem; opacity: .6; }

    .mobile-upload-status-line {
        display: block;
        font-size: .8rem;
        color: var(--accent, #f28b3c);
        min-height: 1.2em;
        text-align: center;
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Live Camera Modal
   ═══════════════════════════════════════════════════════════════════════════ */

.camera-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9990;
    background: #000;
    flex-direction: column;
}
.camera-modal.is-open { display: flex; }

.camera-modal-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 540px;
    margin: 0 auto;
}

/* Top bar: Cancel (left) + Flip (right) */
.camera-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    flex-shrink: 0;
    background: rgba(0,0,0,.6);
}

.camera-cancel-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #fff;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 4px;
    opacity: .9;
    font-family: inherit;
}
.camera-cancel-btn:active { opacity: .6; }

.camera-flip-btn {
    background: rgba(255,255,255,.12);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: background .15s;
}
.camera-flip-btn:active { background: rgba(255,255,255,.25); }

/* Viewfinder */
.camera-viewfinder {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-video,
.camera-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.camera-canvas { display: none; }

/* Bottom bar */
.camera-bottombar {
    flex-shrink: 0;
    background: rgba(0,0,0,.75);
    padding: 20px 24px 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.camera-shutter-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-shutter-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: rgba(255,255,255,.9);
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(255,255,255,.25);
    transition: transform .1s, background .1s;
    -webkit-tap-highlight-color: transparent;
}
.camera-shutter-btn:active {
    transform: scale(.92);
    background: #e0e0e0;
}

.camera-confirm-row {
    display: flex;
    gap: 16px;
    width: 100%;
    justify-content: center;
}

.camera-retake-btn {
    flex: 1;
    max-width: 150px;
    padding: 13px 0;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,.3);
    background: transparent;
    color: #fff;
    font-size: .96rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.camera-retake-btn:active { background: rgba(255,255,255,.1); }

.camera-use-btn {
    flex: 1;
    max-width: 150px;
    padding: 13px 0;
    border-radius: 10px;
    border: none;
    background: var(--accent, #f28b3c);
    color: #fff;
    font-size: .96rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.camera-use-btn:active { filter: brightness(.88); }

.camera-error-msg {
    color: #ff6b6b;
    font-size: .84rem;
    text-align: center;
    padding: 8px 16px;
    background: rgba(255,107,107,.08);
    border-radius: 8px;
    margin: 0 16px 8px;
}

/* ══════════════════════════════════════════════════════════════
   DEMO 1 — mobile responsive overrides
   Stacks the two-column layout to single column on small screens.
══════════════════════════════════════════════════════════════ */
@media (max-width: 720px) {
    .d1-workspace {
        padding: .5rem .6rem;
        gap: .5rem;
    }
    .d1-top-area {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
        max-height: none;
    }
    .d1-source-col,
    .d1-scenes-col {
        width: 100%;
        min-width: 0;
        min-height: 0;
        overflow: visible;
    }
    .d1-source-col {
        height: 220px;
    }
    .d1-scenes-col {
        height: auto;
        max-height: 260px;
    }
    .d1-scenes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .d1-bottom-area {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════════════════════════════
   CAROUSEL CARDS — "Try it" discoverability badge
══════════════════════════════════════════════════════════════ */

/* ── Chain-mode banner ──────────────────────────────────────────── */
.shell-chain-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: linear-gradient(90deg, rgba(242,139,60,0.18), rgba(242,139,60,0.08));
    border-bottom: 1px solid rgba(242,139,60,0.35);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent, #f28b3c);
    z-index: 100;
    animation: chain-banner-pulse 2s ease-in-out infinite;
}
.shell-chain-banner[hidden] { display: none !important; }
.shell-chain-banner-icon { font-size: 1.1rem; }
.shell-chain-banner-text { flex: 1; }
.shell-chain-banner-cancel {
    background: none;
    border: 1px solid rgba(242,139,60,0.4);
    border-radius: 999px;
    color: rgba(242,139,60,0.8);
    font-size: 0.75rem;
    padding: 3px 10px;
    cursor: pointer;
}
.shell-chain-banner-cancel:hover { background: rgba(242,139,60,0.12); color: var(--accent); }
@keyframes chain-banner-pulse {
    0%, 100% { background: linear-gradient(90deg, rgba(242,139,60,0.18), rgba(242,139,60,0.08)); }
    50%       { background: linear-gradient(90deg, rgba(242,139,60,0.28), rgba(242,139,60,0.14)); }
}

/* Carousel cards pulse in chain-pick mode */
.is-chain-pick .demo-card:not(.demo-card--coming-soon) .card-try-badge {
    background: var(--accent, #f28b3c);
    animation: cg-pulse 1.2s ease-in-out infinite;
    content: 'Pick me →';
}

/* ── Chain CTA on result page ───────────────────────────────────── */
.dr-chain-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 0 4px;
}
.dr-chain-cta-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 1.05rem;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(242,139,60,0.18), rgba(242,139,60,0.08));
    border: 2px solid rgba(242,139,60,0.5);
    border-radius: 14px;
    color: var(--accent, #f28b3c);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
    width: 100%;
    justify-content: center;
}
.dr-chain-cta-btn:hover:not(:disabled) {
    background: rgba(242,139,60,0.22);
    border-color: var(--accent, #f28b3c);
    transform: translateY(-1px);
}
.dr-chain-cta-btn:disabled {
    opacity: 0.7;
    cursor: default;
    transform: none;
}
.dr-chain-cta-icon { font-size: 1.3rem; }
.dr-chain-cta-hint {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent, #f28b3c);
    animation: cg-pulse 1.6s ease-in-out infinite;
    margin: 0;
}
.dr-chain-cta-hint[hidden] { display: none !important; }

/* ── Private-beta welcome modal ────────────────────────────────── */
.beta-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(7, 9, 14, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 16px;
}
.beta-modal-backdrop[hidden] { display: none !important; }
.beta-modal-backdrop.is-open { opacity: 1; pointer-events: auto; }

.beta-modal-card {
    position: relative;
    width: 100%;
    max-width: 620px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    border-radius: 20px;
    padding: 36px 36px 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transform: translateY(16px);
    transition: transform 0.3s ease;
    background: #12151c;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 32px 80px rgba(0,0,0,0.7);
}
.beta-modal-backdrop.is-open .beta-modal-card { transform: translateY(0); }

.beta-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.6);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.beta-modal-close:hover { background: rgba(255,255,255,0.14); color: #fff; }

.beta-modal-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 4px;
}
.beta-modal-logo-img { height: 48px; width: auto; }
.beta-badge-pill {
    background: rgba(242,139,60,0.18);
    color: var(--accent, #f28b3c);
    border: 1px solid rgba(242,139,60,0.35);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    text-transform: uppercase;
}

.beta-modal-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}
.beta-modal-lede {
    margin: 0;
    font-size: 1rem;
    color: rgba(255,255,255,0.72);
    line-height: 1.55;
}

.beta-modal-videos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.beta-modal-video-wrap {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #0b0d11;
    max-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.beta-modal-video-wrap video {
    display: block;
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
}
.beta-modal-video-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    text-align: center;
}

.beta-modal-note {
    font-size: 0.82rem;
    margin: 0;
    line-height: 1.5;
}
.beta-modal-actions {
    display: flex;
    gap: 10px;
}
.beta-modal-login-btn {
    text-decoration: none;
    flex: 1;
    text-align: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}
.beta-modal-request-btn {
    flex: 1;
    text-align: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    border: 1px solid rgba(72,199,102,0.4);
    background: rgba(72,199,102,0.1);
    color: #48c766;
    cursor: pointer;
    transition: background 150ms, border-color 150ms;
}
.beta-modal-request-btn:hover {
    background: rgba(72,199,102,0.2);
    border-color: rgba(72,199,102,0.6);
}

@media (max-width: 720px) {
    .beta-modal-backdrop { padding: 10px; }
    .beta-modal-card {
        max-width: 100%;
        max-height: calc(100dvh - 20px);
        padding: 24px 18px 18px;
        gap: 12px;
        border-radius: 16px;
    }
    .beta-modal-logo-img { height: 36px; }
    .beta-modal-title { font-size: 1.2rem; }
    .beta-modal-lede { font-size: .85rem; }
    .beta-modal-lede br { display: none; }
    .beta-modal-videos { gap: 6px; }
    .beta-modal-video-wrap { max-height: 140px; border-radius: 8px; }
    .beta-modal-video-wrap video { max-height: 140px; }
    .beta-modal-video-label { font-size: .6rem; padding: 4px 6px; }
    .beta-modal-note { font-size: .75rem; }
    .beta-modal-login-btn { font-size: .88rem; padding: .6rem 1rem; }
}
@media (max-width: 400px) {
    .beta-modal-card { padding: 18px 14px 14px; gap: 10px; }
    .beta-modal-title { font-size: 1.05rem; }
    .beta-modal-videos { grid-template-columns: 1fr; gap: 8px; }
    .beta-modal-video-wrap { max-height: 120px; }
    .beta-modal-video-wrap video { max-height: 120px; }
}

.demo-card {
    position: relative;
}
.card-copy--titled {
    padding: 4px 8px 6px;
}
.card-copy--titled .card-try-badge {
    margin-left: auto;
}
.card-try-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    background: rgba(242, 139, 60, .9);
    color: #fff;
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: .18rem .5rem;
    border-radius: 2rem;
    pointer-events: none;
    white-space: nowrap;
}

/* Video card hover hint — stays visible, does not hide on hover */
.card-video-hint {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    text-align: center;
    padding-bottom: 4px;
    color: rgba(255, 255, 255, .38);
    font-size: .52rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 1;
    transition: opacity .2s;
    white-space: nowrap;
}
.demo-card:hover .card-video-hint,
.demo-card.is-playing .card-video-hint {
    opacity: 1;
}
/* matte-card still contains its own layers — no absolute needed */
.matte-card .card-video-hint {
    z-index: unset;
}

/* Mobile gallery card — "Tap to try" inline tag */
.mobile-gallery-try {
    display: inline-block;
    margin-top: .2rem;
    font-size: .65rem;
    font-weight: 700;
    color: var(--accent, #f28b3c);
    letter-spacing: .04em;
}

/* ── Compound Workflow page ─────────────────────────────────────────────── */
.compound-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
    font-family: var(--font-main, sans-serif);
}
.compound-header {
    text-align: center;
    margin-bottom: 2rem;
}
.compound-logo-pill {
    display: inline-block;
    background: var(--accent, #f28b3c);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    padding: .25rem .9rem;
    border-radius: 2rem;
    margin-bottom: .75rem;
}
.compound-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 .3rem;
    line-height: 1.3;
}
.compound-subtitle {
    font-size: .85rem;
    margin: 0;
}

/* Step list */
.compound-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.compound-step {
    display: flex;
    gap: .9rem;
    background: var(--card-bg, #1a1a2e);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: .75rem;
    padding: 1rem;
    transition: border-color .25s, opacity .25s;
}
.compound-step.is-done {
    border-color: rgba(80, 200, 120, .4);
    opacity: .85;
}
.compound-step.is-ready {
    border-color: var(--accent, #f28b3c);
}
.compound-step-collect {
    opacity: .45;
    pointer-events: none;
}
.compound-step-collect.is-ready,
.compound-step-collect.is-done {
    opacity: 1;
    pointer-events: auto;
}
.compound-step-badge {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    font-weight: 700;
}
.compound-step.is-done .compound-step-badge {
    background: rgba(80, 200, 120, .3);
    color: #50c878;
}
.compound-step.is-ready .compound-step-badge {
    background: rgba(242, 139, 60, .2);
    color: var(--accent, #f28b3c);
}
.compound-step-body {
    flex: 1;
    min-width: 0;
}
.compound-step-title {
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: .65rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
}
.compound-step-frame-label {
    font-size: .75rem;
    font-weight: 400;
    opacity: .6;
    flex-shrink: 0;
}
.compound-step-media {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .75rem;
}
.compound-media-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
}
.compound-media-label {
    font-size: .65rem;
    opacity: .55;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.compound-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: .4rem;
    background: rgba(255,255,255,.06);
    display: block;
}
.compound-thumb-pending {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: .4;
}
.compound-thumb-expired {
    font-size: 1.4rem;
    opacity: .35;
    cursor: help;
}
.compound-arrow {
    font-size: 1.2rem;
    opacity: .45;
    padding: 0 .1rem;
}
.compound-render-all-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #1a1a1a;
    color: #f28b3c;
    border: 1.5px solid #f28b3c;
    border-radius: 999px;
    padding: .45rem 1.1rem;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: .5rem;
    transition: background .18s, color .18s;
}
.compound-render-all-btn:hover { background: #f28b3c; color: #fff; }
.compound-render-all-btn:disabled { opacity: .5; cursor: default; }

.compound-open-btn {
    display: inline-block;
    background: var(--accent, #f28b3c);
    color: #fff;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 700;
    padding: .35rem .85rem;
    border-radius: .5rem;
    cursor: pointer;
    transition: opacity .2s;
}
.compound-open-btn:hover { opacity: .85; }
.compound-open-btn.is-disabled {
    opacity: .35;
    pointer-events: none;
    cursor: default;
}
.compound-open-btn.is-in-progress {
    background: rgba(242, 139, 60, .2);
    color: var(--accent, #f28b3c);
    border: 1px solid var(--accent, #f28b3c);
    pointer-events: none;
}
.compound-step-hint {
    font-size: .75rem;
    margin-top: .35rem;
    margin-bottom: 0;
}
.compound-collect-btn {
    background: rgba(242, 139, 60, .15);
    color: var(--accent, #f28b3c);
    border: 1px solid var(--accent, #f28b3c);
}
.compound-step.is-ready .compound-collect-btn {
    background: var(--accent, #f28b3c);
    color: #fff;
}
.compound-done-label {
    font-size: .8rem;
    color: #50c878;
    font-weight: 600;
}
.compound-collect-hint {
    font-size: .75rem;
    margin-top: .35rem;
    margin-bottom: 0;
}
.compound-done-banner {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(80, 200, 120, .12);
    border: 1px solid rgba(80, 200, 120, .35);
    border-radius: .75rem;
    font-weight: 700;
    color: #50c878;
    font-size: 1rem;
}

/* Banner shown on result page when it was opened as part of a chain step */
.compound-report-banner {
    background: rgba(80, 200, 120, .15);
    border: 1px solid rgba(80, 200, 120, .4);
    border-radius: .5rem;
    padding: .55rem 1rem;
    font-size: .82rem;
    font-weight: 600;
    color: #50c878;
    margin-bottom: 1rem;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CINEMATIC HOME SCREEN
   Fixed full-viewport overlay; gallery fades between renders in BG;
   home-content = left (text/CTA) + right (studio preview mock).
═══════════════════════════════════════════════════════════════════════════ */
.home-cinematic {
    position: fixed;
    inset: 0;
    z-index: 9000;   /* above shell-header, nav, and every overlay */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #09090b;
}
.home-cinematic[hidden] { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   LAUNCHER GRID — full-page workflow picker (first-time landing)
   ═══════════════════════════════════════════════════════════════════════════ */
.launcher-home {
    align-items: stretch;
    background: linear-gradient(180deg, #0c0b10 0%, #111118 100%);
}
.launcher-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 48px 40px 32px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.12) transparent;
}
.launcher-header {
    text-align: center;
    margin-bottom: 28px;
}
.launcher-headline {
    font-size: 2rem;
    font-weight: 800;
    color: #f5efe8;
    margin: 0 0 8px;
    letter-spacing: -.02em;
}
.launcher-sub {
    font-size: .95rem;
    color: rgba(255,255,255,.45);
    margin: 0;
}
.launcher-filters {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.launcher-filter-btn {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    color: rgba(255,255,255,.5);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: color .15s, background .15s, border-color .15s;
}
.launcher-filter-btn:hover {
    color: #f5efe8;
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.15);
}
.launcher-filter-btn.is-active {
    color: #f5efe8;
    background: var(--accent, #f28b3c);
    border-color: var(--accent, #f28b3c);
}
.launcher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}
.launcher-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    text-decoration: none;
    color: inherit;
    transition: border-color .2s, transform .15s, box-shadow .2s;
    cursor: pointer;
}
.launcher-card:hover {
    border-color: rgba(255,255,255,.18);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.launcher-card[hidden] { display: none !important; }
.launcher-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: rgba(0,0,0,.3);
}
.launcher-card-media img,
.launcher-card-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.launcher-card-media video { pointer-events: none; }
.launcher-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: .85rem;
    color: rgba(255,255,255,.25);
    text-align: center;
    padding: 12px;
}
.launcher-card-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.launcher-card-title {
    font-size: .85rem;
    font-weight: 700;
    color: #f5efe8;
    margin: 0;
    line-height: 1.3;
}
.launcher-card-tagline {
    font-size: .72rem;
    color: rgba(255,255,255,.4);
    margin: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.launcher-card-badge {
    display: inline-block;
    align-self: flex-start;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.45);
}
.launcher-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.06);
}
.launcher-skip-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .8rem;
    color: rgba(255,255,255,.4);
    cursor: pointer;
}
.launcher-skip-label input[type="checkbox"] {
    accent-color: var(--accent, #f28b3c);
    width: 15px;
    height: 15px;
}
.launcher-footer-hint {
    font-size: .72rem;
    color: rgba(255,255,255,.25);
    margin-top: 8px;
}
.launcher-footer-hint strong { color: rgba(255,255,255,.45); }

/* ── Launcher header actions (Jump to Studio / Always skip) ──────────── */
.launcher-actions {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    align-items: center;
    justify-content: center;
}
.launcher-jump-btn {
    padding: 7px 20px;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 600;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.15);
    color: rgba(255,255,255,.75);
    cursor: pointer;
    transition: all .15s;
}
.launcher-jump-btn:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
    border-color: rgba(255,255,255,.25);
}
.launcher-skip-forever-btn {
    padding: 7px 16px;
    border-radius: 8px;
    font-size: .76rem;
    font-weight: 500;
    background: none;
    border: 1px solid rgba(255,255,255,.08);
    color: rgba(255,255,255,.35);
    cursor: pointer;
    transition: all .15s;
}
.launcher-skip-forever-btn:hover {
    color: rgba(255,255,255,.6);
    border-color: rgba(255,255,255,.15);
}

/* ══════════════════════════════════════════════════════════════════════════
   STUDIO EMPTY STATE — Blender-style "pick a workflow" landing
   ══════════════════════════════════════════════════════════════════════════ */
.studio-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
    padding: 24px 16px;
}
.studio-empty[hidden] { display: none !important; }

.studio-empty-inner {
    text-align: center;
    max-width: 680px;
}

.studio-empty-title {
    font-size: clamp(1.2rem, 2.2vw, 1.7rem);
    font-weight: 800;
    color: rgba(255,255,255,.8);
    margin: 0 0 6px;
}
.studio-empty-sub {
    font-size: .85rem;
    color: rgba(255,255,255,.35);
    margin: 0 0 28px;
    line-height: 1.5;
}
.studio-empty-sub strong { color: rgba(255,255,255,.5); }

.studio-empty-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}
@media (max-width: 540px) { .studio-empty-cards { grid-template-columns: 1fr; } }

.studio-empty-card {
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px;
    padding: 24px 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: border-color .2s;
}
.studio-empty-card:hover { border-color: rgba(255,255,255,.12); }
.studio-empty-card--main {
    border-color: rgba(242,139,60,.15);
    background: rgba(242,139,60,.03);
}
.studio-empty-card--main:hover { border-color: rgba(242,139,60,.3); }

.studio-empty-icon {
    color: rgba(255,255,255,.2);
    margin-bottom: 4px;
}
.studio-empty-card--main .studio-empty-icon { color: rgba(242,139,60,.35); }

.studio-empty-card h3 {
    font-size: .82rem;
    font-weight: 700;
    color: rgba(255,255,255,.65);
    margin: 0;
}
.studio-empty-card p {
    font-size: .72rem;
    color: rgba(255,255,255,.3);
    margin: 0;
    line-height: 1.45;
}

.studio-empty-browse-btn {
    padding: 9px 24px;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(242,139,60,.15), rgba(242,139,60,.08));
    border: 1px solid rgba(242,139,60,.3);
    color: var(--accent, #f28b3c);
    cursor: pointer;
    transition: all .15s;
}
.studio-empty-browse-btn:hover {
    background: rgba(242,139,60,.2);
    border-color: var(--accent, #f28b3c);
}

/* Autoplay video on card hover */
.launcher-card:hover video { opacity: 1; }
.launcher-card video { opacity: .85; transition: opacity .2s; }

/* ── Gallery background ─────────────────────────────────────────────────── */
.home-gallery {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}
.home-gallery-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.4s ease-in-out;
    pointer-events: none;
}
.home-gallery-slide.is-active { opacity: 1; }
.home-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(.48) saturate(1.15);
}
.home-gallery-vignette {
    position: absolute;
    inset: 0;
    background:
        /* radial centre darkener — kills the background in the content zone */
        radial-gradient(ellipse 60% 70% at 50% 50%, rgba(0,0,0,.55) 0%, transparent 100%),
        /* directional vignette */
        linear-gradient(115deg, rgba(0,0,0,.94) 0%, rgba(0,0,0,.78) 42%, rgba(0,0,0,.58) 100%);
    pointer-events: none;
}

/* ── Content layout — single vertical column ────────────────────────────── */
/* ── Three-column home layout ────────────────────────────────────────────── */
.home-layout {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 185px 1fr 195px;
    overflow: hidden;
    width: 100%;
    max-width: 1600px;  /* prevent runaway column widths on QHD/4K monitors */
    margin: 0 auto;     /* keep it centred against the full-width cinematic bg */
}

/* ── Center column ── */
.home-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;   /* children fill full width */
    justify-content: center;
    padding: 1.2rem .5rem 1rem;  /* tight horizontal — preview fills column */
    gap: .8rem;
    overflow-y: auto;
    box-sizing: border-box;
}

/* ── Left column — What's New / How it works ── */
.home-col-news {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: 1.2rem .9rem 1rem 1rem;
    overflow-y: auto;
    box-sizing: border-box;
    border-right: 1px solid rgba(255,255,255,.08);
    min-height: 0;
    background: rgba(0,0,0,.22);
    backdrop-filter: blur(8px);
}
/* thin scrollbar for the sidebar */
.home-col-news::-webkit-scrollbar { width: 3px; }
.home-col-news::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.hn-head {
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
}
.hn-heading {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.5);
}
.hn-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.hn-item {
    display: flex;
    align-items: flex-start;
    gap: .4rem;
    font-size: .72rem;
    line-height: 1.45;
    color: rgba(255,255,255,.55);
}
.hn-tag {
    flex-shrink: 0;
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .15em .4em;
    border-radius: 3px;
    margin-top: .1em;
}
.hn-new .hn-tag  { background: rgba(61,255,143,.18); color: #3dff8f; }
.hn-fix .hn-tag  { background: rgba(96,165,250,.18); color: #60a5fa; }
.hn-note .hn-tag { background: rgba(251,191,36,.15); color: #fbbf24; }

.hn-divider {
    height: 1px;
    background: rgba(255,255,255,.07);
    margin: .3rem 0;
}
.hn-section-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.35);
    margin: 0;
}
.hn-steps {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.hn-step {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
}
.hn-step-num {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(61,255,143,.15);
    border: 1px solid rgba(61,255,143,.3);
    color: #3dff8f;
    font-size: .65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hn-step-body {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.hn-step-body strong {
    font-size: .74rem;
    font-weight: 700;
    color: rgba(255,255,255,.8);
}
.hn-step-body span {
    font-size: .68rem;
    color: rgba(255,255,255,.4);
    line-height: 1.4;
}

/* ── Sample reel (right column) ─────────────────────────────────────────── */
.home-samples {
    width: 195px;
    position: relative;
    overflow: hidden;
    padding: 0 8px 0 4px;
    box-sizing: border-box;
    border-left: 1px solid rgba(255,255,255,.08);
    background: rgba(0,0,0,.22);
    backdrop-filter: blur(8px);
}
.home-samples-strip {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: home-samples-scroll 50s linear infinite;
    will-change: transform;
}
.home-samples-strip:hover { animation-play-state: paused; }
@keyframes home-samples-scroll {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}
/* Single-image mode — no scroll, fills the aside */
.home-samples-strip--single {
    animation: none;
    flex: 1;
    height: 100%;
    gap: 0;
    align-items: stretch;
}
.home-sample-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    flex-shrink: 0;
    background: rgba(0,0,0,.4);
    cursor: pointer;
    border: 1px solid rgba(255,255,255,.07);
    transition: border-color .2s ease, transform .2s ease;
}
.home-sample-card:hover {
    border-color: rgba(61,255,143,.4);
    transform: scale(1.03);
}
/* Hero card fills the full aside height */
.home-sample-card--hero {
    aspect-ratio: unset;
    flex: 1;
    height: 100%;
    border-radius: 12px;
}
.home-sample-card img,
.home-sample-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.home-sample-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 7px 7px;
    background: linear-gradient(to top, rgba(0,0,0,.82) 0%, transparent 100%);
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: rgba(255,255,255,.7);
    text-align: center;
}
/* Top/bottom fades */
.home-samples-fade {
    position: absolute;
    left: 0;
    right: 14px;
    height: 90px;
    z-index: 2;
    pointer-events: none;
}
.home-samples-fade--top {
    top: 0;
    background: linear-gradient(to bottom, #09090b 0%, transparent 100%);
}
.home-samples-fade--bot {
    bottom: 0;
    background: linear-gradient(to top, #09090b 0%, transparent 100%);
}

/* ── Top: brand + headline + bullets ────────────────────────────────────── */
.home-top {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: .45rem;
    text-align: center;
    align-items: center;
}
.home-top-bar {
    display: flex;
    align-items: center;
    gap: .55rem;
    justify-content: center;
}
.home-brand {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .1em;
    color: #fff;
}
.home-top-sep { color: rgba(255,255,255,.25); }
.home-top-tagline {
    font-size: .75rem;
    color: rgba(255,255,255,.45);
    letter-spacing: .05em;
    text-transform: uppercase;
}
.home-hero { display: flex; flex-direction: column; gap: .45rem; align-items: center; }
.home-title {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    margin: 0;
    letter-spacing: -.02em;
    text-align: center;
}
.home-title em { font-style: normal; color: #3dff8f; }
.home-subhead {
    font-size: clamp(.82rem, 1.3vw, .92rem);
    color: rgba(255,255,255,.6);
    line-height: 1.55;
    margin: 0;
    text-align: center;
    max-width: 480px;
}
.home-bullets {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .8rem;
    justify-content: center;
}
.home-bullet { font-size: .76rem; color: rgba(255,255,255,.4); letter-spacing: .03em; }

/* ── Centre: Studio preview — THE HERO ──────────────────────────────────── */
.home-center {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
}
.home-preview-label {
    font-size: .72rem;
    color: rgba(255,255,255,.45);
    letter-spacing: .05em;
    text-transform: uppercase;
    text-align: center;
    margin: 0;
}
.home-studio-preview {
    width: 100%;
    max-width: none;
    aspect-ratio: 1200 / 589;  /* always shows the full studio image, no cropping */
    max-height: none;
    background: #111;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.75);
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: transform .55s cubic-bezier(.22,1,.36,1),
                border-radius .55s ease,
                box-shadow .2s ease;
    transform-origin: center center;
}
.home-studio-preview:hover {
    box-shadow: 0 28px 90px rgba(0,0,0,.85), 0 0 0 1.5px rgba(61,255,143,.3);
    transform: translateY(-3px) scale(1.005);
}

/* Zoom-in: studio preview expands to fill viewport, rest fades out */
.home-cinematic.is-zooming .home-studio-preview {
    transform: scale(9) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.home-cinematic.is-zooming .home-top,
.home-cinematic.is-zooming .home-bottom,
.home-cinematic.is-zooming .home-preview-label,
.home-cinematic.is-zooming .home-gallery,
.home-cinematic.is-zooming .home-samples,
.home-cinematic.is-zooming .home-col-news {
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

/* ── Bottom: steps row + CTA + beta ─────────────────────────────────────── */
.home-bottom {
    width: 100%;
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.home-steps-label {
    font-size: .7rem;
    color: rgba(255,255,255,.38);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin: 0;
    text-align: center;
}
/* Three steps side by side */
.home-steps-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 14px;
    overflow: hidden;
}
.home-step {
    flex: 1 1 0;
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .85rem 1rem;
}
.home-step-div {
    width: 1px;
    background: rgba(255,255,255,.07);
    flex-shrink: 0;
    align-self: stretch;
}
.home-step-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(61,255,143,.14);
    border: 1px solid rgba(61,255,143,.4);
    color: #3dff8f;
    font-size: .72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: .1rem;
}
.home-step-body { display: flex; flex-direction: column; gap: .18rem; }
.home-step-body strong { font-size: .82rem; color: #fff; font-weight: 600; }
.home-step-body span { font-size: .74rem; color: rgba(255,255,255,.42); line-height: 1.4; }

.home-guide-hint {
    display: flex;
    align-items: center;
    gap: .7rem;
    justify-content: flex-start;
}
/* In the left news column, push guide hint to the bottom */
.home-col-news .home-guide-hint {
    margin-top: auto;
    padding-top: .75rem;
    border-top: 1px solid rgba(255,255,255,.06);
}
.home-guide-box {
    flex-shrink: 0;
    padding: .22rem .55rem;
    background: rgba(61,255,143,.18);
    border: 1.5px solid #3dff8f;
    border-radius: 6px;
    color: #3dff8f;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .04em;
    white-space: nowrap;
}
.home-guide-hint span { font-size: .76rem; color: rgba(255,255,255,.4); line-height: 1.4; }

/* ── CTA ────────────────────────────────────────────────────────────────── */
.home-cta { display: flex; flex-direction: column; gap: .5rem; align-items: center; }
.home-enter-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .85rem 2.4rem;
    background: #3dff8f;
    color: #09090b;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .18s, transform .14s, box-shadow .18s;
    box-shadow: 0 4px 22px rgba(61,255,143,.3);
}
.home-enter-btn:hover {
    background: #5bffa6;
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(61,255,143,.4);
}
.home-enter-btn:active { transform: translateY(0); }
.home-cta-hint { font-size: .72rem; color: rgba(255,255,255,.3); margin: 0; }

/* ── Beta bar + changelog ───────────────────────────────────────────────── */
.home-changelog-wrap { display: flex; flex-direction: column; gap: .5rem; }
.home-beta-bar { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.home-beta-badge {
    flex-shrink: 0;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .08em;
    background: rgba(61,255,143,.12);
    border: 1px solid rgba(61,255,143,.4);
    color: #3dff8f;
    border-radius: 4px;
    padding: .1rem .42rem;
}
.home-beta-text { font-size: .76rem; color: rgba(255,255,255,.4); line-height: 1.4; }

/* ── Studio mockup internals (size tuned for larger preview) ────────────── */
.sp-topbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem .9rem;
    background: #1a1a1a;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.sp-brand-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #3dff8f;
    flex-shrink: 0;
    margin-right: .3rem;
}
.sp-tab {
    font-size: .7rem;
    padding: .22rem .6rem;
    border-radius: 20px;
    color: rgba(255,255,255,.35);
    white-space: nowrap;
}
.sp-tab--active { background: rgba(255,255,255,.1); color: #fff; }
.sp-tab--add { color: rgba(255,255,255,.25); }
.sp-topbar-title {
    font-size: .72rem;
    font-weight: 700;
    color: rgba(255,255,255,.8);
    letter-spacing: .03em;
    margin-right: .2rem;
}
.sp-topbar-sep { flex: 1; }

/* ── Studio preview wrapper — natural image width/height, container clips bottom ── */
.sp-img-wrap {
    position: relative;   /* overlays anchor here */
    width: 100%;
    line-height: 0;       /* no baseline gap under img */
}
.sp-screenshot {
    width: 100%;
    height: auto;         /* natural aspect ratio — NO object-fit zoom distortion */
    display: block;
}

/* Subtle top + bottom fades — full image visible, edges blend into page */
.sp-screenshot-fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,.25) 0%,
        transparent 8%,
        transparent 80%,
        rgba(17,17,17,.9) 100%
    );
    pointer-events: none;
}

/* ── Step annotation overlays ── */
/* Positions mapped to 1024×504 screenshot content:
   workflow strip  y=5-25%  →  label at top:14%
   left sidebar    x=0-11%  →  label at left:1%  top:55%
   dark canvas     x=11%+   →  label at left:30% top:60%   */
.sp-ol {
    position: absolute;
    display: flex;
    align-items: center;
    gap: .35rem;
    pointer-events: none;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.9));
}
/* Positions mapped to actual screencapUI.jpg content (1200×589):
   nav=0-7%  |  workflow strip=7-20%  |  sidebar=x<7%,y>20%  |  canvas=x>7%,y>20%  |  right panel=x>65% */
.sp-ol--workflow { top: 12%; left:  3%; }                                /* left of workflow cards */
.sp-ol--image    { top: 30%; left:  1%; flex-direction: column; align-items: flex-start; } /* sidebar */
.sp-ol--generate { top: 76%; left: 64%; flex-direction: row-reverse; left: auto; right: 2%; } /* generate btn */

.sp-ol-badge {
    width: 17px; height: 17px;
    border-radius: 50%;
    background: #3dff8f;
    color: #050f07;
    font-size: .56rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(61,255,143,.7);
    animation: sp-ol-pop 6s ease-in-out infinite;
}
.sp-ol-text {
    font-size: .6rem;
    font-weight: 800;
    color: #3dff8f;
    text-transform: uppercase;
    letter-spacing: .07em;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0,0,0,.9);
}

/* stagger fade-in so labels appear one by one */
.sp-ol--workflow { animation: sp-ol-fadein 9s ease-in-out infinite; animation-delay: 0s; }
.sp-ol--image    { animation: sp-ol-fadein 9s ease-in-out infinite; animation-delay: 3s; }
.sp-ol--generate { animation: sp-ol-fadein 9s ease-in-out infinite; animation-delay: 6s; }

@keyframes sp-ol-fadein {
    0%, 8%    { opacity: 0;   transform: translateY(4px); }
    15%, 85%  { opacity: 1;   transform: translateY(0); }
    95%, 100% { opacity: .2;  transform: translateY(0); }
}
@keyframes sp-ol-pop {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}
.sp-rail {
    width: 80px;
    background: #161616;
    border-right: 1px solid rgba(255,255,255,.06);
    padding: .55rem .5rem;
    display: flex;
    flex-direction: column;
    gap: .32rem;
}
.sp-rail-label {
    font-size: .5rem;
    color: rgba(255,255,255,.22);
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .2rem 0 .1rem;
}
.sp-swatch { background: rgba(255,255,255,.07); border-radius: 5px; height: 46px; }
.sp-swatch--sm { height: 30px; }
.sp-swatch--xs { height: 20px; }
.sp-canvas {
    flex: 1;
    position: relative;  /* for absolute label */
    padding: 1.6rem .85rem .85rem;  /* top room for the label */
    display: flex;
    flex-direction: column;
    gap: .55rem;
    justify-content: center;
    align-items: center;
}
.sp-drop-zone {
    border: 1.5px dashed rgba(255,255,255,.18);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    color: rgba(255,255,255,.28);
    font-size: .66rem;
    width: 100%;
    box-sizing: border-box;
}
.sp-drop-zone svg { color: rgba(255,255,255,.22); width: 24px; height: 24px; }
.sp-gen-btn {
    background: #3dff8f;
    color: #09090b;
    border-radius: 20px;
    font-size: .68rem;
    font-weight: 700;
    padding: .35rem 1rem;
    align-self: flex-end;
}
.sp-renders {
    width: 80px;
    background: #161616;
    border-left: 1px solid rgba(255,255,255,.06);
    padding: .55rem .5rem;
    display: flex;
    flex-direction: column;
    gap: .32rem;
}
.sp-thumb { background: rgba(255,255,255,.08); border-radius: 5px; height: 46px; }
.sp-thumb--sm { height: 32px; }


/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    /* On mid-size screens collapse to single center column */
    .home-layout { grid-template-columns: 1fr; }
    .home-col-news { display: none; }
    .home-samples  { display: none; }
}
@media (max-width: 680px) {
    .home-content { padding: 1.5rem 1rem 4rem; gap: 1.3rem; }
    .home-title { font-size: clamp(1.7rem, 7vw, 2.2rem); }
    .home-steps-row { flex-direction: column; border-radius: 12px; }
    .home-step-div { width: auto; height: 1px; }
    .home-enter-btn { width: 100%; justify-content: center; }
    .home-studio-preview { max-height: 240px; aspect-ratio: auto; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   PREMIUM TIER — gold treatment for compound multi-step workflows
   ═══════════════════════════════════════════════════════════════════════════ */

/* -- Design tokens -- */
:root {
    --gold:          #D4AF37;
    --gold-light:    #E8CC6E;
    --gold-dark:     #B8960C;
    --gold-glow:     rgba(212, 175, 55, 0.25);
    --gold-border:   rgba(212, 175, 55, 0.45);
    --gold-bg:       rgba(212, 175, 55, 0.07);
    --gold-badge-bg: linear-gradient(135deg, #D4AF37 0%, #E8CC6E 50%, #D4AF37 100%);
    --gold-badge-fg: #1a1400;
}

/* -- PREMIUM badge (shared across all surfaces) -- */
.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.56rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    background: var(--gold-badge-bg);
    color: var(--gold-badge-fg);
    padding: 2px 8px;
    border-radius: 20px;
    line-height: 1.6;
    white-space: nowrap;
    box-shadow: 0 1px 6px rgba(212, 175, 55, 0.3);
}

/* -- Carousel card (compact strip) -- */
.demo-card.demo-card--premium {
    border-color: var(--gold-border);
}
.demo-card.demo-card--premium:hover {
    border-color: var(--gold);
    box-shadow: 0 0 16px var(--gold-glow), 0 4px 18px rgba(0,0,0,0.35);
}
.demo-card.demo-card--premium.is-active {
    border-color: var(--gold);
    box-shadow: 0 0 20px var(--gold-glow), 0 0 0 1px var(--gold-border);
}
.demo-card--premium .premium-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 5;
}

/* -- Launcher card (full-page grid) -- */
.launcher-card.launcher-card--premium {
    border: 1px solid var(--gold-border);
}
.launcher-card.launcher-card--premium:hover {
    border-color: var(--gold);
    box-shadow: 0 0 20px var(--gold-glow), 0 8px 28px rgba(0,0,0,0.3);
}
.launcher-card--premium .premium-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
}
.launcher-card--premium .launcher-card-media {
    position: relative;
}

/* -- Workflows page card -- */
.wf-card.wf-card--premium {
    border-color: var(--gold-border);
}
.wf-card.wf-card--premium:hover {
    border-color: var(--gold);
    box-shadow: 0 0 18px var(--gold-glow);
}
.wf-card--premium .wf-premium-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
}
.wf-card--premium .wf-media {
    position: relative;
}

/* -- Workflow page header pill -- */
.premium-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: var(--gold-bg);
    color: var(--gold);
    border: 1px solid var(--gold-border);
    padding: 2px 10px;
    border-radius: 20px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Gold accent line on the workflow form panel for premium workflows */
.demo-effect-workspace.demo-effect-workspace--premium {
    border-top: 2px solid var(--gold-border);
}

/* -- Mobile gallery card -- */
.mobile-gallery-card.mobile-gallery-card--premium {
    border: 1px solid var(--gold-border);
}
.mobile-gallery-card--premium .premium-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 5;
}

/* -- Pricing table premium row -- */
.credits-chip.premium-credits {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold);
}
.td-category.cat-premium {
    color: var(--gold);
}

/* -- Premium filter button active state -- */
.carousel-filter-btn.is-active[data-filter-value="premium"] {
    background: rgba(212, 175, 55, 0.18);
    color: var(--gold);
}
.launcher-filter-btn.is-active[data-launcher-cat="premium"] {
    background: rgba(212, 175, 55, 0.18);
    color: var(--gold);
}
.wf-filter-btn.is-active[data-wf-filter="premium"] {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(212, 175, 55, 0.08);
}


/* ════════════════════════════════════════════════════════════════════════════
   BETA REQUEST MODAL
   ════════════════════════════════════════════════════════════════════════════ */
.beta-req-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(7, 9, 14, 0.84);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 16px;
}
.beta-req-backdrop[hidden] { display: none !important; }
.beta-req-backdrop.is-open { opacity: 1; pointer-events: auto; }

.beta-req-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    border-radius: 20px;
    padding: 36px 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transform: translateY(16px);
    transition: transform 0.3s ease;
    background: #12151c;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 32px 80px rgba(0,0,0,0.7);
}
.beta-req-backdrop.is-open .beta-req-card { transform: translateY(0); }

.beta-req-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.6);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.beta-req-close:hover { background: rgba(255,255,255,0.14); color: #fff; }

.beta-req-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.beta-req-logo-img { height: 40px; width: auto; }
.beta-req-pill {
    background: rgba(72,199,102,0.15);
    color: #48c766;
    border: 1px solid rgba(72,199,102,0.3);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    text-transform: uppercase;
}

.beta-req-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    color: #fff;
}
.beta-req-lede {
    margin: 0;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.55;
}

.beta-req-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.beta-req-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
}
.beta-req-star { color: #f28b3c; margin-left: 2px; }
.beta-req-input,
.beta-req-select {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: border-color 180ms, background 180ms;
}
.beta-req-input:focus,
.beta-req-select:focus {
    border-color: rgba(72,199,102,0.5);
    background: rgba(255,255,255,0.08);
}
.beta-req-input::placeholder { color: rgba(255,255,255,0.3); }
.beta-req-select option { background: #1a1d24; color: #fff; }

.beta-req-submit {
    margin-top: 4px;
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #48c766, #36a855);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 150ms, transform 120ms, box-shadow 150ms;
    box-shadow: 0 4px 18px rgba(72,199,102,0.3);
}
.beta-req-submit:hover {
    background: linear-gradient(135deg, #3fb85c, #2d9248);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(72,199,102,0.4);
}
.beta-req-submit:active { transform: translateY(0); }
.beta-req-submit:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.beta-req-note {
    font-size: 0.72rem;
    text-align: center;
    margin: 0;
    color: rgba(255,255,255,0.35);
}

.beta-req-success {
    text-align: center;
    padding: 20px 0 10px;
}
.beta-req-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #48c766, #36a855);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}
.beta-req-success-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0 0 8px;
    color: #fff;
}
.beta-req-success-text {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.55;
    margin: 0;
}

@media (max-width: 720px) {
    .beta-req-backdrop { padding: 10px; }
    .beta-req-card {
        max-width: 100%;
        padding: 24px 18px 20px;
        gap: 12px;
        border-radius: 16px;
    }
    .beta-req-title { font-size: 1.15rem; }
    .beta-req-lede { font-size: .82rem; }
}
