/* ============================================================
   Generate2 Page — Complete self-contained styles
   Delete this file + generate2.js to remove entirely
   ============================================================ */

/* Scope everything under .g2 to avoid polluting other pages */

.main-content:has(.g2) {
    min-height: 0;
}

.g2 {
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
    background: #08080c;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    padding: 0;
    max-width: 100%;
}

/* Ambient background orbs */
.g2-ambient {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.g2-ambient .g2-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
}

.g2-ambient .g2-orb--1 {
    width: 500px;
    height: 500px;
    background: rgba(99, 102, 241, 0.05);
    top: -150px;
    right: 100px;
}

.g2-ambient .g2-orb--2 {
    width: 350px;
    height: 350px;
    background: rgba(168, 85, 247, 0.03);
    bottom: -80px;
    left: 200px;
}

/* Main layout */
.g2-layout {
    position: relative;
    z-index: 5;
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ---- Left Panel: Creation ---- */
.g2-panel {
    width: 420px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.012);
}

.g2-panel.collapsed {
    width: 0 !important;
    overflow: hidden;
}

.g2-panel__header {
    flex-shrink: 0;
    position: relative;
    padding: 28px 28px 0;
}

/* Collapse toggle — hidden on desktop, shown on mobile */
.g2-panel__collapse {
    display: none;
}

/* ---- Splitter ---- */
.g2-splitter {
    width: 6px;
    flex-shrink: 0;
    position: relative;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    touch-action: none;
}

@media (pointer: coarse) {
    .g2-splitter__toggle {
        opacity: 1;
        width: 28px;
        height: 52px;
        font-size: 18px;
        color: #aaa;
        background: #2a2a35;
        border-color: rgba(255, 255, 255, 0.15);
    }
}

.g2-splitter__line {
    width: 1px;
    height: 100%;
    background: rgba(255, 255, 255, 0.04);
}

.g2-splitter::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -2px;
    right: -14px;
}

.g2-splitter:hover .g2-splitter__line {
    width: 2px;
    background: rgba(99, 102, 241, 0.4);
}

.g2-splitter.dragging .g2-splitter__line {
    width: 2px;
    background: rgba(99, 102, 241, 0.6);
}

.g2-splitter__toggle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a22;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: #555;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    z-index: 11;
}

@media (hover: hover) {
    .g2-splitter:hover .g2-splitter__toggle {
        opacity: 1;
    }
}
.g2-splitter.dragging .g2-splitter__toggle,
.g2-splitter.touched .g2-splitter__toggle,
.g2-panel.collapsed ~ .g2-splitter .g2-splitter__toggle {
    opacity: 1;
}

.g2-splitter__toggle:hover {
    color: #aaa;
    border-color: rgba(99, 102, 241, 0.3);
}

.g2-panel.collapsed ~ .g2-splitter .g2-splitter__toggle .material-icons-outlined {
    transform: rotate(180deg);
}

.g2-panel__scroll {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}

.g2-panel__footer {
    padding: 16px 28px 20px;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    background: #0c0c10;
}

/* Workflow selector */
.g2-workflow {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 28px;
}

.g2-workflow:hover {
    border-color: rgba(255, 255, 255, 0.08);
}

.g2-workflow__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.g2-workflow__icon .material-icons-outlined {
    font-size: 20px;
    color: #fff;
}

.g2-workflow__info {
    flex: 1;
    min-width: 0;
}

.g2-workflow__name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.g2-workflow__tags {
    display: flex;
    gap: 6px;
    margin-top: 3px;
}

.g2-workflow__tag {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.g2-workflow__tag--accent {
    background: rgba(99, 102, 241, 0.08);
    color: #818cf8;
}

.g2-workflow__arrow {
    color: #777;
}

/* Workflow dropdown */
.g2-workflow-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #111115;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-height: 450px;
    overflow: hidden;
    display: none;
    z-index: 1000;
    flex-direction: column;
}

.g2-workflow-dropdown.show {
    display: flex;
}

.g2-workflow-dropdown__search {
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.g2-workflow-dropdown__search::placeholder {
    color: #777;
}

.g2-workflow-dropdown__cats {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    overflow-x: auto;
    flex-shrink: 0;
}

.g2-workflow-dropdown__cat {
    padding: 5px 10px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    color: #555;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    font-weight: 500;
}

.g2-workflow-dropdown__cat:hover {
    border-color: rgba(255, 255, 255, 0.08);
    color: #888;
}

.g2-workflow-dropdown__cat.active {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.25);
    color: #818cf8;
}

