/*
 * GENERATION-SETTINGS.CSS
 *
 * Matches context-field styling from scene-control-surface.
 * Uses same --slot-N CSS variables for character theming.
 * Field styling mirrors .context-field input/textarea/select2 exactly.
 */

/* ═══════════════════════════════════════════════════════════════════
   MAIN CONTAINER
   ═══════════════════════════════════════════════════════════════════ */

.generation-settings {
    --gs-bg: color-mix(in srgb, var(--primary) 15%, var(--card-base));
    --gs-accent: var(--secondary);  /* eyes — always present */
    width: 100%;
    background: var(--gs-bg);
    border-radius: 12px;
    padding: 4px;
    border: 2px solid color-mix(in srgb, var(--gs-accent) 25%, rgba(255, 255, 255, 0.08));
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    margin-top: 1rem;
}

.generation-settings:hover {
    border-color: color-mix(in srgb, var(--gs-accent) 35%, rgba(255, 255, 255, 0.1));
}

/* ═══════════════════════════════════════════════════════════════════
   PANEL — beveled inset housing
   ═══════════════════════════════════════════════════════════════════ */

.gs-panel {
    background: linear-gradient(145deg,
        color-mix(in srgb, var(--primary) 8%, var(--card-base)) 0%,
        color-mix(in srgb, var(--secondary) 6%, var(--card-base)) 50%,
        color-mix(in srgb, var(--primary) 5%, var(--card-base)) 100%);
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--card-base) 95%, black);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3),
                inset 0 -1px 0 rgba(255, 255, 255, 0.1);
    padding: 0;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════ */

.gs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.03) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.2) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.gs-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gs-badge {
    font-size: 1rem;
}

.gs-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    /* Grey — slot-2 (eyes) goes invisible when the character has black eyes. */
    color: var(--ui-text-medium);
}

.gs-scene-counter {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(0, 0, 0, 0.2),
        0 1px 0 rgba(255, 255, 255, 0.05);
}

.gs-scene-counter-label {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.45rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

.gs-scene-counter-value {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: color-mix(in srgb, var(--gs-accent) 70%, rgba(255, 255, 255, 0.6));
}

/* ─── Prompt header row (label left, seed right) ─── */

.gs-prompt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.gs-prompt-header .gs-label {
    margin-bottom: 0;
}

.gs-seed-counter {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.6rem;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(0, 0, 0, 0.2),
        0 1px 0 rgba(255, 255, 255, 0.05);
}

.gs-seed-counter-label {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.45rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

.gs-seed-counter-value {
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: color-mix(in srgb, var(--gs-accent) 70%, rgba(255, 255, 255, 0.6));
}

/* ═══════════════════════════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════════════════════════ */

.gs-section {
    --accent: var(--gs-accent);  /* bridge for select2-theme.css + standalone-select2.js */
    margin: 0.6rem;
    padding: 0.5rem;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--primary) 16%, var(--card-base)) 0%,
        color-mix(in srgb, var(--secondary) 12%, var(--card-base)) 50%,
        var(--card-base) 100%
    );
    border-radius: 6px;
    border: 1px solid color-mix(in srgb, var(--gs-accent) 12%, rgba(255, 255, 255, 0.06));
    transition: border-color 0.3s ease;
}

/* Per-section accent: negative uses hair, quality/controls use eyes */
.gs-section--negative {
    --accent: var(--primary);  /* hair — matches builder-tag--negative */
}

.gs-section:hover {
    border-color: color-mix(in srgb, var(--gs-accent) 20%, rgba(255, 255, 255, 0.08));
}

.gs-label {
    display: block;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    /* Grey — survives any --gs-accent slot color. */
    color: var(--ui-text-soft);
    text-transform: uppercase;
    padding-left: 0.2rem;
    margin-bottom: 0.4rem;
}

/* ═══════════════════════════════════════════════════════════════════
   FIELD BASE — matches .context-field input/textarea pattern
   ═══════════════════════════════════════════════════════════════════ */

