/* Category dropdown used above the style carousel */
.style-category-select.hud-select,
.hud-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(5, 15, 28, 0.85)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23958e9c' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E")
        no-repeat right 0.75rem center;
    border: 1px solid rgba(73, 69, 81, 0.2);
    border-radius: 0.5rem;
    color: #d9e3f6;
    padding: 0.45rem 2rem 0.45rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.style-category-select.hud-select:focus,
.hud-select:focus {
    outline: none;
    border-color: rgba(189, 157, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(189, 157, 255, 0.14);
}
.style-category-select.hud-select option,
.hud-select option {
    background: #16202e;
    color: #d9e3f6;
}

.theme-studio {
    --page-accent: var(--studio-primary);
    --page-accent-strong: var(--studio-secondary);
    --page-accent-rgb: var(--studio-accent-rgb);
    --page-glow: var(--studio-glow);
    --theme-primary: var(--studio-primary);
    --theme-secondary: var(--studio-secondary);
    --theme-accent-rgb: var(--studio-accent-rgb);
    --theme-glow: var(--studio-glow);
}

.provider-tab-hud {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--hud-outline);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--hud-muted);
    overflow: visible;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 2px 6px rgba(0, 0, 0, 0.3);
    clip-path: polygon(3px 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%, 0 3px);
}

.provider-tab-hud.active {
    color: #fff;
    border-color: var(--theme-secondary, var(--hud-accent));
    border-top-color: var(--theme-secondary, var(--hud-accent));
    box-shadow:
        inset 0 1px 0 rgba(var(--theme-accent-rgb, 245, 215, 161), 0.3),
        0 0 12px rgba(var(--theme-accent-rgb, 245, 215, 161), 0.3),
        0 4px 12px rgba(0, 0, 0, 0.4);
    background: linear-gradient(180deg, rgba(var(--theme-accent-rgb, 245, 215, 161), 0.12), rgba(var(--theme-accent-rgb, 245, 215, 161), 0.06));
}

.provider-tab-hud.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--theme-secondary, var(--hud-accent));
    box-shadow: 0 0 8px var(--theme-secondary, var(--hud-accent));
}

.provider-tab-hud:not(.active):hover {
    color: #fff;
    border-color: var(--hud-outline-strong);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    transform: translateY(-1px);
}

.provider-choice-grid {
    display: grid;
    gap: 0.75rem;
}

.provider-choice-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.875rem;
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(73, 69, 81, 0.15);
    border-radius: 1rem;
    background: rgba(18, 28, 42, 0.6);
    color: #d9e3f6;
    letter-spacing: normal;
    text-transform: none;
    text-align: left;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
    opacity: 0.65;
}

.provider-choice-card:hover {
    transform: translateY(-1px);
    opacity: 0.85;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
}

.provider-choice-card.active {
    opacity: 1;
    border-color: rgba(189, 157, 255, 0.5);
    background: rgba(22, 32, 46, 0.9);
    box-shadow:
        0 0 15px rgba(189, 157, 255, 0.2),
        0 0 0 1px rgba(189, 157, 255, 0.15);
}

.provider-choice-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.provider-choice-card-subtitle {
    font-size: 0.78rem;
    color: var(--hud-muted);
}

.provider-choice-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    text-align: left;
}

.provider-choice-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.provider-icon-openai {
    background: rgba(135, 101, 255, 0.18);
    color: #d4c4ff;
    border-color: rgba(135, 101, 255, 0.36);
}

.provider-icon-gemini {
    background: rgba(137, 206, 255, 0.18);
    color: #b5dfff;
    border-color: rgba(137, 206, 255, 0.34);
}

.provider-icon-grok {
    background: rgba(236, 99, 255, 0.18);
    color: #ffb5ff;
    border-color: rgba(236, 99, 255, 0.34);
}

.provider-choice-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(142, 156, 193, 0.28);
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: rgba(10, 16, 30, 0.66);
}