.g2-workflow-dropdown__list {
    flex: 1;
    overflow-y: auto;
    max-height: 320px;
}

.g2-workflow-dropdown__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.g2-workflow-dropdown__item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.g2-workflow-dropdown__item.selected {
    background: rgba(99, 102, 241, 0.05);
}

/* Section label */
.g2-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #555;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.g2-label__dot {
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
}

/* Prompt — Hero element */
.g2-prompt {
    position: relative;
    margin-bottom: 0;
}

.g2-prompt__textarea {
    display: block;
    width: 100%;
    min-height: 140px;
    padding: 20px 22px;
    background: rgba(255, 255, 255, 0.018);
    border: 1.5px solid rgba(99, 102, 241, 0.15);
    border-left: 3px solid rgba(99, 102, 241, 0.45);
    border-bottom: none;
    border-radius: 4px 14px 0 0;
    color: #e8e8ec;
    font-size: 16px;
    line-height: 1.65;
    resize: vertical;
    font-family: inherit;
    outline: none;
}

.g2-prompt__textarea:focus {
    border-color: rgba(99, 102, 241, 0.35);
    border-left-color: #6366f1;
    background: rgba(99, 102, 241, 0.015);
}

.g2-prompt__textarea::placeholder {
    color: #666;
}

.g2-prompt__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 6px;
    margin: 0 0 12px;
    background: rgba(255, 255, 255, 0.025);
    border: 1.5px solid rgba(99, 102, 241, 0.15);
    border-left: 3px solid rgba(99, 102, 241, 0.45);
    border-top: none;
    border-radius: 0 0 14px 4px;
}

.g2-prompt__tools {
    display: flex;
    gap: 2px;
}

.g2-prompt__tool {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #777;
    font-size: 16px;
    cursor: pointer;
    background: transparent;
    border: none;
}

.g2-prompt__tool:hover {
    color: #818cf8;
    background: rgba(99, 102, 241, 0.06);
}

.g2-prompt__chars {
    font-size: 11px;
    color: #666;
    font-family: 'JetBrains Mono', monospace;
}

/* Negative prompt toggle */
/* Prompt history dropdown */
.g2-prompt-history {
    display: none;
    background: #16161e;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.g2-prompt-history.show {
    display: block;
}

.g2-prompt-history__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 12px;
    color: #888;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.g2-prompt-history__clear {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 12px;
    cursor: pointer;
}

.g2-prompt-history__item {
    padding: 10px 14px;
    font-size: 13px;
    color: #ccc;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.g2-prompt-history__item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.g2-prompt-history__item:last-child {
    border-bottom: none;
}

.g2-prompt-history__empty {
    padding: 20px 14px;
    text-align: center;
    font-size: 13px;
    color: #666;
}

.g2-neg-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    color: #777;
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 24px;
    font-weight: 500;
    background: transparent;
    font-family: inherit;
}

.g2-neg-toggle:hover {
    border-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.g2-neg-toggle.active {
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.g2-neg-content {
    display: none;
    margin-bottom: 16px;
}

.g2-neg-content.open {
    display: block;
}

.g2-neg-content .g2-prompt__textarea {
    min-height: 80px;
    border-left-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.015);
}


.g2-neg-content .g2-prompt__textarea:focus {
    border-left-color: #ef4444;
}

/* Divider */
/* Input Image */
.g2-input-image {
    margin-bottom: 16px;
}

.g2-input-image__row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.g2-input-image__preview {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1.5px dashed rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    color: #666;
    font-size: 22px;
    position: relative;
    overflow: hidden;
}

.g2-input-image__preview.has-image {
    border-style: solid;
    border-color: rgba(99, 102, 241, 0.25);
}

.g2-input-image__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.g2-input-image__clear {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    color: #aaa;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    line-height: 1;
}

.g2-input-image__clear:hover {
    color: #fff;
}

.g2-input-image__id {
    flex: 1;
    font-size: 13px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: #e8e8ec;
    outline: none;
    min-width: 0;
}

.g2-input-image__id:focus {
    border-color: rgba(99, 102, 241, 0.3);
}

.g2-input-image__browse {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #999;
    cursor: pointer;
    flex-shrink: 0;
}

.g2-input-image__browse:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.g2-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 24px;
}

/* Section title */
.g2-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #777;
    margin-bottom: 16px;
}

/* Dimensions */
.g2-dims {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}