.gs-controls-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.gs-controls-row:last-child {
    margin-bottom: 0;
}

.gs-control {
    flex: 1;
    min-width: 0;
}

.gs-control--full {
    flex: 1 1 100%;
}

/* Fixed width: sized to fit "ILLUSTRIOUS" + arrow */
.gs-control--auto {
    flex: 0 0 7.0rem;
}

/* Fill remaining space */
.gs-control--fill {
    flex: 1 1 0;
    min-width: 0;
}

/* ─── All inputs, selects, textareas ─── */

.gs-input {
    /* Bridge gs-accent → accent so --text-tinted resolves to slot color here */
    --accent: var(--gs-accent);
    width: 100%;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 3px solid color-mix(in srgb, var(--gs-accent) 60%, transparent);
    border-radius: 4px;
    color: color-mix(in srgb, var(--accent) 75%, white) !important;
    font-size: 0.8rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.gs-input:hover {
    border-color: color-mix(in srgb, var(--gs-accent) 60%, transparent);
    border-left-color: var(--gs-accent);
    background: rgba(0, 0, 0, 0.4);
}

.gs-input:focus {
    outline: none;
    border-color: var(--gs-accent);
    border-left-color: var(--gs-accent);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--gs-accent) 30%, transparent);
}

.gs-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
}

/* ─── Native selects (sampler, scheduler) ─── */

.gs-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.4)'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.5rem center !important;
    padding-right: 1.5rem;
    cursor: pointer;
}

.gs-select option {
    background: var(--card-base);
    color: rgba(255, 255, 255, 0.9);
}

/* ─── Textareas ─── */

.gs-textarea {
    resize: vertical;
    min-height: 2.5rem;
    line-height: 1.4;
    font-size: 0.7rem;
}

/* Prompt textarea IS the bevel surface — the .gs-section--prompt
   container and the .gs-prompt-header (label + seed) stay flat,
   only the vLargeText field gets sunken. Same slot-2/slot-1 gradient
   + inset shadow recipe as .llm-prompt-block / .field--bevel.
   Targeted via .gs-textarea--readonly (the actual class on the
   textarea — gs-positive-prompt is the id) with specificity 0,3,0
   to beat the legacy .gs-textarea--readonly[readonly] focus/hover
   states below. */