.provider-choice-radio::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d5bfff, #89ceff);
    transform: scale(0);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.provider-choice-card.active .provider-choice-radio {
    border-color: rgba(202, 174, 255, 0.9);
    box-shadow: 0 0 12px rgba(189, 157, 255, 0.28);
}

.provider-choice-card.active .provider-choice-radio::after {
    transform: scale(1);
}

.provider-choice-detail {
    padding: 1rem 1rem 1.1rem;
    border: none;
    border-radius: 1rem;
    background:
        radial-gradient(circle at top left, rgba(var(--theme-accent-rgb, 213, 191, 255), 0.06), transparent 42%),
        rgba(5, 15, 28, 0.6);
}

.provider-choice-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.provider-choice-detail-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.provider-choice-detail-brief {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--theme-primary, var(--hud-accent));
    margin-bottom: 0.35rem;
}

.provider-choice-detail-copy {
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--hud-muted);
}

.provider-choice-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.5rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--hud-muted);
}

.provider-choice-status.is-ready {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

.provider-choice-status.is-missing {
    border-color: rgba(248, 113, 113, 0.24);
    background: rgba(248, 113, 113, 0.08);
    color: #fca5a5;
}

#studio-provider-display {
    min-width: 200px;
}

#analysis-model-selector,
#image-generation-model-selector {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#analysis-model-selector:focus,
#image-generation-model-selector:focus {
    border-color: var(--hud-accent);
    box-shadow: 0 0 0 3px rgba(245, 215, 161, 0.18);
}

#analysis-custom-container,
#image-generation-custom-container {
    background-color: rgba(5, 15, 28, 0.6);
    border: 1px solid rgba(73, 69, 81, 0.2);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

#analyze-image,
#generate-image {
    min-height: var(--generate-button-height);
    font-weight: 700;
    box-shadow:
        0 0 0 1px rgba(117, 136, 184, 0.18),
        0 14px 32px rgba(4, 10, 24, 0.34);
}

#analyze-image:hover,
#generate-image:hover {
    box-shadow:
        0 0 0 1px rgba(189, 157, 255, 0.26),
        0 18px 40px rgba(9, 18, 40, 0.42);
}

#studio .space-y-6 > * + * {
    margin-top: 1.5rem;
}

#studio .right-column-spacing {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#reference-image-panel-container {
    min-height: 300px;
    height: auto;
}

#ai-import-btn,
#ai-remove-btn {
    min-height: 48px;
    font-weight: 600;
}

.style-category-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--hud-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: all 0.18s ease;
}

.style-category-btn:hover {
    border-color: rgba(189, 157, 255, 0.44);
    background: rgba(189, 157, 255, 0.08);
    color: #fff;
    transform: translateY(-1px);
}

.style-category-btn.active {
    border-color: rgba(213, 191, 255, 0.6);
    background: rgba(189, 157, 255, 0.15);
    color: #f4efff;
    box-shadow: 0 0 12px rgba(189, 157, 255, 0.15);
}

.style-category-btn .category-icon {
    width: 1rem;
    height: 1rem;
    color: inherit;
}

/* Style option base — overridden by Synthetic Atmosphere rules below */
.style-option-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.4rem;
    flex: 0 0 5.25rem;
    width: 5.25rem;
    padding: 0.35rem;
    background: transparent;
    color: #cbc4d3;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 0.7rem;
    text-align: center;
    scroll-snap-align: start;
}

.style-option-thumb-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 0.5rem;
    background: rgba(5, 15, 28, 0.85);
    position: relative;
}

.style-option-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.style-option-btn:hover .style-option-thumb {
    transform: scale(1.06);
}

.style-option-label {
    display: block;
    font-size: 0.65rem;
    line-height: 1.1;
    letter-spacing: 0.05em;
    font-weight: 700;
    text-transform: uppercase;
    color: inherit;
}