.g2-dims__field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.g2-dims__label {
    font-size: 10px;
    font-weight: 600;
    color: #777;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.g2-dims__select {
    width: 100%;
    font-size: 13px;
    font-weight: 500;
    color: #e8e8ec;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    padding: 5px 8px;
    appearance: none;
    -webkit-appearance: none;
}

.g2-dims__select:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(99, 102, 241, 0.2);
}

.g2-dims__select:focus {
    border-color: rgba(99, 102, 241, 0.4);
}

.g2-dims__select option {
    background: #1a1a1f;
    color: #fff;
}

.g2-dims__x {
    color: #666;
    font-size: 11px;
    flex-shrink: 0;
}

/* Image count */
.g2-count {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.g2-count__label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #777;
}

.g2-count__stepper {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    overflow: hidden;
}

.g2-count__btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: #666;
}

.g2-count__btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #aaa;
}

.g2-count__value {
    width: 32px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
    color: #e8e8ec;
}

/* Folder selector */
.g2-folder {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 24px;
    font-weight: 500;
}

.g2-folder:hover {
    border-color: rgba(255, 255, 255, 0.06);
}

.g2-folder .material-icons-outlined {
    font-size: 17px;
    color: #777;
}

.g2-folder__name {
    flex: 1;
}

.g2-folder-wrap {
    position: relative;
    margin-bottom: 24px;
}

.g2-folder-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #161618;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 4px;
    z-index: 20;
    max-height: 240px;
    overflow-y: auto;
}

.g2-folder-dropdown.show {
    display: block;
}

.g2-folder-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #999;
    cursor: pointer;
}

.g2-folder-dropdown__item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #ccc;
}

.g2-folder-dropdown__item.active {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.g2-folder-dropdown__item .material-icons-outlined {
    font-size: 17px;
}

.g2-folder-dropdown__create {
    color: #4a9eff;
}

.g2-folder-dropdown__create:hover {
    color: #6ab4ff;
}

.g2-folder-dropdown__divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 4px 8px;
}

/* Collapsible groups */
.g2-group {
    border: 1px solid rgba(255, 255, 255, 0.025);
    border-radius: 10px;
    margin-bottom: 5px;
    overflow: hidden;
}

.g2-group__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.g2-group__header:hover {
    color: #888;
}

.g2-group__header .material-icons-outlined {
    font-size: 17px;
    color: #888;
}

.g2-group__name {
    flex: 1;
}

.g2-group__badge {
    font-size: 10px;
    color: #666;
    background: rgba(255, 255, 255, 0.025);
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.g2-group__arrow {
    color: #555;
    font-size: 16px;
}

.g2-group.open .g2-group__arrow {
    transform: rotate(90deg);
}

.g2-group__content {
    display: none;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.g2-group.open .g2-group__content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Form fields inside groups */
.g2-field__label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.g2-field__slider {
    display: flex;
    align-items: center;
    gap: 12px;
}

.g2-slider {
    flex: 1;
    padding: 12px 0;
    cursor: pointer;
    touch-action: none;
}

.g2-slider__track {
    position: relative;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
}

.g2-slider__fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    pointer-events: none;
}

.g2-slider__thumb {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: var(--accent-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.g2-field__value {
    width: 52px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

.g2-field__seed {
    display: flex;
    gap: 6px;
    align-items: center;
}

.g2-field__seed-input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    color: #555;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    font-style: italic;
    outline: none;
}

.g2-field__seed-input:focus {
    border-color: rgba(99, 102, 241, 0.3);
}

.g2-field__seed-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    color: #888;
    cursor: pointer;
    font-size: 16px;
}

.g2-field__seed-btn:hover {
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.25);
}

.g2-field__seed-btn.locked {
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.05);
}

.g2-field__input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.g2-field__input:focus {
    border-color: rgba(99, 102, 241, 0.3);
}

.g2-field__select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.g2-field__select option {
    background: #1a1a1f;
}

.g2-field__description {
    font-size: 11px;
    color: #777;
    margin-top: 4px;
}

.g2-field__description a {
    color: #60a5fa;
    text-decoration: none;
}

.g2-field__description a:hover {
    text-decoration: underline;
}

/* Generate button */
.g2-generate {
    width: 100%;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 600;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.g2-generate:hover {
    background: var(--accent-hover);
}

.g2-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.g2-generate .material-icons-outlined {
    font-size: 18px;
}

.g2-generate__shortcut {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 7px;
    border-radius: 4px;
    margin-left: 10px;
    font-family: 'JetBrains Mono', monospace;
}

.g2-generate .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: g2-spin 0.8s linear infinite;
}

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