.gs-section--prompt .gs-textarea--readonly[readonly] {
    background: linear-gradient(
        225deg,
        color-mix(in srgb, var(--secondary) 16%, var(--card-base)) 0%,
        color-mix(in srgb, var(--primary) 16%, var(--card-base)) 100%
    ) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 6px !important;
    padding: 0.5rem !important;
    /* Match .builder-tag — same size + color as the element bubbles
       so the bevel material reads as the same content surface across
       the form. !important locks both against .gs-textarea-readonly
       reasserting 0.7rem italic on the hover/focus selectors below. */
    color: rgba(255, 255, 255, 0.88) !important;
    font-size: 0.8rem !important;
    font-style: normal !important;
    line-height: 1.45;
    box-shadow:
        inset 0 3px 6px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

.gs-section--prompt .gs-textarea--readonly[readonly]:hover,
.gs-section--prompt .gs-textarea--readonly[readonly]:focus {
    background: linear-gradient(
        225deg,
        color-mix(in srgb, var(--secondary) 16%, var(--card-base)) 0%,
        color-mix(in srgb, var(--primary) 16%, var(--card-base)) 100%
    ) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow:
        inset 0 3px 6px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

.gs-section--prompt .gs-textarea--readonly[readonly]::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.gs-textarea--readonly,
.gs-textarea--readonly[readonly] {
    background: rgba(0, 0, 0, 0.15) !important;
    border-color: color-mix(in srgb, var(--gs-accent) 25%, transparent) !important;
    border-left-color: color-mix(in srgb, var(--gs-accent) 40%, transparent) !important;
    color: rgba(160, 165, 175, 0.7) !important;
    font-size: 0.7rem;
    font-style: italic;
    cursor: default;
}

/* ─── Number inputs ─── */

.gs-input[type="number"] {
    -moz-appearance: textfield;
}

.gs-input[type="number"]::-webkit-inner-spin-button,
.gs-input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════
   SELECT2 FIELDS — checkpoint + quality (matches context-field Select2)
   ═══════════════════════════════════════════════════════════════════ */

.gs-section .select2-container {
    width: 100% !important;
}

.gs-section .select2-container--default .select2-selection--single {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-left: 3px solid color-mix(in srgb, var(--gs-accent) 60%, transparent) !important;
    border-radius: 4px !important;
    height: var(--gs-select-height, 28px) !important;
    min-height: var(--gs-select-height, 28px) !important;
    padding: 0 0.4rem !important;
    display: flex !important;
    align-items: center !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gs-section .select2-container--default .select2-selection--single:hover {
    border-color: color-mix(in srgb, var(--gs-accent) 60%, transparent) !important;
    border-left-color: var(--gs-accent) !important;
}

.gs-section .select2-container--default.select2-container--open .select2-selection--single {
    background: rgba(0, 0, 0, 0.5) !important;
    border-color: var(--gs-accent) !important;
    border-left-color: var(--gs-accent) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--gs-accent) 30%, transparent) !important;
}

.gs-section .select2-container--default .select2-selection__rendered {
    /* Grey default state so closed type/steps/cfg/scheduler/sampler boxes
       read cleanly; --gs-accent still tints the borders + option hovers. */
    --accent: var(--gs-accent);
    color: #c0c0c0 !important;
    font-size: 0.8rem !important;
    padding-left: 0.1rem !important;
    line-height: 1.4 !important;
}

.gs-section .select2-container--default .select2-selection__placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
}

.gs-section .select2-container--default .select2-selection__arrow {
    top: 50% !important;
    transform: translateY(-50%) !important;
    right: 0.4rem !important;
    width: 12px !important;
    height: 12px !important;
}

.gs-section .select2-container--default .select2-selection__arrow b {
    border-color: var(--gs-accent) transparent transparent transparent !important;
}

/* Select2 dropdown panel styling handled by select2-theme.css via --select2-accent.
   standalone-select2.js sets --select2-accent from --accent when a gs Select2 opens. */

/* ═══════════════════════════════════════════════════════════════════
   CHECKPOINT THUMBNAILS — preview images in Select2 dropdown
   ═══════════════════════════════════════════════════════════════════ */