/* Aspect ratio pills — overridden by Synthetic Atmosphere segmented control below */

/* Style Carousel — single-level horizontal thumbnail strip */
.style-carousel,
#style-options {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    touch-action: pan-x pan-y pinch-zoom;
}

.style-carousel::-webkit-scrollbar,
#style-options::-webkit-scrollbar {
    height: 3px;
    background: transparent;
}

.style-carousel::-webkit-scrollbar-thumb,
#style-options::-webkit-scrollbar-thumb {
    background: rgba(189, 157, 255, 0.25);
    border-radius: 2px;
}

.style-carousel,
#style-options {
    scrollbar-width: thin;
    scrollbar-color: rgba(189, 157, 255, 0.25) transparent;
}

.style-carousel.is-dragging .style-option-btn,
#style-options.is-dragging .style-option-btn {
    pointer-events: none;
}

#provider-widget-openai,
#provider-widget-gemini,
#provider-widget-grok {
    padding: 0.75rem;
    border-radius: 0.9rem;
    background: rgba(18, 28, 42, 0.5);
    border: none;
}

/* Style carousel tiles — size controlled by --style-card-size on #style-options */
.style-carousel .style-option-btn,
#style-options .style-option-btn {
    flex: 0 0 var(--style-card-size, 10rem);
    width: var(--style-card-size, 10rem);
    padding: calc(var(--style-card-size, 10rem) * 0.05);
    gap: calc(var(--style-card-size, 10rem) * 0.06);
    border-radius: calc(var(--style-card-size, 10rem) * 0.1);
    scroll-snap-align: start;
}

.style-carousel .style-option-thumb-wrap,
#style-options .style-option-thumb-wrap {
    border-radius: calc(var(--style-card-size, 10rem) * 0.075);
}

.style-carousel .style-option-label,
#style-options .style-option-label {
    font-size: calc(var(--style-card-size, 10rem) * 0.078);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

#style-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/*
 * ─── STUDIO RESPONSIVE LAYOUT ───
 *
 * Structural rules for the Studio 3-column grid (Tailwind grid-cols-1 / lg:grid-cols-12).
 * Mobile-first: single column is handled by Tailwind's grid-cols-1.
 * Below 1024px we reorder columns, compact provider cards, and enable
 * collapsible sections. All rules use scoped selectors — no !important.
 */
@media (max-width: 1023px) {

    /* ── Column reorder ──
       1. Engine + Rendering (aside col-span-3) — choose engine first
       2. Prompt Foundation + DNA (aside col-span-4) — configure models
       3. Center content (div col-span-5) — input, preview, generate */
    #studio .grid > aside:first-child  { order: 1; }
    #studio .grid > aside:last-child   { order: 2; }
    #studio .grid > div:nth-child(2)   { order: 3; }

    /* ── Provider tabs: 3-column grid on mobile ── */
    #studio #provider-tabs {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    #studio #provider-tabs .provider-choice-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0.75rem 0.5rem;
        gap: 0.35rem;
    }
    #studio #provider-tabs .provider-choice-card-body {
        align-items: center;
        text-align: center;
    }
    #studio #provider-tabs .provider-choice-card-title  { font-size: 0.85rem; }
    #studio #provider-tabs .provider-choice-card-subtitle { font-size: 0.62rem; }
    #studio #provider-tabs .provider-choice-radio { width: 14px; height: 14px; }

    /* ── Provider detail: compact ── */
    #studio .provider-choice-detail     { padding: 0.75rem; }
    #studio .provider-choice-detail-copy { font-size: 0.72rem; line-height: 1.5; }

    /* ── Style carousel: touch-friendly ── */
    #studio .style-carousel,
    #studio #style-options {
        touch-action: pan-x;
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        overscroll-behavior-x: contain;
    }
    #studio #style-options { --style-card-size: 7rem; }

    /* ── Collapsible sections ── */
    #studio .mobile-collapsible-header {
        cursor: pointer;
        user-select: none;
        -webkit-user-select: none;
    }
    #studio .mobile-collapsible-header .collapse-chevron {
        transition: transform 0.25s ease;
        color: var(--hud-muted, #6d758c);
        font-size: 20px;
    }
    #studio .mobile-collapsible-header.is-collapsed .collapse-chevron {
        transform: rotate(-90deg);
    }

    #studio .mobile-collapsible-body {
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.25s ease;
        max-height: 2000px;
        opacity: 1;
    }
    #studio .mobile-collapsible-body.is-collapsed {
        max-height: 0;
        opacity: 0;
        padding-top: 0;
        margin-top: 0;
    }

}