/* ---- Right Panel: Results ---- */
.g2-results {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #08080c;
    min-width: 0;
    min-height: 0;
}

.g2-results__tabs {
    display: flex;
    gap: 2px;
    padding: 6px 12px 0;
    background: #08080c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.g2-results__tab {
    background: transparent;
    border: none;
    color: #777;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: inherit;
}

.g2-results__tab:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.03);
}

.g2-results__tab.active {
    color: #fff;
    border-bottom-color: #6366f1;
}

.g2-results__pane {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.g2-results__pane[hidden] {
    display: none;
}

.g2-results__pane--library {
    overflow: hidden; /* library has its own internal scroll */
}

.g2-library-mount {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.g2-results__header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(8, 8, 12, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.g2-results__search-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.g2-results__search-icon {
    position: absolute;
    left: 8px;
    font-size: 16px;
    color: #444;
    pointer-events: none;
}

.g2-results__search {
    width: 100%;
    padding: 6px 10px 6px 30px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #ccc;
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.g2-results__search:focus {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.g2-results__search::placeholder {
    color: #444;
}

.g2-results__controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.g2-results__count {
    font-size: 11px;
    color: #555;
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

/* Masonry grid — flexbox columns for L→R reading order */
.g2-grid {
    display: flex;
    gap: 9px;
    padding: 12px 16px;
}

.g2-grid-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
}

.g2-card {
    margin-bottom: 0;
    border-radius: 9px;
    overflow: hidden;
    position: relative;
    background: #111115;
}

.g2-card__image {
    width: 100%;
    display: block;
    object-fit: cover;
}

.g2-card__dims {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 8px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

.g2-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 25%, rgba(0, 0, 0, 0.85));
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px;
    cursor: pointer;
}

.g2-card:hover .g2-card__overlay {
    opacity: 1;
}

.g2-card__prompt {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.g2-card__actions {
    display: flex;
    gap: 5px;
}

.g2-card__action {
    height: 28px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.g2-card__action:hover {
    background: rgba(99, 102, 241, 0.5);
    border-color: rgba(99, 102, 241, 0.3);
}

.g2-card__action .material-icons-outlined {
    font-size: 13px;
}

/* Video badge */
.g2-card__video-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    color: white;
}

.g2-card__video-badge .material-icons-outlined {
    font-size: 14px;
}

/* Progress card (in-progress job inline in grid) */
.g2-progress {
    position: relative;
    border-radius: 9px;
    background: #111115;
    border: 1.5px dashed rgba(99, 102, 241, 0.12);
    overflow: hidden;
}

.g2-progress__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px;
}

.g2-progress__spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(99, 102, 241, 0.1);
    border-top-color: rgba(99, 102, 241, 0.7);
    border-radius: 50%;
    animation: g2-spin 0.9s linear infinite;
}

.g2-progress__name {
    font-size: 11px;
    color: #aaa;
    font-weight: 600;
    text-align: center;
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.g2-progress__status {
    font-size: 10px;
    color: #666;
    font-weight: 500;
}

.g2-progress__bar {
    width: 60%;
    max-width: 120px;
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    overflow: hidden;
}

.g2-progress__fill {
    height: 100%;
    background: rgba(99, 102, 241, 0.7);
    border-radius: 2px;
}

.g2-progress__pct {
    font-size: 10px;
    color: rgba(99, 102, 241, 0.8);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.g2-progress__meta {
    font-size: 9px;
    color: #555;
    margin-top: 2px;
}

.g2-progress__log {
    font-size: 9px;
    color: #444;
    font-family: 'JetBrains Mono', monospace;
    max-width: 90%;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 4px;
}

.g2-progress__info {
    position: absolute;
    top: 8px;
    left: 8px;
    background: none;
    border: none;
    color: #444;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    z-index: 2;
}

.g2-progress__info:hover {
    color: #888;
}

.g2-progress__info .material-icons-outlined {
    font-size: 16px;
}

.g2-log-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.g2-log-modal {
    background: #161618;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.g2-log-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
    font-weight: 600;
    color: #ccc;
}

.g2-log-modal__close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
}

.g2-log-modal__close:hover {
    color: #aaa;
}

.g2-log-modal__body {
    padding: 14px 18px;
    overflow-y: auto;
    flex: 1;
}

.g2-log-modal__line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #888;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    word-break: break-all;
}

/* Empty states */
.g2-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.g2-empty .material-icons-outlined {
    font-size: 48px;
    color: #555;
    margin-bottom: 12px;
}

.g2-empty h3 {
    font-size: 15px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.g2-empty p {
    font-size: 13px;
    color: #777;
}

/* Loading state */
.g2-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    flex: 1;
}

.g2-loading .spinner {
    width: 32px;
    height: 32px;
    border: 2.5px solid rgba(99, 102, 241, 0.1);
    border-top-color: rgba(99, 102, 241, 0.6);
    border-radius: 50%;
    animation: g2-spin 0.9s linear infinite;
    margin-bottom: 12px;
}

.g2-loading p {
    font-size: 13px;
    color: #888;
}

/* Mobile generate bar - hidden on desktop, shown via media query */
.g2-mobile-bar {
    display: none;
    position: fixed;
    bottom: 50px;
    left: 0;
    right: 0;
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: rgba(12, 12, 16, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 1050;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .g2-panel {
        width: 360px;
    }
}

@media (max-width: 768px) {
    .g2 {
        height: calc(100vh - 51px);
        height: calc(100dvh - 51px);
    }

    .g2-layout {
        flex-direction: column;
    }

    .g2-splitter {
        display: none;
    }

    .g2-panel {
        width: 100% !important;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        flex: 1;
        min-height: 0;
    }

    .g2-panel.mobile-collapsed {
        flex: 0 0 auto;
    }

    .g2-panel__header {
        padding: 6px 16px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .g2-panel__header .g2-workflow {
        flex: 1;
        min-width: 0;
        padding: 6px 10px;
        gap: 10px;
        margin-bottom: 0;
        border-radius: 8px;
    }

    .g2-panel__header .g2-workflow__icon {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }

    .g2-panel__header .g2-workflow__icon .material-icons-outlined {
        font-size: 16px;
    }

    .g2-panel__header .g2-workflow__name {
        font-size: 13px;
    }

    .g2-panel__header .g2-workflow__tags {
        display: none;
    }

    .g2-panel__collapse {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        flex-shrink: 0;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 6px;
        color: #888;
        font-size: 18px;
        cursor: pointer;
    }

    .g2-panel__collapse:active {
        background: rgba(255, 255, 255, 0.08);
    }

    /* Collapsed state — hide form, rotate chevron */
    .g2-panel.mobile-collapsed .g2-panel__scroll {
        display: none;
    }

    .g2-panel.mobile-collapsed .g2-panel__collapse .material-icons-outlined {
        transform: rotate(180deg);
    }

    .g2-mobile-bar.hidden {
        display: none;
    }

    .g2-panel__scroll {
        padding: 20px;
        padding-bottom: 80px;
        max-height: none;
    }

    .g2-panel__footer {
        display: none;
    }

    .g2-results {
        flex: 1;
        min-height: 0;
        display: none;
        overflow-y: auto;
    }

    .g2-panel.mobile-collapsed ~ .g2-results {
        display: block;
    }

    .g2-grid {
        gap: 8px;
        padding: 8px;
    }

    .g2-grid-col {
        gap: 8px;
    }

    /* Mobile fixed generate bar */
    .g2-mobile-bar {
        display: flex;
    }
}

/* Column selector dropdown */
.g2-col-selector {
    position: relative;
}

.g2-col-trigger {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.03);
    color: #666;
    cursor: pointer;
    padding: 0;
}

.g2-col-trigger .material-icons-outlined {
    font-size: 18px;
}

.g2-col-trigger:hover {
    border-color: rgba(255, 255, 255, 0.1);
    color: #999;
}

.g2-col-selector.open .g2-col-trigger {
    border-color: rgba(99, 102, 241, 0.3);
    color: #818cf8;
}

.g2-col-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #161620;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 4px;
    min-width: 120px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 50;
}

.g2-col-selector.open .g2-col-menu {
    display: flex;
    flex-direction: column;
}

.g2-col-menu__item {
    padding: 7px 12px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
    font-family: inherit;
    white-space: nowrap;
}

.g2-col-menu__item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
}

.g2-col-menu__item.active {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
}

/* Infinite scroll sentinel */
.g2-load-trigger {
    height: 1px;
}

/* ---- G2 Lightbox Overlay ---- */
.g2-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: #000;
}

.g2-lightbox-overlay.active {
    display: block;
}

.g2-lightbox-overlay .view-image-page {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: auto;
}