/* Dropdown option row */
.ckpt-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ckpt-option__thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.ckpt-option__thumb--empty {
    display: inline-block;
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

.ckpt-option__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ckpt-option__name {
    font-size: 0.8rem;
    /* Grey checkpoint name so the family tag below carries the color. */
    color: #c0c0c0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ckpt-option__family {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: color-mix(in srgb, var(--select2-accent, var(--gs-accent)) 70%, rgba(255, 255, 255, 0.5));
}

/* Selected item (inside the select box — 2-line layout) */
.ckpt-selected {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ckpt-selected__thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.ckpt-selected__thumb--empty {
    display: inline-block;
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

.ckpt-selected__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ckpt-selected__name {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ckpt-selected__family {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    /* Closed state — --select2-accent is only set on the open dropdown, so
       reference --gs-accent directly. !important to beat the CDN select2
       theme's color on .select2-selection__rendered's children. */
    color: color-mix(in srgb, var(--gs-accent) 70%, rgba(255, 255, 255, 0.5)) !important;
}

/* Taller option rows for thumbnails */
.select2-results__option:has(.ckpt-option) {
    padding: 0.3rem 0.6rem;
}

/* Checkpoint selection box — 2-line height to match dropdown options */
#gs-checkpoint + .select2-container {
    --gs-select-height: 48px;
}

/* ═══════════════════════════════════════════════════════════════════
   CHECKPOINT HOVER POPOVER — larger preview + tags on hover
   ═══════════════════════════════════════════════════════════════════ */

.ckpt-popover {
    position: fixed;
    z-index: 999999;
    width: 220px;
    background: linear-gradient(160deg,
        color-mix(in srgb, var(--primary) 12%, #161618) 0%,
        color-mix(in srgb, var(--secondary) 8%, #161618) 50%,
        #161618 100%);
    border: 1px solid color-mix(in srgb, var(--secondary) 35%, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.ckpt-popover--visible {
    opacity: 1;
    transform: translateY(0);
}

.ckpt-popover__img-wrap {
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ckpt-popover__img {
    width: 100%;
    height: auto;
    display: block;
}

.ckpt-popover__name {
    font-size: 0.75rem;
    font-weight: 600;
    color: color-mix(in srgb, var(--secondary) 60%, white);
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ckpt-popover__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.ckpt-popover__tag {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 1px 5px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary) 18%, rgba(255, 255, 255, 0.06));
    color: color-mix(in srgb, var(--primary) 40%, rgba(255, 255, 255, 0.7));
    border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent);
    white-space: nowrap;
}

.ckpt-popover__tag--base {
    background: color-mix(in srgb, var(--secondary) 25%, rgba(255, 255, 255, 0.06));
    color: color-mix(in srgb, var(--secondary) 70%, white);
    border-color: color-mix(in srgb, var(--secondary) 30%, transparent);
    font-weight: 600;
}

/* ─── Preset auto-fill flash ─── */

@keyframes gs-flash {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gs-accent) 50%, transparent); }
    50% { box-shadow: 0 0 8px 2px color-mix(in srgb, var(--gs-accent) 40%, transparent); }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.gs-preset-flash {
    animation: gs-flash 0.6s ease-out;
}

/* ═══════════════════════════════════════════════════════════════════
   QUALITY ELEMENTS — multiselect + tags (no color pickers)
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Quality header with family badge ─── */

.gs-quality-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.gs-quality-header .gs-label {
    margin-bottom: 0;
}

.gs-family-badge {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--gs-accent) 20%, rgba(255, 255, 255, 0.04));
    border: 1px solid color-mix(in srgb, var(--gs-accent) 25%, rgba(255, 255, 255, 0.08));
    color: var(--gs-accent);
    text-transform: uppercase;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.gs-family-badge:empty {
    display: none;
}

/* ─── Negative header with type + frame badges ─── */

.gs-negative-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.gs-negative-header .gs-label {
    margin-bottom: 0;
}

.gs-badge-group {
    display: flex;
    gap: 0.3rem;
}

.gs-type-badge,
.gs-frame-badge {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    text-transform: uppercase;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.gs-type-badge {
    background: color-mix(in srgb, var(--gs-accent) 20%, rgba(255, 255, 255, 0.04));
    border: 1px solid color-mix(in srgb, var(--gs-accent) 25%, rgba(255, 255, 255, 0.08));
    /* Grey label — slot-2 (eyes) goes invisible at black eyes. Background
       + border still carry the slot tint. */
    color: var(--ui-text-strong);
}

.gs-frame-badge {
    /* Neutral grey — slot-11 (lighting) can resolve dark and the badge
       would vanish. Stays grey end-to-end like the Card fieldset. */
    background: rgba(75, 85, 99, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--ui-text-strong);
}

.gs-type-badge:empty,
.gs-frame-badge:empty {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════
   STYLE FILTER ROW — 2-column: filters left (wrap), generate right
   ═══════════════════════════════════════════════════════════════════ */

.gs-style-filters {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

/* Left column: bubbles wrap inside their own flex container */
.gs-filter-bubbles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: start;
}

/* Right column: generate button, top-aligned */
.gs-generate-btn {
    align-self: start;
    flex-shrink: 0;
    min-height: 0;
    padding: 0.4rem 1rem;
    transition: all 0.3s ease;
}

/* ─── Generating: keep stadium shape, show horizontal progress bar ─── */
.gs-generate-btn.generating {
    padding: 0.4rem 1rem;
    min-width: 120px;
}

.gs-generate-btn.generating .generate-icon {
    display: inline;
    font-size: 0.9rem;
}

.gs-generate-btn.generating .generate-label {
    display: none;
}

.gs-generate-btn.generating .progress-gauge {
    display: flex;
    flex: 1;
}

/* Crystallize + chat-driven status cascade: show the cycling label and
   hide the gauge so the gs button mirrors the chat/card buttons. The
   bare .generating default (direct-click scene gen) still shows the
   gauge — only these status classes flip the behavior. */
.gs-generate-btn.generating.status-crystallize .generate-label,
.gs-generate-btn.generating.status-thinking .generate-label,
.gs-generate-btn.generating.status-streaming .generate-label,
.gs-generate-btn.generating.status-queued .generate-label,
.gs-generate-btn.generating.status-prompt .generate-label {
    display: inline;
}

.gs-generate-btn.generating.status-crystallize .progress-gauge,
.gs-generate-btn.generating.status-thinking .progress-gauge,
.gs-generate-btn.generating.status-streaming .progress-gauge,
.gs-generate-btn.generating.status-queued .progress-gauge,
.gs-generate-btn.generating.status-prompt .progress-gauge {
    display: none;
}

.gs-generate-btn.generating .progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gs-generate-btn.generating .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg,
        var(--secondary) 0%,
        color-mix(in srgb, var(--secondary) 70%, white) 100%);
    border-radius: 2px;
    transition: width 0.15s ease-out;
    box-shadow: 0 0 8px var(--secondary);
}

/* Generation-settings busy lockout — surgical, per the deck philosophy.
   Every editable generation input freezes during BOTH events
   (generation AND crystallize — no param edits mid-event). Read-only
   stays readable, the style-filter + frame bubbles stay live, and
   labels / badges / swatches / chrome are never washed.

   - .gs-section--prompt: not in the wash — 100% read-only (Prompt
     label, seed display, readonly textarea). Readable mid-event.
   - .gs-filter-bubbles (style → checkpoint filter, no 'x') and
     builder-tag--frame (ephemeral, restored on reload) stay live.
   - Frozen: quality + negative select2 inputs AND their removable tag
     bubbles — #quality-tags and builder-tag--negative close via their
     'x', so they must lock mid-event (frame tags in the same container
     are excluded by the --negative class). Plus the six control
     selects: Select2 hides the native <select> and renders an adjacent
     .select2-container that IS the click target — the old id-only rule
     dimmed the dead native element while the widget stayed live, so we
     scope to .gs-controls-row and freeze select + .select2-container
     (labels/.gs-control chrome untouched). */
:is(.generating, .crystallizing, .prompt-locked) .gs-section--quality .gs-quality-input,
:is(.generating, .crystallizing, .prompt-locked) .gs-section--quality #quality-tags,
:is(.generating, .crystallizing, .prompt-locked) .gs-section--negative .gs-negative-input,
:is(.generating, .crystallizing, .prompt-locked) #negative-tags-wrap .builder-tag--negative,
:is(.generating, .crystallizing, .prompt-locked) .gs-controls-row :is(select, .select2-container) {
    opacity: 0.4;
    pointer-events: none;
}

/* The read-only prompt joins the busy read by greying the TEXT only —
   NOT opacity on the textarea (that washed its slot-2/slot-1 bevel
   gradient + border, the dead-wash look). The "Prompt" title lives in
   .gs-prompt-header (a separate element) so it already stays full; we
   only mute the textarea body, leaving the bevel surface intact —
   mirrors the activity/description feel (title stays, value greys).
   Overrides the legacy line ~322 `color: ... !important`, so this must
   carry !important too at higher specificity; it's a neutral text alpha
   (same white channel as the base), not a slot colour. No pointer-events
   lock — readonly, still scroll/select-able. 0.4 alpha is the tuning
   knob; lighten if the prose reads too faint. */
:is(.generating, .crystallizing, .prompt-locked) .gs-section--prompt .gs-textarea--readonly[readonly] {
    color: rgba(255, 255, 255, 0.4) !important;
}

.gs-style-bubble {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.gs-style-bubble:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.5);
}

.gs-style-bubble--active {
    background: color-mix(in srgb, var(--gs-accent) 20%, rgba(255, 255, 255, 0.04));
    border-color: color-mix(in srgb, var(--gs-accent) 35%, rgba(255, 255, 255, 0.1));
    /* Grey label — slot-2 (eyes) goes invisible with black eyes. Background
       + border still carry the slot tint so active state still reads. */
    color: var(--ui-text-strong);
}

.gs-style-bubble--active:hover {
    background: color-mix(in srgb, var(--gs-accent) 28%, rgba(255, 255, 255, 0.06));
    border-color: color-mix(in srgb, var(--gs-accent) 45%, rgba(255, 255, 255, 0.12));
    color: var(--ui-text-strong);
}

.gs-quality-input {
    margin-bottom: 0.5rem;
}

.gs-quality-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: 0;
}

/* Quality tags — compact, no color dot — eyes color (slot 2, always present) */
.gs-quality-tags .builder-tag--no-color {
    --tag-color: var(--secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    background: color-mix(in srgb, var(--tag-color) 18%, rgba(255, 255, 255, 0.04));
    border: 1px solid color-mix(in srgb, var(--tag-color) 25%, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    font-size: 0.7rem;
    color: color-mix(in srgb, var(--tag-color) 75%, white);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.gs-quality-tags .builder-tag--no-color:hover {
    border-color: color-mix(in srgb, var(--tag-color) 40%, rgba(255, 255, 255, 0.12));
    background: color-mix(in srgb, var(--tag-color) 25%, rgba(255, 255, 255, 0.06));
}

.gs-quality-tags .tag-name {
    white-space: nowrap;
}

.gs-quality-tags .tag-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0 0.1rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.gs-quality-tags .tag-remove:hover {
    color: rgba(255, 100, 100, 0.8);
}

/* ═══════════════════════════════════════════════════════════════════
   NEGATIVE TAGS — multi-select + tags (uses --slot-7 for red/warm accent)
   ═══════════════════════════════════════════════════════════════════ */

.gs-negative-input {
    margin-bottom: 0.5rem;
}

.gs-negative-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    min-height: 0;
}

.gs-negative-tags .builder-tag--negative {
    --tag-color: var(--primary);  /* hair — always present */
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    background: color-mix(in srgb, var(--tag-color) 18%, rgba(255, 255, 255, 0.04));
    border: 1px solid color-mix(in srgb, var(--tag-color) 25%, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    font-size: 0.7rem;
    color: color-mix(in srgb, var(--tag-color) 75%, white);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.gs-negative-tags .builder-tag--negative:hover {
    border-color: color-mix(in srgb, var(--tag-color) 40%, rgba(255, 255, 255, 0.12));
    background: color-mix(in srgb, var(--tag-color) 25%, rgba(255, 255, 255, 0.06));
}

.gs-negative-tags .tag-name {
    white-space: nowrap;
}

.gs-negative-tags .tag-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0 0.1rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.gs-negative-tags .tag-remove:hover {
    color: rgba(255, 100, 100, 0.8);
}

/* ─── Frame tags — read-only, inline with negative tags (eyes/--secondary) ─── */

.gs-negative-tags .builder-tag--frame {
    --tag-color: var(--secondary);  /* eyes — reliable + distinct from hair negatives (was dormant lighting) */
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    background: color-mix(in srgb, var(--tag-color) 14%, rgba(255, 255, 255, 0.03));
    border: 1px solid color-mix(in srgb, var(--tag-color) 20%, rgba(255, 255, 255, 0.06));
    border-radius: 12px;
    font-size: 0.65rem;
    color: color-mix(in srgb, var(--tag-color) 60%, rgba(255, 255, 255, 0.6));
    font-style: italic;
    cursor: default;
}