/* ─── New 3-column layout styles ─── */

/* Dark background override for studio page */
body.theme-studio {
    background: linear-gradient(180deg, #091421 0%, #121c2a 50%, #091421 100%);
    color: #d9e3f6;
}

/* Transmute button gradient */
.studio-transmute-btn {
    background: linear-gradient(135deg, #bd9dff 0%, #00a2e6 100%);
    color: #4d2e89;
    border: none;
    border-radius: 1rem;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4);
}
.studio-transmute-btn:hover {
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(189, 157, 255, 0.2);
}

/* Result viewport */
.studio-result-viewport {
    position: relative;
}
.studio-result-viewport #image-viewer:not(.hidden) ~ #image-result-placeholder {
    display: none;
}

.generation-error-card {
    width: min(92%, 560px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    color: #f2b8b5;
    text-align: center;
}

.generation-error-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border: 1px solid rgba(242, 184, 181, 0.55);
    border-radius: 999px;
    font-weight: 800;
}

.generation-error-copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.9rem;
    line-height: 1.35;
}

.generation-error-copy span {
    color: #e6d6d4;
}

.generation-error-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
}

.generation-error-actions button {
    min-height: 2.2rem;
    padding: 0 0.9rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(242, 184, 181, 0.55);
    background: rgba(242, 184, 181, 0.12);
    color: #ffd8d4;
    font-weight: 700;
}

.generation-error-actions details {
    width: 100%;
    max-width: 520px;
    color: #d9e3f6;
    font-size: 0.75rem;
}

.generation-error-actions summary {
    cursor: pointer;
    color: #cbc4d3;
}

.generation-error-actions pre {
    max-height: 8.5rem;
    overflow: auto;
    margin-top: 0.4rem;
    padding: 0.65rem;
    border-radius: 0.5rem;
    background: rgba(5, 15, 28, 0.85);
    color: #d9e3f6;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-word;
}

/* bg-surface-container-low applied to studio sections */
body.theme-studio .bg-surface-container-low {
    background: rgba(18, 28, 42, 0.9);
}
body.theme-studio .bg-surface-container {
    background: rgba(22, 32, 46, 0.9);
}
body.theme-studio .bg-surface-container-high {
    background: rgba(33, 43, 57, 0.9);
}

/* Material symbols font variation */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* text-on-surface, text-on-surface-variant colours */
.text-on-surface { color: #d9e3f6 !important; }
.text-on-surface-variant { color: #cbc4d3 !important; }
.text-primary { color: #d5bfff !important; }
.text-secondary { color: #89ceff !important; }
.text-tertiary { color: #bfc8e7 !important; }
.text-outline { color: #958e9c !important; }
.text-error { color: #ffb4ab !important; }

/* Headline font */
.font-headline { font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.02em; }

/* hide-scrollbar utility */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Studio uses Tailwind's grid system (grid-cols-1 / lg:grid-cols-12),
   not the workspace-grid system. The workspace-grid class should not
   be present on studio page elements. */

/* ─── Synthetic Atmosphere: Glass & Ghost Utilities ─── */

/* Glass panel for floating elements */
.glass-panel {
    background: rgba(43, 53, 68, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Ghost border — only for input fields where containment is needed */
.ghost-border {
    border: 1px solid rgba(73, 69, 81, 0.2);
}

/* ─── Neural Pulse Progress Bar ─── */
@keyframes neural-pulse {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.progress-bar-fill {
    height: 2px;
    background: linear-gradient(90deg, transparent, #89ceff, transparent);
    background-size: 200% 100%;
    animation: neural-pulse 1.5s ease-in-out infinite;
    border-radius: 1px;
}

/* ─── Active provider pulse dot ─── */
.provider-choice-card.active .provider-choice-icon::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d5bfff;
    animation: pulse 2s ease-in-out infinite;
}
.provider-choice-icon {
    position: relative;
}

/* ─── Segmented aspect ratio control ─── */
#aspect-ratio-pills.aspect-ratio-pill-grid {
    display: flex;
    flex-wrap: wrap;
    background: rgba(18, 28, 42, 0.8);
    border-radius: 0.75rem;
    padding: 4px;
    gap: 4px;
}

#aspect-ratio-pills .aspect-ratio-pill {
    position: relative;
    min-height: 40px;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    color: #cbc4d3;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 0.5rem;
    flex: 1 1 auto;
    transition: all 0.2s ease;
}

#aspect-ratio-pills .aspect-ratio-pill:hover {
    background: rgba(213, 191, 255, 0.08);
    color: #d9e3f6;
}

#aspect-ratio-pills .aspect-ratio-pill.active {
    background: rgba(189, 157, 255, 0.25);
    color: #f7f3ff;
    box-shadow: 0 0 12px rgba(189, 157, 255, 0.2);
}

#aspect-ratio-pills .aspect-ratio-pill.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    color: rgba(203, 196, 211, 0.5);
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(203, 196, 211, 0.25);
    box-shadow: none;
    transform: none;
}

#aspect-ratio-pills .aspect-ratio-pill.is-disabled::after {
    content: "unsupported";
    display: block;
    margin-top: 0.15rem;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: uppercase;
    color: rgba(203, 196, 211, 0.55);
}

#aspect-ratio-pills .aspect-ratio-pill.is-disabled:hover {
    background: transparent;
    color: rgba(203, 196, 211, 0.5);
}

/* ─── Style carousel: grayscale/active treatment ─── */
.style-option-btn {
    filter: grayscale(0.8);
    opacity: 0.6;
    border: 1px solid transparent;
    transition: all 0.22s ease;
}

.style-option-btn:hover {
    filter: grayscale(0.3);
    opacity: 0.85;
    border-color: rgba(213, 191, 255, 0.3);
}

.style-option-btn.active {
    filter: none;
    opacity: 1;
    border-color: rgba(189, 157, 255, 0.8);
    box-shadow: 0 0 12px rgba(189, 157, 255, 0.25);
}

.style-option-thumb-wrap {
    position: relative;
    overflow: hidden;
}

.style-option-btn .style-option-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── Mobile bottom navigation ─── */
#mobile-bottom-nav {
    background: rgba(9, 20, 33, 0.70);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 1.5rem 1.5rem 0 0;
    box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(73, 69, 81, 0.2);
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
}

#mobile-bottom-nav .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: rgba(203, 196, 211, 0.5);
    transition: color 0.2s ease;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
}

#mobile-bottom-nav .bottom-nav-item.active {
    color: #d5bfff;
    filter: drop-shadow(0 0 8px rgba(213, 191, 255, 0.4));
}

#mobile-bottom-nav .bottom-nav-item:not(.active):hover {
    color: #89ceff;
}

#mobile-bottom-nav .bottom-nav-label {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* ─── Fixed floating CTA on mobile ─── */
@media (max-width: 1023px) {
    #transmute-float-wrap {
        position: fixed;
        bottom: 5.5rem;
        left: 1.25rem;
        right: 1.25rem;
        z-index: 40;
    }
    #transmute-float-wrap .studio-transmute-btn {
        border-radius: 1rem;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    }
}
@media (min-width: 1024px) {
    #transmute-float-wrap {
        position: relative;
    }
}

/* ─── No-Line Rule: remove structural borders (Synthetic Atmosphere) ─── */
[data-page="studio"] .hud-panel {
    border: none;
    clip-path: none;
    border-radius: 1rem;
}
[data-page="studio"] .hud-panel::before,
[data-page="studio"] .hud-panel::after {
    display: none;
}
[data-page="studio"] .hud-surface {
    border: none;
    background: rgba(18, 28, 42, 0.4);
}
[data-page="studio"] .workspace-panel {
    border: none;
    background: transparent;
}
/* hud-note left-border override now lives in style.css globally */

/* ─── FINDING-002: Mobile touch targets (44px minimum) ─── */
@media (max-width: 1023px) {
    .mode-pill {
        min-height: 44px;
        padding: 0.65rem 1.1rem;
    }
    #aspect-ratio-pills .aspect-ratio-pill {
        min-height: 44px;
    }
    .dna-toggle-track {
        width: 44px;
        height: 26px;
    }
    .dna-toggle-thumb {
        width: 20px;
        height: 20px;
        top: 2px;
        left: 2px;
    }
    .dna-toggle input[type="checkbox"]:checked + .dna-toggle-track .dna-toggle-thumb {
        transform: translateX(18px);
    }
    /* Native checkboxes: enlarge hit area */
    input[type="checkbox"]:not(.dna-toggle input) {
        min-width: 20px;
        min-height: 20px;
        width: 20px;
        height: 20px;
    }
}

/* ── Variations Button ── */
.studio-variations-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #e0e7ff;
    border: none;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}
.studio-variations-btn:hover {
    box-shadow:
        0 14px 32px rgba(0, 0, 0, 0.4),
        0 0 16px rgba(139, 92, 246, 0.25);
}
.studio-variations-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Generation Mode Tabs (Single / Variation) ── */
/* Mirrors the aspect-ratio-pill-grid pattern */
.gen-mode-tabs {
    display: flex;
    flex-wrap: wrap;
    background: rgba(18, 28, 42, 0.8);
    border-radius: 0.75rem;
    padding: 4px;
    gap: 4px;
}
.gen-mode-tab {
    position: relative;
    min-height: 40px;
    padding: 0.5rem 0.75rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(203, 196, 211, 0.7);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.gen-mode-tab:hover {
    background: rgba(213, 191, 255, 0.08);
    color: #d9e3f6;
}
.gen-mode-tab.active {
    background: rgba(189, 157, 255, 0.25);
    color: #f7f3ff;
    box-shadow: 0 0 12px rgba(189, 157, 255, 0.2);
}

/* ── Variation Shift Rows ── */
.variation-shift-row {
    background: rgba(9, 20, 33, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.5rem;
    padding: 0.35rem 0.5rem;
}
.variation-field-select {
    flex-shrink: 0;
    width: 130px;
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: var(--md-sys-color-on-surface, #e0e0e0);
    cursor: pointer;
}
.variation-field-select:focus {
    outline: 1px solid rgba(189, 157, 255, 0.4);
    border-color: rgba(189, 157, 255, 0.4);
}
.variation-field-input {
    flex: 1;
    min-width: 0;
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: var(--md-sys-color-on-surface, #e0e0e0);
}
.variation-field-input:focus {
    outline: 1px solid rgba(189, 157, 255, 0.4);
    border-color: rgba(189, 157, 255, 0.4);
}
.variation-field-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* ── Variation Grid ── */
.variation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0.5rem;
}

.variation-cell {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    background: rgba(9, 20, 33, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    min-height: 200px;
    transition: border-color 0.2s;
}
.variation-cell:hover {
    border-color: rgba(189, 157, 255, 0.3);
}

/* Cell header: strategy label */
.variation-cell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--md-sys-color-on-surface-variant, #b0bec5);
}
.variation-cell-header .variation-strategy {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.variation-cell-header .variation-status {
    font-size: 0.65rem;
    font-weight: 400;
}

/* Cell image area */
.variation-cell-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 160px;
}
.variation-cell-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
}

/* Skeleton loading pulse */
.variation-cell-skeleton {
    width: 100%;
    height: 100%;
    min-height: 160px;
    background: linear-gradient(110deg, rgba(30, 40, 60, 0.6) 30%, rgba(60, 70, 100, 0.4) 50%, rgba(30, 40, 60, 0.6) 70%);
    background-size: 200% 100%;
    animation: variationShimmer 1.5s ease-in-out infinite;
}
@keyframes variationShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Cell footer: prompt snippet + actions */
.variation-cell-footer {
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.variation-cell-footer .variation-prompt-snippet {
    font-size: 0.65rem;
    color: var(--md-sys-color-on-surface-variant, #b0bec5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.variation-cell-footer .variation-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}
.variation-cell-footer .variation-actions button {
    padding: 0.25rem 0.4rem;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--md-sys-color-on-surface-variant, #b0bec5);
    border-radius: 0.35rem;
    font-size: 0.65rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.variation-cell-footer .variation-actions button:hover {
    background: rgba(189, 157, 255, 0.2);
    color: var(--md-sys-color-on-surface, #e0e0e0);
}

/* Error state for a cell */
.variation-cell-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    color: var(--md-sys-color-error, #f2b8b5);
    text-align: center;
    font-size: 0.75rem;
}
.variation-cell-error button {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--md-sys-color-error, #f2b8b5);
    background: transparent;
    color: var(--md-sys-color-error, #f2b8b5);
    border-radius: 0.5rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.15s;
}
.variation-cell-error button:hover {
    background: rgba(242, 184, 181, 0.1);
}

/* Mobile: single column */
@media (max-width: 768px) {
    .variation-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================================
 * Studio header: mirrors interior.html front matter.
 * Pulls in the .int-page-* tokens already defined in styles/interior.css
 * (which is NOT loaded on studio), so redeclare only the ones we use here.
 * Keeps the pages visually related without cross-page CSS coupling.
 * ========================================================================= */
body[data-page="studio"] .int-page-head {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

body[data-page="studio"] .int-page-head-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

body[data-page="studio"] .int-page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Geist Mono', 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(231, 233, 238, 0.78);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(9, 20, 33, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

body[data-page="studio"] .int-page-eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
    animation: int-eyebrow-pulse 2.4s ease-in-out infinite;
}

@keyframes int-eyebrow-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18); }
    50%      { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.08); }
}

body[data-page="studio"] .int-page-title {
    font-family: 'Instrument Serif', 'Georgia', serif;
    font-weight: 400;
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.015em;
    color: #e7e9ee;
    text-wrap: balance;
    margin: 0.35rem 0 0;
}

body[data-page="studio"] .int-page-title em {
    font-style: italic;
    color: #6ee7b7;
}

body[data-page="studio"] .int-page-lede {
    font-family: 'Geist', 'Inter', system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(217, 227, 246, 0.75);
    max-width: 52ch;
    margin: 0;
}

body[data-page="studio"] .int-page-head-meta {
    min-height: 0;
}

/* Canonical engine status lives in the provider-choice-detail card below.
 * Hide the header status strings to avoid the duplication we cleaned up
 * on interior.html. JS can still flip the `hidden` class; we trump it. */
body[data-page="studio"] #studio-selected-model,
body[data-page="studio"] .int-active-model,
body[data-page="studio"] #studio-provider-warning,
body[data-page="studio"] .int-provider-warning {
    display: none !important;
}

/* Kill the section banner — the eyebrow + H2 name the page already. */
body[data-page="studio"] .section-banner {
    display: none;
}
