/* Custom overrides on top of Tailwind CDN — mirrors the FreeJourney palette. */

:root {
    --fj-bg: #090811;
    --fj-body: #a1aac9;
    --fj-primary: #08e981;
    --fj-primary-hover: #07d175;
    --fj-secondary: #0d0d1a;
    --fj-tertiary: #242447;
    --fj-danger: #e91108;
    --fj-warning: #e99308;
    --fj-info: #08e9de;
}

html, body {
    background: var(--fj-bg);
    color: var(--fj-body);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: #ffffff; }

/* Force Tailwind text-primary to use white (FreeJourney convention) */
.text-fj-primary { color: #ffffff; }
.text-fj-secondary { color: var(--fj-body); }
.text-fj-success { color: var(--fj-primary); }
.text-fj-danger { color: var(--fj-danger); }
.text-fj-warning { color: var(--fj-warning); }

.bg-fj-bg { background-color: var(--fj-bg); }
.bg-fj-secondary { background-color: var(--fj-secondary); }
.bg-fj-tertiary { background-color: var(--fj-tertiary); }
.bg-fj-primary { background-color: var(--fj-primary); }
.bg-fj-primary-30 { background-color: rgba(8, 233, 129, 0.3); }

.border-fj-tertiary { border-color: var(--fj-tertiary); }

/* Buttons */
.fj-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: background-color .2s, color .2s, border-color .2s, transform .15s;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}
.fj-btn:active { transform: translateY(1px); }

.fj-btn-primary {
    background: var(--fj-primary);
    color: #07120b;
}
.fj-btn-primary:hover {
    background: var(--fj-primary-hover);
    color: #07120b;
}

.fj-btn-secondary {
    background: var(--fj-secondary);
    color: #ffffff;
    border-color: var(--fj-tertiary);
}
.fj-btn-secondary:hover {
    background: var(--fj-tertiary);
    color: #ffffff;
}

.fj-btn-ghost {
    background: transparent;
    color: var(--fj-body);
    border-color: transparent;
}
.fj-btn-ghost:hover {
    background: var(--fj-secondary);
    color: #ffffff;
}

.fj-btn-lg { padding: 0.9rem 1.75rem; font-size: 1rem; }
.fj-btn-sm { padding: 0.45rem 0.9rem; font-size: 0.875rem; }

/* Card */
.fj-card {
    background: var(--fj-secondary);
    border: 1px solid var(--fj-tertiary);
    border-radius: 1rem;
    transition: border-color .2s, transform .15s, background-color .2s;
}
.fj-card:hover {
    border-color: var(--fj-primary);
}

/* Nav card (landing) */
.fj-nav-card {
    background: var(--fj-secondary);
    border: 1px solid var(--fj-tertiary);
    border-radius: 0.875rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    cursor: pointer;
    transition: border-color .2s, background-color .2s, transform .15s;
    position: relative;
}
.fj-nav-card:hover {
    border-color: var(--fj-primary);
    background: #14142a;
}
.fj-nav-card .material-icons-outlined,
.fj-nav-card > i {
    color: var(--fj-primary);
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 1.75rem;
    text-align: center;
}
.fj-nav-card .auth-lock {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.875rem;
    color: var(--fj-body);
    opacity: 0.6;
}

/* Pricing */
.fj-price-box {
    background: var(--fj-secondary);
    border: 1px solid var(--fj-tertiary);
    border-radius: 1.25rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: transform .2s, border-color .2s;
}
.fj-price-box.highlight {
    border-color: var(--fj-primary);
    box-shadow: 0 0 0 1px var(--fj-primary), 0 18px 60px -25px rgba(8, 233, 129, 0.35);
}

.fj-toggle-switch {
    position: relative;
    width: 3rem;
    height: 1.5rem;
    background: var(--fj-tertiary);
    border-radius: 999px;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color .2s;
}
.fj-toggle-switch .knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 1.125rem;
    height: 1.125rem;
    background: #ffffff;
    border-radius: 999px;
    transition: transform .2s;
}
.fj-toggle-switch.active { background: var(--fj-primary); }
.fj-toggle-switch.active .knob { transform: translateX(1.5rem); }

/* Img wrapper hover overlay (landing tile) */
.fj-img-wrapper { position: relative; overflow: hidden; border-radius: 1rem; }
.fj-img-wrapper .overlay {
    position: absolute; inset: auto 0 0 0;
    padding: 0.75rem;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    opacity: 0; transition: opacity .2s;
}
.fj-img-wrapper:hover .overlay { opacity: 1; }

/* Scrollbar (subtle) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--fj-bg); }
::-webkit-scrollbar-thumb { background: var(--fj-tertiary); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #303060; }

/* Badge */
.fj-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    font-size: 0.7rem;
    border-radius: 999px;
    background: rgba(8, 233, 129, 0.18);
    color: var(--fj-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Navbar with mega menu (mirrors PicsAI structure) ---- */
.fj-navbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(9, 8, 17, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--fj-tertiary);
}
.fj-navbar.mega-open {
    background: var(--fj-bg);
}
.fj-navbar-inner {
    max-width: 80rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
}
@media (min-width: 1024px) {
    .fj-navbar-inner { padding: 0.75rem 2rem; }
}

.fj-cat-tabs {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
}
.fj-cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: transparent;
    border: 0;
    border-radius: 0.625rem;
    color: var(--fj-body);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.fj-cat-tab i { font-size: 1rem; opacity: 0.85; }
.fj-cat-tab:hover {
    color: #ffffff;
    background: var(--fj-secondary);
}
.fj-cat-tab.active {
    color: var(--fj-primary);
}
.fj-cat-tab.open {
    color: var(--fj-primary);
    background: var(--fj-secondary);
}

/* Tier badge on the right */
.fj-tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: var(--fj-tertiary);
    color: var(--fj-body);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.fj-tier-badge:hover {
    color: var(--fj-primary);
    background: rgba(8, 233, 129, 0.12);
}

/* Mega menu panel */
.fj-mega-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--fj-bg);
    border-bottom: 1px solid var(--fj-tertiary);
    box-shadow: 0 20px 60px -25px rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease;
}
.fj-mega-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.fj-mega-grid {
    max-width: 80rem;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}
.fj-mega-col {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: opacity .15s ease;
}
.fj-mega-panel.open .fj-mega-col:not(.focus) {
    opacity: 0.45;
}
.fj-mega-heading {
    color: var(--fj-primary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 0 0 0.75rem 0;
}
.fj-mega-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.6rem;
    border-radius: 0.625rem;
    transition: background-color .12s, color .12s;
    position: relative;
    color: var(--fj-body);
}
.fj-mega-item > i:first-child {
    width: 1.5rem;
    text-align: center;
    color: var(--fj-primary);
    padding-top: 0.15rem;
    font-size: 1rem;
}
.fj-mega-item:hover {
    background: var(--fj-secondary);
    color: #ffffff;
}
.fj-mega-item.current {
    background: rgba(8, 233, 129, 0.08);
}
.fj-mega-item.current .fj-mega-item-title {
    color: var(--fj-primary);
}
.fj-mega-item-text { display: flex; flex-direction: column; min-width: 0; }
.fj-mega-item-title {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.25;
}
.fj-mega-item-desc {
    color: var(--fj-body);
    font-size: 0.75rem;
    line-height: 1.3;
    margin-top: 0.125rem;
}
.fj-mega-item-lock {
    margin-left: auto;
    color: var(--fj-body);
    opacity: 0.45;
    font-size: 0.75rem;
}

/* Mobile nav offcanvas */
.fj-offcanvas {
    position: fixed;
    inset: 0;
    background: var(--fj-bg);
    z-index: 50;
    transform: translateX(100%);
    transition: transform .25s ease;
    display: flex;
    flex-direction: column;
}
.fj-offcanvas.open { transform: translateX(0); }

/* Tag chip */
.fj-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: var(--fj-secondary);
    border: 1px solid var(--fj-tertiary);
    color: var(--fj-body);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all .15s;
}
.fj-chip:hover, .fj-chip.active {
    color: #ffffff;
    border-color: var(--fj-primary);
}
.fj-chip.active { background: rgba(8, 233, 129, 0.12); }

/* Page hero common style */
.fj-page-hero h1 { color: #ffffff; }

/* Section title */
.fj-section-title { color: #ffffff; font-weight: 800; }

/* ============================================================
   Landing page — hero, explore cards, marquee
   (mirrors picsAI-landing.jpg reference)
   ============================================================ */

/* ---- Hero ---- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 90px 16px 0;
    min-height: 640px;
    isolation: isolate;
}
@media (min-width: 1024px) { .hero { padding-top: 120px; min-height: 720px; } }

.hero::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% 30%, rgba(8, 233, 129, 0.10), transparent 70%),
        radial-gradient(ellipse 90% 60% at 50% 110%, rgba(8, 233, 129, 0.18), transparent 60%);
    z-index: -2;
}
.hero::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.04) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(8, 233, 129, 0.05) 0%, transparent 50%);
    mix-blend-mode: screen;
    z-index: -1;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}
.hero-eyebrow::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--fj-primary);
    box-shadow: 0 0 8px var(--fj-primary), 0 0 16px rgba(8, 233, 129, 0.6);
    animation: hero-pulse 1.8s ease-in-out infinite;
}
@keyframes hero-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.6; transform: scale(1.4); }
}

.hero-title {
    font-weight: 200;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
    line-height: 0.95;
    font-size: clamp(2.5rem, 8vw, 6.5rem);
    text-shadow: 0 4px 24px rgba(8, 233, 129, 0.15);
}
.hero-title__accent { color: var(--fj-primary); font-weight: 300; }

.hero-desc {
    max-width: 640px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.65);
    font-size: 15px;
    line-height: 1.7;
}

.hero-cta {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 14px 28px;
    border-radius: 999px;
    font-size: 14px; font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}
.hero-cta--dark {
    background: rgba(13, 13, 26, 0.85);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}
.hero-cta--dark:hover { background: rgba(13, 13, 26, 1); border-color: var(--fj-primary); }
.hero-cta--ghost {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
}
.hero-cta--ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* Signature horizontal stage-light beam */
.hero-beam {
    position: relative;
    margin-top: 60px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--fj-primary), transparent);
    box-shadow: 0 0 24px var(--fj-primary);
}
.hero-beam::before {
    content: '';
    position: absolute;
    left: 50%; top: 0;
    transform: translate(-50%, -10%);
    width: min(720px, 85%);
    height: 220px;
    background: radial-gradient(ellipse at center top, rgba(8, 233, 129, 0.55), rgba(8, 233, 129, 0.15) 40%, transparent 70%);
    filter: blur(20px);
    pointer-events: none;
}
.hero-beam::after {
    content: '';
    position: absolute;
    left: 50%; top: 0;
    transform: translate(-50%, -50%);
    width: min(420px, 60%);
    height: 60px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.9), rgba(8, 233, 129, 0.4) 30%, transparent 70%);
    filter: blur(10px);
    pointer-events: none;
}

/* Scrolling marquee */
.hero-marquee {
    position: relative;
    margin-top: 80px;
    padding: 16px 0;
    background: rgba(13, 13, 26, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
    backdrop-filter: blur(8px);
}
.hero-marquee__track {
    display: flex;
    gap: 60px;
    white-space: nowrap;
    animation: hero-marquee 40s linear infinite;
    width: max-content;
}
.hero-marquee__item {
    display: inline-flex; align-items: center; gap: 12px;
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}
.hero-marquee__item i { color: var(--fj-primary); font-size: 8px; }
@keyframes hero-marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* Explore section eyebrow — uses pseudo-element flanking lines */
.explore-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.35em; text-transform: uppercase;
    color: var(--fj-primary);
}
.explore-eyebrow::before,
.explore-eyebrow::after {
    content: ''; width: 24px; height: 1px;
    background: linear-gradient(to right, transparent, var(--fj-primary));
}
.explore-eyebrow::after { background: linear-gradient(to left, transparent, var(--fj-primary)); }

/* ---- Explore cards (glassmorphic, green-blooming, dreamy) ---- */
.explore-card {
    --bloom-x: 50%;
    --bloom-y: 100%;
    position: relative;
    display: flex; flex-direction: column;
    padding: 28px 22px 24px;
    min-height: 260px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(.2,.7,.2,1), border-color 0.3s ease;
    isolation: isolate;
    color: #fff;
    text-decoration: none;
}
/* Bloom layer — soft green radial that intensifies on hover */
.explore-card::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at var(--bloom-x) var(--bloom-y),
            rgba(8, 233, 129, 0.28),
            rgba(8, 233, 129, 0.10) 35%,
            transparent 65%);
    opacity: 0.7;
    transition: opacity 0.4s ease, transform 0.6s ease;
    z-index: -1;
    pointer-events: none;
}
/* Hairline gradient border (mask trick) */
.explore-card::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(8, 233, 129, 0.45),
        rgba(255, 255, 255, 0.06) 30%,
        rgba(255, 255, 255, 0.02) 60%,
        rgba(8, 233, 129, 0.25));
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
.explore-card:hover {
    transform: translateY(-4px);
    border-color: rgba(8, 233, 129, 0.25);
}
.explore-card:hover::before { opacity: 1.15; }
.explore-card:hover::after  { opacity: 1; }

.explore-card__icon {
    position: relative;
    width: 56px; height: 56px;
    border-radius: 18px;
    display: grid; place-items: center;
    font-size: 22px; color: var(--fj-primary);
    background: radial-gradient(circle at 30% 30%, rgba(8, 233, 129, 0.22), rgba(8, 233, 129, 0.05) 70%);
    border: 1px solid rgba(8, 233, 129, 0.2);
    box-shadow:
        0 8px 24px rgba(8, 233, 129, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    margin-bottom: 22px;
}
.explore-card__icon::before {
    content: '';
    position: absolute; inset: -8px;
    border-radius: inherit;
    background: radial-gradient(circle, rgba(8, 233, 129, 0.35), transparent 70%);
    filter: blur(12px);
    opacity: 0.5;
    z-index: -1;
    transition: opacity 0.4s ease;
}
.explore-card:hover .explore-card__icon::before { opacity: 1; }

.explore-card__title {
    font-size: 17px; font-weight: 600;
    color: #fff;
    letter-spacing: 0.01em;
    margin-bottom: 6px;
}
.explore-card__desc {
    font-size: 13px; line-height: 1.6;
    color: rgba(255, 255, 255, 0.55);
    flex: 1;
}
.explore-card__link {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 18px;
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--fj-primary);
    transition: gap 0.25s ease;
}
.explore-card:hover .explore-card__link { gap: 12px; }
.explore-card__link i { font-size: 10px; }

/* Drifting particle */
.explore-card__particle {
    position: absolute;
    top: 16%; right: 14%;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--fj-primary);
    box-shadow: 0 0 12px var(--fj-primary), 0 0 24px rgba(8, 233, 129, 0.5);
    opacity: 0.6;
    animation: explore-drift 6s ease-in-out infinite;
    pointer-events: none;
}
.explore-card:nth-child(2) .explore-card__particle { animation-delay: -1.5s; top: 24%; right: 22%; }
.explore-card:nth-child(3) .explore-card__particle { animation-delay: -3s;   top: 18%; right: 10%; }
.explore-card:nth-child(4) .explore-card__particle { animation-delay: -4.5s; top: 28%; right: 18%; }
.explore-card:nth-child(5) .explore-card__particle { animation-delay: -2s;   top: 14%; right: 24%; }
@keyframes explore-drift {
    0%, 100% { transform: translate(0, 0); opacity: 0.6; }
    50%      { transform: translate(-6px, 8px); opacity: 1; }
}

/* ============================================================
   Landing Create section — featured card + 2x2 small cards
   (mirrors create-cards.jpg middle section)
   ============================================================ */
.create-tab {
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.025);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
    cursor: pointer;
}
.create-tab:hover {
    color: #fff;
    border-color: rgba(8, 233, 129, 0.4);
}
.create-tab--active {
    background: var(--fj-primary);
    color: var(--fj-bg);
    border-color: var(--fj-primary);
    box-shadow: 0 0 24px rgba(8, 233, 129, 0.25);
}
.create-tab--active:hover { color: var(--fj-bg); }

/* ---- Section shell (the big glassmorphic wrapper around left header + right cards) ---- */
.create-shell {
    position: relative;
    padding: 36px;
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(8, 233, 129, 0.06) 0%, rgba(255, 255, 255, 0.015) 60%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    overflow: hidden;
    isolation: isolate;
    color: #fff;
}
@media (min-width: 1024px) { .create-shell { padding: 48px; } }

.create-shell::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 15% 20%, rgba(8, 233, 129, 0.22), transparent 60%),
        radial-gradient(ellipse 60% 40% at 85% 100%, rgba(8, 233, 129, 0.16), transparent 70%);
    z-index: -1;
}
.create-shell::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(8, 233, 129, 0.4),
        rgba(255, 255, 255, 0.06) 35%,
        rgba(255, 255, 255, 0.02) 65%,
        rgba(8, 233, 129, 0.25));
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    opacity: 0.7;
}

.create-shell__cta {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 24px;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase;
    background: var(--fj-primary);
    color: var(--fj-bg);
    text-decoration: none;
    transition: gap 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 0 24px rgba(8, 233, 129, 0.25);
}
.create-shell__cta:hover {
    gap: 14px;
    box-shadow: 0 0 36px rgba(8, 233, 129, 0.5);
}

/* ============================================================
   Upload Modal (Drive uploader)
   ============================================================ */
.upload-modal-overlay,
.prohibited-content-modal-overlay {
    position: fixed; inset: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
}
.upload-modal {
    width: 100%; max-width: 640px;
    background: var(--fj-bg, #090811);
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.08));
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6);
    display: flex; flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}
.upload-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--fj-tertiary, rgba(255,255,255,0.08));
}
.upload-modal-title {
    display: inline-flex; align-items: center; gap: 10px;
    color: #fff; font-weight: 700; font-size: 17px;
}
.upload-modal-title i { color: var(--fj-primary, #08e981); }
.upload-modal-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 0;
    display: grid; place-items: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.upload-modal-close:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.upload-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
    display: flex; flex-direction: column; gap: 14px;
}

.upload-destination {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(8, 233, 129, 0.08);
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}
.upload-destination i { color: var(--fj-primary, #08e981); }
.upload-destination strong { color: #fff; }

/* Drop zone */
.upload-drop-area {
    border: 2px dashed var(--fj-tertiary, rgba(255,255,255,0.12));
    border-radius: 14px;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.upload-drop-area:hover,
.upload-drop-area.drag-over {
    border-color: var(--fj-primary, #08e981);
    background: rgba(8, 233, 129, 0.05);
}
.upload-drop-icon { font-size: 36px; color: rgba(255, 255, 255, 0.55); margin-bottom: 8px; }
.upload-drop-text { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.upload-drop-primary { color: #fff; font-weight: 600; font-size: 14px; }
.upload-drop-secondary { color: rgba(255, 255, 255, 0.5); font-size: 12px; }
.upload-browse-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff; border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.1));
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    cursor: pointer;
}
.upload-browse-btn:hover { background: rgba(255, 255, 255, 0.1); }

/* Compliance section */
.upload-compliance-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.08));
    border-radius: 12px;
    padding: 14px;
}
.upload-compliance-header {
    display: inline-flex; align-items: center; gap: 8px;
    color: #fff; font-weight: 600; font-size: 14px;
    margin-bottom: 12px;
}
.upload-compliance-header i { color: var(--fj-primary, #08e981); }
.upload-compliance-form { display: flex; flex-direction: column; gap: 12px; }
.upload-compliance-checkbox {
    display: flex; align-items: flex-start; gap: 10px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}
.upload-compliance-checkbox input[type=checkbox] {
    margin-top: 3px;
    accent-color: var(--fj-primary, #08e981);
}
.compliance-link { color: var(--fj-primary, #08e981); text-decoration: underline; }
.upload-compliance-field { display: flex; flex-direction: column; gap: 4px; position: relative; }
.upload-compliance-field label {
    font-size: 12px; font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}
.upload-compliance-field .required { color: #fca5a5; }
.upload-compliance-field textarea {
    min-height: 72px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.1));
    font-size: 13px;
    resize: vertical;
    font-family: inherit;
}
.upload-compliance-field textarea:focus { outline: none; border-color: var(--fj-primary, #08e981); }
.compliance-source-char-count {
    align-self: flex-end;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

/* Progress */
.upload-progress-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.08));
    border-radius: 12px;
    padding: 12px 14px;
}
.upload-progress-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.upload-progress-info { display: flex; flex-direction: column; gap: 2px; }
.upload-progress-count { color: #fff; font-size: 13px; font-weight: 600; }
.upload-progress-status { color: rgba(255, 255, 255, 0.55); font-size: 12px; }
.upload-clear-btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 0;
    font-size: 12px;
    cursor: pointer;
}
.upload-clear-btn:hover { color: #fca5a5; }
.upload-overall-progress {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.upload-overall-bar {
    height: 100%;
    width: 0%;
    background: var(--fj-primary, #08e981);
    transition: width 0.3s ease;
}
.upload-overall-bar.success { background: #22c55e; }
.upload-overall-bar.pending-review { background: #f59e0b; }
.upload-overall-bar.error { background: #ef4444; }
.upload-overall-bar.warning { background: #f59e0b; }

/* File queue list */
.upload-file-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; }
.file-item {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.08));
    transition: border-color 0.15s;
}
.file-item.success { border-color: rgba(34, 197, 94, 0.4); }
.file-item.pending-review { border-color: rgba(245, 158, 11, 0.4); }
.file-item.error { border-color: rgba(239, 68, 68, 0.4); }
.file-item-thumb {
    width: 44px; height: 44px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--fj-secondary, rgba(255,255,255,0.04));
    display: grid; place-items: center;
    color: rgba(255, 255, 255, 0.55);
}
.file-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-item-info { flex: 1; min-width: 0; }
.file-item-name { color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item-meta { color: rgba(255, 255, 255, 0.5); font-size: 11px; margin-top: 1px; }
.file-item-status { width: 22px; text-align: center; flex-shrink: 0; }
.file-item-status.success { color: #22c55e; }
.file-item-status.pending-review { color: #f59e0b; }
.file-item-status.error { color: #ef4444; cursor: help; }
.file-item-status.pending { color: rgba(255, 255, 255, 0.5); }
.file-item-status.uploading { color: var(--fj-primary, #08e981); }
.file-item-remove {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    border: 0;
    display: grid; place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 11px;
}
.file-item-remove:hover { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.file-item-spinner {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(8, 233, 129, 0.25);
    border-top-color: var(--fj-primary, #08e981);
    animation: file-item-spin 0.8s linear infinite;
}
@keyframes file-item-spin { to { transform: rotate(360deg); } }
.file-item-progress {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    overflow: hidden;
}
.file-item-progress-bar {
    height: 100%;
    background: var(--fj-primary, #08e981);
    transition: width 0.15s linear;
}

/* Footer */
.upload-modal-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--fj-tertiary, rgba(255,255,255,0.08));
    gap: 12px;
    flex-wrap: wrap;
}
.upload-summary { color: rgba(255, 255, 255, 0.6); font-size: 13px; }
.upload-modal-actions { display: flex; gap: 8px; }
.upload-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px; font-weight: 600;
    border: 0;
    cursor: pointer;
}
.upload-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.upload-btn-primary {
    background: var(--fj-primary, #08e981);
    color: var(--fj-bg, #090811);
}
.upload-btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.upload-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.1));
}
.upload-btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

/* Prohibited-content sub-modal */
.prohibited-content-modal-overlay { z-index: 110; }
.prohibited-content-modal {
    width: 100%; max-width: 480px;
    background: var(--fj-bg, #090811);
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.08));
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.6);
}
.prohibited-content-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--fj-tertiary, rgba(255,255,255,0.08));
}
.prohibited-content-modal-title { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 16px; }
.prohibited-content-modal-title i { color: #f59e0b; }
.prohibited-content-modal-close {
    background: transparent; border: 0;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer; padding: 6px; border-radius: 6px;
}
.prohibited-content-modal-close:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.prohibited-content-modal-body { padding: 16px 18px; color: rgba(255, 255, 255, 0.85); font-size: 13px; }
.prohibited-list { list-style: none; padding: 0; margin: 12px 0 0 0; display: flex; flex-direction: column; gap: 8px; }
.prohibited-list li { display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.prohibited-list li i { color: #ef4444; margin-top: 2px; flex-shrink: 0; }
.prohibited-list strong { color: #fff; }
.prohibited-content-modal-footer { padding: 12px 18px 16px; display: flex; justify-content: flex-end; }
.prohibited-btn-primary {
    padding: 8px 16px;
    background: var(--fj-primary, #08e981);
    color: var(--fj-bg, #090811);
    border: 0; border-radius: 10px;
    font-weight: 600; font-size: 13px;
    cursor: pointer;
}
.prohibited-btn-primary:hover { filter: brightness(1.08); }

/* ============================================================
   LoRA Training page (Sessions / My LoRAs / History tabs)
   ============================================================ */
.lora-tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    background: transparent;
    color: var(--fj-body, rgba(255,255,255,0.6));
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.lora-tab:hover { color: #fff; }
.lora-tab.active {
    color: var(--fj-primary, #08e981);
    border-bottom-color: var(--fj-primary, #08e981);
    font-weight: 600;
}
.lora-tab i { font-size: 12px; }

/* Loading + empty states (shared across all 3 tabs) */
.lora-loading {
    padding: 30px 0;
    text-align: center;
    color: var(--fj-body, rgba(255,255,255,0.55));
    font-size: 13px;
}
.lora-empty {
    text-align: center;
    padding: 50px 24px;
    color: var(--fj-body, rgba(255,255,255,0.6));
}
.lora-empty-icon {
    width: 72px; height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(8,233,129,0.08);
    color: var(--fj-primary, #08e981);
    display: grid; place-items: center;
    font-size: 30px;
}
.lora-empty h3 { color: #fff; font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.lora-empty p { font-size: 13px; line-height: 1.6; max-width: 360px; margin: 0 auto; }

/* Generic buttons used inside cards */
.lora-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.1));
    background: rgba(255,255,255,0.04);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.lora-btn:hover { background: rgba(255,255,255,0.08); }
.lora-btn-primary {
    background: var(--fj-primary, #08e981);
    color: var(--fj-bg, #090811);
    border-color: var(--fj-primary, #08e981);
    font-weight: 600;
}
.lora-btn-primary:hover { filter: brightness(1.08); background: var(--fj-primary, #08e981); }
.lora-btn-secondary { background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.85); }

/* Sessions tab — session cards */
.lora-session-card {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.08));
}
.lora-session-info {
    display: flex; flex-direction: column; gap: 2px;
    min-width: 0; flex: 1;
}
.lora-session-actions {
    display: flex; align-items: center; gap: 6px;
    flex-shrink: 0;
}

/* My LoRAs tab — LoRA cards */
.lora-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.08));
    transition: border-color 0.15s, background 0.15s;
}
.lora-card:hover { border-color: rgba(8,233,129,0.3); background: rgba(255,255,255,0.04); }
.lora-card-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(8,233,129,0.12);
    color: var(--fj-primary, #08e981);
    display: grid; place-items: center;
    font-size: 16px;
    flex-shrink: 0;
}
.lora-card-body { flex: 1; min-width: 0; }
.lora-card-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.lora-card-meta {
    color: var(--fj-body, rgba(255,255,255,0.55));
    font-size: 12px;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.lora-card-sep { color: rgba(255,255,255,0.2); }
.lora-trigger {
    color: #fb923c;
    background: rgba(251,146,60,0.1);
    padding: 1px 8px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
}

/* History tab — job cards (collapsible) */
.lora-job-card {
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.08));
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.lora-job-card:hover { background: rgba(255,255,255,0.04); }
.lora-job-row {
    display: flex; align-items: center; gap: 12px;
}
.lora-job-meta {
    color: var(--fj-body, rgba(255,255,255,0.55));
    font-size: 12px;
    margin-top: 3px;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.lora-state-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid;
}
.lora-job-detail {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--fj-tertiary, rgba(255,255,255,0.06));
}
.lora-job-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 4px 16px;
    font-size: 12px;
}
.lora-job-key { color: var(--fj-body, rgba(255,255,255,0.5)); }
.lora-job-val { color: rgba(255,255,255,0.85); }
.lora-progress {
    height: 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
}
.lora-progress-fill {
    height: 100%;
    background: var(--fj-primary, #08e981);
    transition: width 0.3s ease;
}

/* Drive page — folder list with inline action buttons */
.drv-folder-row {
    position: relative;
}
.drv-folder-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    background: transparent;
    color: #fff; font-size: 13px; font-weight: 500;
    border: 0;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.drv-folder-item:hover { background: rgba(255, 255, 255, 0.04); }
.drv-folder-item.active {
    background: rgba(8, 233, 129, 0.1);
    color: var(--fj-primary, #08e981);
}
.drv-folder-item.active .fa-folder { color: var(--fj-primary, #08e981); }

.drv-folder-actions {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 2px;
}
.drv-folder-action {
    width: 24px; height: 24px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    color: rgba(255, 255, 255, 0.85);
    display: grid; place-items: center;
    border: 0;
    cursor: pointer;
}
.drv-folder-action:hover { background: var(--fj-primary, #08e981); color: var(--fj-bg, #090811); }
.drv-folder-action.drv-folder-delete:hover { background: #ef4444; color: #fff; }

/* Drag-over highlight for the drive body + upload-modal drop zone */
.drv-drag-over {
    outline: 2px dashed var(--fj-primary, #08e981);
    outline-offset: -4px;
    background: rgba(8, 233, 129, 0.04);
}

/* Settings page — toggle switch + chat-preview text variants */
.st-toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 40px; height: 22px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}
.st-toggle::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.2s ease;
}
.st-toggle:checked {
    background: var(--fj-primary, #08e981);
}
.st-toggle:checked::after { left: 20px; }

/* Chat preview text variants — mirror the source's class scheme */
.chat-preview-text { font-size: 14px; line-height: 1.55; transition: text-shadow 0.15s, font-size 0.15s; }
.chat-preview-text.size-xsmall { font-size: 12px; }
.chat-preview-text.size-small  { font-size: 13px; }
.chat-preview-text.size-large  { font-size: 16px; }
.chat-preview-text.size-xlarge { font-size: 18px; }
.chat-preview-text.font-system   { font-family: system-ui, -apple-system, Segoe UI, sans-serif; }
.chat-preview-text.font-roboto   { font-family: Roboto, system-ui, sans-serif; }
.chat-preview-text.font-opensans { font-family: 'Open Sans', system-ui, sans-serif; }
.chat-preview-text.font-lato     { font-family: Lato, system-ui, sans-serif; }
.chat-preview-text.font-mono     { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.chat-preview-text.shadow-subtle  { text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.chat-preview-text.shadow-medium  { text-shadow: 0 2px 4px rgba(0,0,0,0.55); }
.chat-preview-text.shadow-intense { text-shadow: 0 3px 8px rgba(0,0,0,0.75), 0 1px 2px rgba(0,0,0,0.5); }

/* Feedback page — drag-over highlight on the upload drop zone */
.fb-drop.drag-over {
    border-color: var(--fj-primary, #08e981);
    background: rgba(8, 233, 129, 0.07);
}

/* ============================================================
   Takedown page (report flow + status lookup)
   ============================================================ */
.td-page { max-width: 720px; margin: 0 auto; }
.td-page h1 { font-size: 2rem; font-weight: 800; color: #fff; margin: 0 0 0.5rem; }
.td-page .td-lede { color: var(--fj-body, rgba(255,255,255,0.6)); margin-bottom: 1.5rem; }

.td-type-cards {
    display: grid; gap: 12px;
    grid-template-columns: 1fr;
    margin: 20px 0 24px;
}
@media (min-width: 640px) { .td-type-cards { grid-template-columns: repeat(3, 1fr); } }

.td-type-card {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--fj-secondary, rgba(255,255,255,0.04));
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.08));
    color: #fff; text-align: left; cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.td-type-card:hover { border-color: rgba(8, 233, 129, 0.4); }
.td-type-card.active {
    border-color: var(--fj-primary, #08e981);
    background: rgba(8, 233, 129, 0.06);
}
.td-type-radio {
    width: 18px; height: 18px; flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    margin-top: 2px;
    position: relative;
}
.td-type-card.active .td-type-radio { border-color: var(--fj-primary, #08e981); }
.td-type-card.active .td-type-radio::after {
    content: ''; position: absolute; inset: 3px;
    border-radius: 50%; background: var(--fj-primary, #08e981);
}
.td-type-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.td-type-label { font-weight: 600; font-size: 14px; }
.td-type-desc { font-size: 12px; color: var(--fj-body, rgba(255,255,255,0.55)); }

/* Step indicator */
.td-steps {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 18px; flex-wrap: wrap;
}
.td-step {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--fj-body, rgba(255,255,255,0.5));
}
.td-step-num {
    width: 22px; height: 22px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.5);
    font-weight: 600; font-size: 11px;
}
.td-step.active { color: #fff; }
.td-step.active .td-step-num { background: var(--fj-primary, #08e981); color: var(--fj-bg, #090811); }
.td-step.done { color: var(--fj-primary, #08e981); }
.td-step.done .td-step-num { background: rgba(8, 233, 129, 0.15); color: var(--fj-primary, #08e981); }
.td-step-sep { flex: 1; max-width: 24px; height: 1px; background: rgba(255,255,255,0.1); }

/* Form card */
.td-form-card {
    padding: 24px;
    border-radius: 16px;
    background: var(--fj-secondary, rgba(255,255,255,0.04));
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.08));
}
.td-form-card h2 { font-size: 1.25rem; font-weight: 700; color: #fff; margin: 0 0 4px; }
.td-form-hint { color: var(--fj-body, rgba(255,255,255,0.6)); font-size: 13px; margin: 0 0 16px; }
.td-form-hint strong { color: #fff; }
.td-countdown { color: var(--fj-primary, #08e981); font-variant-numeric: tabular-nums; }

.td-field { margin-bottom: 14px; }
.td-field label { display: block; font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.7); margin-bottom: 6px; }
.td-input, .td-select, .td-textarea {
    width: 100%;
    background: var(--fj-bg, #090811);
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.1));
    border-radius: 10px;
    padding: 10px 12px;
    color: #fff; font-size: 14px;
    outline: 0;
    transition: border-color 0.15s, background 0.15s;
}
.td-input:focus, .td-select:focus, .td-textarea:focus {
    border-color: var(--fj-primary, #08e981);
}
.td-textarea { resize: vertical; min-height: 96px; }

/* OTP */
.td-otp { display: flex; gap: 8px; justify-content: center; margin: 12px 0 18px; }
.td-otp input {
    width: 44px; height: 52px;
    text-align: center; font-size: 22px; font-weight: 700;
    background: var(--fj-bg, #090811);
    color: #fff;
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.1));
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    outline: 0;
}
.td-otp input:focus { border-color: var(--fj-primary, #08e981); }

/* Attestation checkboxes */
.td-attest {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; margin-bottom: 12px;
    background: rgba(255,255,255,0.025);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}
.td-attest input[type=checkbox] { margin-top: 3px; accent-color: var(--fj-primary, #08e981); }
.td-attest label { font-size: 13px; color: rgba(255,255,255,0.85); line-height: 1.5; }

/* Honeypot */
.td-honeypot { position: absolute; left: -9999px; height: 0; width: 0; overflow: hidden; }

/* Captcha block */
.td-captcha { margin: 10px 0 18px; min-height: 70px; }

/* Buttons */
.td-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%;
    padding: 11px 18px;
    background: var(--fj-primary, #08e981);
    color: var(--fj-bg, #090811);
    border: 0; border-radius: 10px;
    font-weight: 600; font-size: 14px;
    cursor: pointer;
    transition: filter 0.15s;
}
.td-btn:hover { filter: brightness(1.08); }
.td-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
.td-btn-secondary { background: rgba(255,255,255,0.06); color: #fff; }
.td-btn-link {
    display: block; width: 100%;
    margin-top: 8px;
    padding: 8px;
    background: transparent; border: 0;
    color: rgba(255,255,255,0.7);
    text-align: center; font-size: 13px;
    cursor: pointer;
}
.td-btn-link:hover { color: #fff; }
.td-btn-link:disabled { opacity: 0.5; cursor: not-allowed; }

/* Messages */
.td-error {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    font-size: 13px;
}

/* Success card */
.td-success-card {
    padding: 32px 24px;
    border-radius: 16px;
    background: var(--fj-secondary, rgba(255,255,255,0.04));
    border: 1px solid rgba(8, 233, 129, 0.3);
    text-align: center;
}
.td-check {
    width: 56px; height: 56px; margin: 0 auto 16px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(8, 233, 129, 0.15);
    color: var(--fj-primary, #08e981);
    font-size: 28px;
}
.td-success-card h2 { font-size: 1.5rem; color: #fff; margin-bottom: 8px; }
.td-success-card p { color: var(--fj-body, rgba(255,255,255,0.7)); font-size: 14px; line-height: 1.6; }
.td-report-id {
    display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: 16px 0; padding: 10px 14px;
    background: rgba(255,255,255,0.04); border-radius: 10px;
    font-size: 13px; color: rgba(255,255,255,0.7);
}
.td-report-id strong {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #fff;
}
.td-info { font-size: 13px; color: var(--fj-body, rgba(255,255,255,0.55)); }
.td-success-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.td-success-actions .td-btn { width: auto; padding: 10px 18px; }

/* Status result grid */
.td-status-result {
    margin-top: 18px; padding: 20px;
    background: var(--fj-secondary, rgba(255,255,255,0.04));
    border: 1px solid var(--fj-tertiary, rgba(255,255,255,0.08));
    border-radius: 14px;
}
.td-status-grid { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.td-status-grid dt { color: rgba(255,255,255,0.55); font-size: 13px; }
.td-status-grid dd { color: #fff; font-size: 13px; margin: 0; }

/* ============================================================
   Release Notes page — typography for fetched HTML content
   ============================================================ */
.release-notes-page h2,
.release-notes-page h3 { color: #fff; font-weight: 700; margin: 18px 0 8px; }
.release-notes-page h2 { font-size: 18px; }
.release-notes-page h3 { font-size: 15px; }
.release-notes-page h2:first-child,
.release-notes-page h3:first-child { margin-top: 0; }
.release-notes-page ul { padding-left: 1.25rem; margin: 4px 0 14px; }
.release-notes-page li { margin-bottom: 4px; list-style: disc; }
.release-notes-page strong { color: #fff; }
.release-notes-page code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    background: rgba(255,255,255,0.06);
    padding: 1px 5px;
    border-radius: 4px;
}
.release-notes-page a { color: var(--fj-primary); }

/* ============================================================
   Chat landing — ambient background
   ============================================================ */
.cl-ambient {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(55% 45% at 12% 18%, rgba(8, 233, 129, 0.10), transparent 70%),
        radial-gradient(45% 40% at 88% 82%, rgba(8, 222, 233, 0.08), transparent 70%);
}

/* ============================================================
   Generate page — ambient background
   ============================================================ */
.gen-ambient {
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(60% 50% at 15% 20%, rgba(8, 233, 129, 0.10), transparent 70%),
        radial-gradient(50% 40% at 90% 80%, rgba(8, 233, 222, 0.10), transparent 70%);
}

/* ============================================================
   Generate2 mockup — indigo cinematic theme (scoped to .g2)
   ============================================================ */
.g2 {
    --g2-bg: #08080c;
    --g2-panel: rgba(255,255,255,0.012);
    --g2-border: rgba(255,255,255,0.05);
    --g2-border-soft: rgba(255,255,255,0.03);
    --g2-text: #fff;
    --g2-text-2: #888;
    --g2-text-3: #555;
    --g2-text-4: #444;
    --g2-text-5: #333;
    --g2-accent: #6366f1;
    --g2-accent-2: #7c3aed;
    --g2-accent-soft: rgba(99,102,241,0.15);
    font-family: 'Inter', sans-serif;
    color: var(--g2-text);
    background: var(--g2-bg);
    min-height: calc(100vh - 64px);
    position: relative;
    overflow: hidden;
}
.g2 *, .g2 *::before, .g2 *::after { box-sizing: border-box; }
.g2 .mono { font-family: 'JetBrains Mono', monospace; }

/* Ambient orbs */
.g2-ambient { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.g2-orb { position: absolute; border-radius: 50%; filter: blur(140px); }
.g2-orb--1 { width: 480px; height: 480px; background: rgba(99,102,241,0.05); top: -120px; left: -120px; }
.g2-orb--2 { width: 520px; height: 520px; background: rgba(168,85,247,0.03); bottom: -180px; right: -120px; }

/* Layout */
.g2-layout { position: relative; z-index: 1; display: flex; min-height: calc(100vh - 64px); }
.g2-panel { width: 420px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--g2-panel); border-right: 1px solid var(--g2-border-soft); }
.g2-panel__scroll { flex: 1; overflow-y: auto; padding: 22px 22px 6px; }
.g2-panel__footer { padding: 14px 22px 20px; background: linear-gradient(to top, var(--g2-bg) 60%, transparent); position: sticky; bottom: 0; }
.g2-results { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.g2-splitter { width: 1px; background: var(--g2-border-soft); position: relative; }
.g2-splitter__toggle {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 22px; height: 44px; border-radius: 6px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--g2-border);
    color: var(--g2-text-3); display: grid; place-items: center; cursor: pointer;
}
.g2-splitter__toggle:hover { color: var(--g2-text); }

/* Workflow card */
.g2-panel__header { padding: 18px 22px; border-bottom: 1px solid var(--g2-border-soft); }
.g2-workflow {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: 12px;
    background: rgba(255,255,255,0.015); border: 1px solid var(--g2-border);
    cursor: pointer;
}
.g2-workflow:hover { background: rgba(255,255,255,0.025); }
.g2-workflow__icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: linear-gradient(135deg, var(--g2-accent), var(--g2-accent-2));
    display: grid; place-items: center; color: #fff; flex-shrink: 0;
}
.g2-workflow__icon .material-icons-outlined { font-size: 20px; }
.g2-workflow__info { flex: 1; min-width: 0; }
.g2-workflow__name { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; color: #fff; }
.g2-workflow__tags { display: flex; gap: 5px; margin-top: 3px; }
.g2-workflow__tag {
    font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--g2-text-3); background: rgba(255,255,255,0.03);
    padding: 2px 6px; border-radius: 4px;
}
.g2-workflow__tag--accent { color: #a5b4fc; background: var(--g2-accent-soft); }
.g2-workflow__arrow { color: var(--g2-text-4); font-size: 18px; }

/* Labels */
.g2-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
    color: #3a3a44; display: flex; align-items: center; gap: 6px;
    margin: 18px 0 10px;
}
.g2-label__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--g2-accent); }

/* Prompt */
.g2-prompt {
    position: relative;
    border-radius: 4px 16px 16px 4px;
    background: rgba(255,255,255,0.015);
    border: 1px solid var(--g2-border);
    border-left: 3px solid rgba(99,102,241,0.4);
    transition: all 0.15s ease;
}
.g2-prompt:focus-within {
    background: rgba(99,102,241,0.015);
    border-left-color: var(--g2-accent);
}
.g2-prompt__textarea {
    width: 100%; min-height: 120px; resize: vertical;
    background: transparent; border: 0; outline: 0;
    font-family: 'Inter', sans-serif; color: var(--g2-text);
    font-size: 15.5px; line-height: 1.65; letter-spacing: 0.01em;
    padding: 14px 14px 14px 12px;
}
.g2-prompt__textarea::placeholder { color: var(--g2-text-4); }
.g2-prompt__footer { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 0; }
.g2-prompt__tools { display: flex; gap: 2px; }
.g2-prompt__tool {
    width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent;
    color: var(--g2-text-3); cursor: pointer; display: grid; place-items: center;
}
.g2-prompt__tool:hover { color: var(--g2-text); background: rgba(255,255,255,0.03); }
.g2-prompt__tool .material-icons-outlined { font-size: 18px; }
.g2-prompt__chars { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: #2a2a30; }

/* Negative prompt toggle */
.g2-neg-toggle {
    margin-top: 12px;
    width: 100%; padding: 9px 12px; border-radius: 10px;
    background: transparent; color: var(--g2-text-3);
    border: 1px dashed var(--g2-border);
    font-size: 12px; font-weight: 500; cursor: pointer;
    text-align: left;
}
.g2-neg-toggle:hover { color: #fca5a5; border-color: rgba(252,165,165,0.25); }

/* Output: dimensions + count */
.g2-divider { height: 1px; background: var(--g2-border-soft); margin: 20px 0 4px; }
.g2-dims {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; border-radius: 12px;
    background: rgba(255,255,255,0.015); border: 1px solid var(--g2-border-soft);
}
.g2-dims__preview {
    width: 26px; height: 26px; flex-shrink: 0;
    border-radius: 4px; border: 1px solid var(--g2-accent);
    background: rgba(99,102,241,0.15);
}
.g2-dims__field { display: flex; align-items: center; gap: 6px; flex: 1; }
.g2-dims__label { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--g2-text-4); text-transform: uppercase; }
.g2-dims__select {
    flex: 1; background: transparent; border: 0; outline: 0;
    font-family: 'JetBrains Mono', monospace; color: var(--g2-text); font-size: 16px;
    text-align: center; cursor: pointer; appearance: none;
}
.g2-dims__select option { background: var(--g2-bg); color: var(--g2-text); }
.g2-dims__x { color: var(--g2-text-4); font-size: 14px; }

.g2-count {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 14px; padding: 4px 0;
}
.g2-count__label { font-size: 11px; font-weight: 600; color: var(--g2-text-3); text-transform: uppercase; letter-spacing: 0.1em; }
.g2-count__pills { display: flex; gap: 6px; }
.g2-count__pill {
    width: 42px; height: 36px; border-radius: 10px;
    font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 500;
    background: rgba(255,255,255,0.02); color: var(--g2-text-3);
    border: 1px solid var(--g2-border-soft); cursor: pointer;
}
.g2-count__pill:hover { color: var(--g2-text); }
.g2-count__pill.active {
    background: var(--g2-accent-soft); color: #a5b4fc;
    border-color: rgba(99,102,241,0.3);
}

/* Folder */
.g2-folder {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px; border-radius: 10px;
    background: rgba(255,255,255,0.015); border: 1px solid var(--g2-border-soft);
    cursor: pointer; margin-top: 16px;
}
.g2-folder:hover { background: rgba(255,255,255,0.025); }
.g2-folder .material-icons-outlined { color: var(--g2-text-3); font-size: 18px; }
.g2-folder__name { font-size: 13px; color: var(--g2-text); }

/* Collapsible groups */
.g2-group {
    margin-top: 12px; border: 1px solid rgba(255,255,255,0.025);
    border-radius: 12px; overflow: hidden;
}
.g2-group__header {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 14px; cursor: pointer;
    background: rgba(255,255,255,0.012);
}
.g2-group__icon { color: var(--g2-text-3); }
.g2-group__icon .material-icons-outlined { font-size: 18px; }
.g2-group__title { font-size: 13px; font-weight: 500; color: var(--g2-text); flex: 1; }
.g2-group__count {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    padding: 2px 7px; border-radius: 6px;
    background: rgba(255,255,255,0.025); color: var(--g2-text-4);
}
.g2-group__chev { color: var(--g2-text-4); transition: transform 0.15s; }
.g2-group__chev .material-icons-outlined { font-size: 18px; }
.g2-group.open .g2-group__chev { transform: rotate(90deg); }
.g2-group.open .g2-group__header { border-bottom: 1px solid var(--g2-border-soft); }
.g2-group__body { display: none; padding: 14px; gap: 16px; flex-direction: column; }
.g2-group.open .g2-group__body { display: flex; }

.g2-field__label { font-size: 11px; font-weight: 600; color: #555; margin-bottom: 8px; }
.g2-slider { display: flex; align-items: center; gap: 10px; }
.g2-slider input[type=range] { flex: 1; accent-color: var(--g2-accent); height: 3px; }
.g2-slider__value {
    width: 52px; height: 28px; border-radius: 6px;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.04);
    font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--g2-text);
    display: grid; place-items: center;
}
.g2-seed { display: flex; gap: 8px; }
.g2-seed input {
    flex: 1; height: 34px; padding: 0 12px;
    border-radius: 8px; border: 1px solid var(--g2-border-soft);
    background: rgba(255,255,255,0.02); color: var(--g2-text);
    font-family: 'JetBrains Mono', monospace; font-size: 13px;
    outline: 0;
}
.g2-seed input::placeholder { font-style: italic; color: var(--g2-text-4); }
.g2-seed__btn {
    width: 34px; height: 34px; border-radius: 8px;
    background: rgba(255,255,255,0.02); border: 1px solid var(--g2-border-soft);
    color: var(--g2-text-3); cursor: pointer; display: grid; place-items: center;
}
.g2-seed__btn:hover { color: #a5b4fc; border-color: rgba(99,102,241,0.3); }
.g2-seed__btn .material-icons-outlined { font-size: 18px; }

/* Generate button */
.g2-generate {
    width: 100%; padding: 14px 18px; border-radius: 14px; border: 0;
    background: linear-gradient(135deg, var(--g2-accent), var(--g2-accent-2), var(--g2-accent));
    background-size: 200% 100%;
    color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 4px 24px rgba(99,102,241,0.2), 0 0 0 1px rgba(99,102,241,0.1), inset 0 1px 0 rgba(255,255,255,0.08);
    transition: background-position 0.3s ease;
}
.g2-generate:hover { background-position: 100% 0; }
.g2-generate .material-icons-outlined { font-size: 18px; }
.g2-generate__shortcut {
    margin-left: 8px; padding: 2px 6px; border-radius: 4px;
    background: rgba(255,255,255,0.08); font-family: 'JetBrains Mono', monospace; font-size: 11px;
}

/* Results */
.g2-results__tabs {
    display: flex; gap: 4px; padding: 14px 22px;
    border-bottom: 1px solid var(--g2-border-soft);
}
.g2-results__tab {
    padding: 8px 14px; border-radius: 8px; border: 0; background: transparent;
    color: var(--g2-text-3); font-size: 13px; font-weight: 500; cursor: pointer;
}
.g2-results__tab:hover { color: var(--g2-text); }
.g2-results__tab.active { color: #a5b4fc; background: var(--g2-accent-soft); }
.g2-results__pane { flex: 1; overflow-y: auto; padding: 18px 22px; }

.g2-masonry { columns: 5; column-gap: 9px; }
@media (max-width: 1400px) { .g2-masonry { columns: 4; } }
@media (max-width: 1100px) { .g2-masonry { columns: 3; } }
@media (max-width: 768px)  { .g2-masonry { columns: 2; } }
.g2-card {
    position: relative; break-inside: avoid; margin-bottom: 9px;
    border-radius: 10px; overflow: hidden; cursor: pointer;
}
.g2-card__img { width: 100%; display: block; }
.g2-card__dim {
    position: absolute; top: 8px; left: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 8px;
    padding: 3px 6px; border-radius: 4px;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(8px);
    color: rgba(255,255,255,0.8); letter-spacing: 0.05em;
}
.g2-card__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent 60%);
    opacity: 0; transition: opacity 0.15s;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 10px; gap: 8px;
}
.g2-card:hover .g2-card__overlay { opacity: 1; }
.g2-card__prompt {
    font-size: 10px; line-height: 1.4; color: rgba(255,255,255,0.85);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.g2-card__actions { display: flex; gap: 5px; }
.g2-card__btn {
    padding: 5px 9px; border-radius: 6px; border: 0;
    background: rgba(255,255,255,0.1); backdrop-filter: blur(8px);
    color: #fff; font-size: 10px; font-weight: 500; cursor: pointer;
    display: inline-flex; align-items: center; gap: 4px;
}
.g2-card__btn:hover { background: var(--g2-accent); }
.g2-card__btn .material-icons-outlined { font-size: 13px; }
.g2-card__btn--icon { padding: 5px 6px; }

.g2-card--progress {
    border: 1.5px dashed rgba(99,102,241,0.4); aspect-ratio: 2/3;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    background: rgba(99,102,241,0.03);
}
.g2-card__spinner {
    width: 32px; height: 32px; border-radius: 50%;
    border: 2px solid rgba(99,102,241,0.2); border-top-color: var(--g2-accent);
    animation: g2-spin 0.9s linear infinite;
}
@keyframes g2-spin { to { transform: rotate(360deg); } }
.g2-card__progress-label { font-size: 11px; color: var(--g2-text-3); }
.g2-card__bar {
    width: 70%; height: 3px; border-radius: 99px;
    background: rgba(255,255,255,0.06); overflow: hidden;
}
.g2-card__bar-fill { width: 35%; height: 100%; background: var(--g2-accent); border-radius: 99px; }

@media (max-width: 1024px) {
    .g2-layout { flex-direction: column; }
    .g2-panel { width: 100%; }
    .g2-splitter { display: none; }
}

/* ============================================================
   My Library
   ============================================================ */
.library-container {
    color: #e7e7ea;
    min-height: 60vh;
}
.library-toolbar {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}
.library-toolbar.has-selection {
    grid-template-columns: auto 1fr auto;
}
.library-toolbar-left, .library-toolbar-right {
    display: flex; align-items: center; gap: 8px;
}
.library-search {
    position: relative; flex: 1; min-width: 0;
    grid-column: 1 / 2;
}
.library-search-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 36px 10px 36px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}
.library-search-input:focus {
    border-color: rgba(8,233,129,0.5);
    box-shadow: 0 0 0 3px rgba(8,233,129,0.1);
}
.library-search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,0.4);
    pointer-events: none;
}
.library-search-clear {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: transparent; border: 0; color: rgba(255,255,255,0.5);
    padding: 6px 8px; cursor: pointer; border-radius: 6px;
}
.library-search-clear:hover { background: rgba(255,255,255,0.06); color: #fff; }

.library-folder-dropdown { position: relative; }
.library-folder-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 9px 14px;
    color: #fff; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: background 0.15s;
}
.library-folder-toggle:hover { background: rgba(255,255,255,0.08); }
.library-folder-toggle i.fa-folder { color: #08e981; }
.library-folder-menu {
    position: absolute; left: 0; top: calc(100% + 6px);
    min-width: 260px; max-height: 420px; overflow-y: auto;
    background: #15171c;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.5);
    display: none; z-index: 50;
}
.library-folder-menu.show { display: block; }
.library-folder-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 11px; border-radius: 8px;
    color: #d6d7db; font-size: 13px; cursor: pointer;
    transition: background 0.12s;
}
.library-folder-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.library-folder-item.active { background: rgba(8,233,129,0.12); color: #fff; }
.library-folder-item i { color: #8c8c95; width: 16px; text-align: center; }
.library-folder-item.active i, .library-folder-item:hover i { color: #08e981; }
.library-folder-item-name { flex: 1; }
.library-folder-divider {
    height: 1px; background: rgba(255,255,255,0.08); margin: 6px 4px;
}

.library-action-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
}
.library-action-btn.primary {
    background: #08e981; color: #000; border-color: #08e981;
}
.library-action-btn.primary:hover { background: #06d676; }
.library-action-btn.secondary {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
    color: #fff;
}
.library-action-btn.secondary:hover { background: rgba(255,255,255,0.08); }
.library-action-btn.danger {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.3);
    color: #fca5a5;
}
.library-action-btn.danger:hover { background: rgba(239,68,68,0.2); color: #fff; }
.library-action-btn span { white-space: nowrap; }
.library-select-mode-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 10px;
    padding: 9px 12px;
    cursor: pointer;
    transition: all 0.15s;
}
.library-select-mode-btn:hover { background: rgba(255,255,255,0.08); }
.library-select-mode-btn.active {
    background: rgba(8,233,129,0.15);
    border-color: rgba(8,233,129,0.4);
    color: #08e981;
}

.library-selection-info {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 12px;
    background: rgba(8,233,129,0.1);
    border: 1px solid rgba(8,233,129,0.3);
    border-radius: 10px;
}
.library-selection-count {
    color: #08e981; font-size: 13px; font-weight: 600;
}
.library-selection-clear {
    background: transparent; border: 0; color: #08e981;
    font-size: 12px; cursor: pointer; padding: 4px;
    text-decoration: underline;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.library-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.library-item:hover { transform: translateY(-2px); }
.library-item.selected {
    box-shadow: 0 0 0 3px #08e981, 0 8px 20px rgba(8,233,129,0.2);
}
.library-item-media {
    position: absolute; inset: 0;
    background: #0a0b0e;
}
.library-item-media img {
    width: 100%; height: 100%; object-fit: cover;
}
.library-item-placeholder {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; color: rgba(255,255,255,0.3);
    font-size: 30px;
}
.library-item-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.7) 100%);
    opacity: 0; transition: opacity 0.15s;
    display: flex; align-items: flex-end; justify-content: flex-end;
    gap: 4px; padding: 8px;
}
.library-item:hover .library-item-overlay { opacity: 1; }
.library-item-action {
    width: 30px; height: 30px;
    border-radius: 8px; border: 0;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(6px);
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    transition: background 0.12s;
}
.library-item-action:hover { background: rgba(8,233,129,0.7); }
.library-item-badge {
    position: absolute; top: 8px; left: 8px;
    background: rgba(0,0,0,0.6); color: #fff;
    font-size: 10px; font-weight: 600;
    padding: 3px 6px; border-radius: 5px;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.library-item-note-badge {
    position: absolute; top: 8px; right: 8px;
    width: 22px; height: 22px;
    background: rgba(0,0,0,0.6); color: #fbbf24;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px;
}
.library-item-checkbox {
    position: absolute; top: 8px; left: 8px;
    width: 22px; height: 22px;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
    border-radius: 50%;
    display: none; align-items: center; justify-content: center;
    z-index: 2;
}
.library-item-checkbox input { width: 14px; height: 14px; accent-color: #08e981; cursor: pointer; }
.library-container.select-mode .library-item-checkbox,
.library-item.selected .library-item-checkbox {
    display: flex;
}
.library-item.selected .library-item-checkbox {
    background: #08e981;
}

.library-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: lib-shimmer 1.4s infinite;
    border-radius: 10px;
}
@keyframes lib-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.library-empty, .library-error {
    grid-column: 1 / -1;
    padding: 60px 20px; text-align: center;
    color: rgba(255,255,255,0.6);
}
.library-empty i, .library-error i {
    font-size: 48px; color: rgba(255,255,255,0.2);
    margin-bottom: 16px; display: block;
}
.library-empty h3, .library-error h3 {
    color: #fff; font-size: 18px; font-weight: 600;
    margin-bottom: 8px;
}
.library-empty p, .library-error p {
    font-size: 14px; margin-bottom: 16px;
}
.library-empty .library-action-btn { display: inline-flex; text-decoration: none; }

.library-load-trigger { grid-column: 1 / -1; height: 20px; }
.library-loading {
    grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 24px 0; color: rgba(255,255,255,0.6); font-size: 13px;
}
.library-loading-spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.15);
    border-top-color: #08e981;
    border-radius: 50%;
    animation: lib-spin 0.85s linear infinite;
}
@keyframes lib-spin { to { transform: rotate(360deg); } }

/* ============================================================
   Library Modals (Download / Folder picker / Create folder)
   ============================================================ */
.library-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 16px;
    animation: lib-fade 0.18s ease-out;
}
@keyframes lib-fade { from { opacity: 0; } to { opacity: 1; } }
.library-modal {
    background: #16181d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    width: 100%; max-width: 460px;
    max-height: 90vh; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    display: flex; flex-direction: column;
    animation: lib-pop 0.2s ease-out;
}
@keyframes lib-pop { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.library-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.library-modal-title {
    color: #fff; font-size: 16px; font-weight: 600; margin: 0;
}
.library-modal-close {
    background: transparent; border: 0; color: rgba(255,255,255,0.5);
    cursor: pointer; padding: 6px; border-radius: 6px;
    font-size: 14px;
}
.library-modal-close:hover { background: rgba(255,255,255,0.06); color: #fff; }
.library-modal-body {
    padding: 20px; overflow-y: auto; flex: 1;
}
.library-modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.library-modal label {
    color: #d6d7db; font-size: 13px; font-weight: 500;
    display: block; margin-bottom: 6px;
}
.library-modal-section { margin-bottom: 16px; }
.library-modal-section:last-child { margin-bottom: 0; }
.library-modal-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 9px 12px; color: #fff; font-size: 13px;
    outline: none;
}
.library-modal-input:focus { border-color: rgba(8,233,129,0.5); }
.library-modal-radio {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; cursor: pointer;
    color: #d6d7db; font-size: 13px;
    border-radius: 6px;
}
.library-modal-radio:hover { background: rgba(255,255,255,0.04); color: #fff; }
.library-modal-radio input { accent-color: #08e981; }
.library-folder-list {
    max-height: 320px; overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
}
.library-folder-list-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; cursor: pointer;
    color: #d6d7db; font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.library-folder-list-item:last-child { border-bottom: 0; }
.library-folder-list-item:hover { background: rgba(255,255,255,0.04); color: #fff; }
.library-folder-list-item.active { background: rgba(8,233,129,0.12); color: #08e981; }
.library-folder-list-item i { color: #8c8c95; }
.library-folder-list-item.active i { color: #08e981; }

/* ============================================================
   Library Lightbox (view-image overlay)
   ============================================================ */
.library-lightbox-overlay {
    position: fixed; inset: 0;
    background: #0a0b0e;
    z-index: 9999;
}
.library-lightbox-overlay.active { animation: lib-fade 0.18s ease-out; }
.view-image-page {
    position: relative; width: 100%; height: 100%;
    display: flex; flex-direction: column;
    color: #fff;
}
.view-image-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 5;
}
.view-image-close, .view-image-info-toggle {
    width: 36px; height: 36px;
    border-radius: 8px; border: 0;
    background: rgba(255,255,255,0.06); color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.view-image-close:hover, .view-image-info-toggle:hover {
    background: rgba(255,255,255,0.12);
}
.view-image-nav-info {
    font-size: 13px; color: rgba(255,255,255,0.6);
}
.view-image-main {
    position: relative; flex: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.view-image-display {
    max-width: 100%; max-height: 100%;
    display: flex; align-items: center; justify-content: center;
}
.view-image-display img, .view-image-display video {
    max-width: 90vw; max-height: calc(100vh - 130px);
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.6);
}
.image-nav-prev, .image-nav-next {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 48px; height: 48px;
    border: 0; border-radius: 50%;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(10px);
    color: #fff; font-size: 18px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.image-nav-prev { left: 24px; }
.image-nav-next { right: 24px; }
.image-nav-prev:hover, .image-nav-next:hover { background: rgba(8,233,129,0.7); }
.image-nav-prev:disabled, .image-nav-next:disabled {
    opacity: 0.3; cursor: not-allowed;
}
.view-image-fab {
    position: absolute; bottom: 24px; right: 24px;
    z-index: 4;
}
.fab-btn {
    width: 48px; height: 48px;
    border-radius: 50%; border: 0;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(10px);
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.fab-btn:hover { background: rgba(8,233,129,0.7); }
.view-image-menu-dropdown {
    position: absolute; bottom: calc(100% + 8px); right: 0;
    background: #15171c;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 6px; min-width: 200px;
    box-shadow: 0 14px 30px rgba(0,0,0,0.5);
    display: none;
}
.view-image-menu-dropdown.open { display: block; }
.view-image-menu-dropdown .menu-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 9px 12px;
    background: transparent; border: 0;
    color: #d6d7db; font-size: 13px; text-align: left;
    cursor: pointer; border-radius: 6px;
}
.view-image-menu-dropdown .menu-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.view-image-menu-dropdown .menu-item-danger { color: #fca5a5; }
.view-image-menu-dropdown .menu-item-danger:hover { background: rgba(239,68,68,0.15); color: #fff; }
.view-image-menu-dropdown .menu-divider {
    height: 1px; background: rgba(255,255,255,0.08); margin: 4px 0;
}
.view-image-panel {
    position: fixed; top: 0; right: 0;
    width: 380px; height: 100%;
    background: #15171c;
    border-left: 1px solid rgba(255,255,255,0.08);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
    z-index: 6;
}
.view-image-panel.open { transform: translateX(0); }
.view-image-panel .panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky; top: 0;
    background: #15171c;
}
.view-image-panel .panel-header h2 {
    margin: 0; font-size: 15px; color: #fff;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.view-image-panel .panel-close {
    background: transparent; border: 0; color: rgba(255,255,255,0.5);
    cursor: pointer; padding: 4px;
}
.view-image-panel .panel-close:hover { color: #fff; }
.view-image-panel .panel-content { padding: 16px 20px; }
.view-image-panel .panel-section { margin-bottom: 20px; }
.view-image-panel .panel-section h3 {
    color: rgba(255,255,255,0.5);
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin: 0 0 8px;
}
.view-image-panel .section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}
.view-image-panel .section-header h3 { margin: 0; }
.view-image-panel .icon-btn {
    background: transparent; border: 0; color: rgba(255,255,255,0.5);
    cursor: pointer; padding: 4px;
}
.view-image-panel .icon-btn:hover { color: #fff; }
.view-image-panel .prompt-text {
    color: #d6d7db; font-size: 13px; line-height: 1.5;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0;
    white-space: pre-wrap; word-break: break-word;
}
.view-image-panel .prompt-text.secondary { color: rgba(255,255,255,0.5); }
.view-image-panel .meta-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.view-image-panel .meta-item {
    display: flex; flex-direction: column; gap: 2px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px; padding: 8px 10px;
}
.view-image-panel .meta-label {
    font-size: 10px; color: rgba(255,255,255,0.4);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.view-image-panel .meta-value {
    color: #fff; font-size: 12px; font-weight: 500;
}
.view-image-panel .parameters-grid {
    display: flex; flex-direction: column; gap: 4px;
}
.view-image-panel .param-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 10px; border-radius: 6px;
    background: rgba(255,255,255,0.03);
    font-size: 12px;
}
.view-image-panel .param-key { color: rgba(255,255,255,0.55); }
.view-image-panel .param-val { color: #fff; font-weight: 500; }

/* ============================================================
   Library Modals — markup classes from library-modals.js
   ============================================================ */
.library-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
}
.library-modal-header h3 i { color: #08e981; }
.library-modal.library-folder-modal { max-width: 480px; }

/* Search-style input row used by Folder picker + Create folder modals */
.library-folder-modal-search {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 0 12px;
    margin-bottom: 14px;
    transition: border-color 0.15s;
}
.library-folder-modal-search:focus-within {
    border-color: rgba(8,233,129,0.5);
    box-shadow: 0 0 0 3px rgba(8,233,129,0.08);
}
.library-folder-modal-search i {
    color: rgba(255,255,255,0.4);
    font-size: 13px;
}
.library-folder-modal-search input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: none;
    padding: 11px 12px;
    color: #fff;
    font-size: 14px;
}
.library-folder-modal-search input::placeholder { color: rgba(255,255,255,0.4); }

/* Folder picker list */
.library-folder-modal-list {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
}
.library-folder-modal-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; cursor: pointer;
    color: #d6d7db; font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.12s;
}
.library-folder-modal-item:last-child { border-bottom: 0; }
.library-folder-modal-item:hover { background: rgba(255,255,255,0.04); color: #fff; }
.library-folder-modal-item.selected {
    background: rgba(8,233,129,0.12);
    color: #08e981;
}
.library-folder-modal-item.current {
    opacity: 0.45;
    cursor: not-allowed;
}
.library-folder-modal-item i { color: #8c8c95; width: 16px; text-align: center; }
.library-folder-modal-item.selected i { color: #08e981; }
.library-folder-modal-item-name { flex: 1; }
.library-folder-modal-empty {
    padding: 40px 20px; text-align: center;
    color: rgba(255,255,255,0.5);
}
.library-folder-modal-empty i {
    font-size: 28px; display: block; margin-bottom: 8px;
    color: rgba(255,255,255,0.25);
}
.library-folder-modal-empty p { margin: 0; font-size: 13px; }

/* Footer buttons */
.lib-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px;
    border-radius: 9px;
    border: 1px solid transparent;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.lib-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.lib-btn-primary {
    background: #08e981;
    color: #000;
    border-color: #08e981;
}
.lib-btn-primary:hover:not(:disabled) { background: #06d676; }
.lib-btn-secondary {
    background: rgba(255,255,255,0.06);
    color: #fff;
    border-color: rgba(255,255,255,0.1);
}
.lib-btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.12); }

/* Download modal pieces */
.library-download-summary {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: rgba(8,233,129,0.08);
    border: 1px solid rgba(8,233,129,0.2);
    border-radius: 10px;
    color: #fff; font-size: 13px;
    margin-bottom: 16px;
}
.library-download-summary i { color: #08e981; font-size: 14px; }
.library-download-section { margin-bottom: 16px; }
.library-download-section h4 {
    margin: 0 0 8px;
    color: rgba(255,255,255,0.55);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.library-format-options { display: flex; flex-direction: column; gap: 6px; }
.library-format-option {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 13px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}
.library-format-option:hover { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.18); }
.library-format-option.selected {
    background: rgba(8,233,129,0.08);
    border-color: rgba(8,233,129,0.4);
}
.library-format-option input { accent-color: #08e981; }
.library-format-label { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.library-format-label strong { color: #fff; font-size: 13px; font-weight: 600; }
.library-format-label small { color: rgba(255,255,255,0.5); font-size: 11px; }

.library-download-progress { margin-top: 14px; }
.library-download-progress.hidden { display: none; }
.library-progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
    overflow: hidden;
}
.library-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #08e981, #06d676);
    border-radius: 99px;
    width: 0;
    transition: width 0.3s ease-out;
}
.library-progress-text {
    margin-top: 8px;
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
}

/* ============================================================
   Account page (account.html)
   ============================================================ */
.ap-page {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
    min-height: 60vh;
}
.ap-sidebar {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 18px 14px;
    position: sticky; top: 24px;
}
.ap-sidebar-identity {
    display: flex; align-items: center; gap: 12px;
    padding: 6px 8px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 10px;
}
.ap-avatar {
    border-radius: 50%; object-fit: cover;
    background: rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.ap-avatar-fallback {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, rgba(8,233,129,0.25), rgba(8,233,222,0.15));
    color: #08e981; font-weight: 700;
}
.ap-sidebar-id { min-width: 0; }
.ap-sidebar-name {
    color: #fff; font-weight: 600; font-size: 14px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ap-sidebar-tier {
    color: var(--fj-primary); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.ap-nav { display: flex; flex-direction: column; gap: 2px; }
.ap-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 9px;
    color: var(--fj-body); font-size: 14px; font-weight: 500;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}
.ap-nav-item:hover { background: rgba(255,255,255,0.04); color: #fff; }
.ap-nav-item.active {
    background: rgba(8,233,129,0.1);
    color: var(--fj-primary);
}
.ap-nav-icon { width: 18px; text-align: center; opacity: 0.85; }
.ap-nav-label { flex: 1; }
.ap-nav-chev { display: none; font-size: 11px; opacity: 0.4; }

.ap-sidebar-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.ap-signout {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 9px 12px;
    background: transparent; border: 0;
    color: var(--fj-body); font-size: 13px; font-weight: 500;
    border-radius: 9px;
    cursor: pointer;
}
.ap-signout:hover { background: rgba(255,255,255,0.04); color: #fff; }

.ap-content { min-width: 0; }
.ap-back-btn {
    display: none;
    align-items: center; gap: 6px;
    background: transparent; border: 0;
    color: var(--fj-body); font-size: 14px; font-weight: 500;
    padding: 4px 0; margin-bottom: 8px;
    cursor: pointer;
}
.ap-back-btn:hover { color: #fff; }

.ap-section-header { margin-bottom: 20px; }
.ap-eyebrow {
    color: var(--fj-primary); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.ap-title {
    color: #fff; font-size: 26px; font-weight: 700;
    line-height: 1.15; margin: 0 0 6px;
}
.ap-subtitle {
    color: var(--fj-body); font-size: 14px; line-height: 1.5;
    margin: 0;
}

.ap-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    margin-bottom: 16px;
    overflow: hidden;
}
.ap-card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ap-card-header h2 { margin: 0; color: #fff; font-size: 15px; font-weight: 600; }
.ap-card-body-pad { padding: 16px 18px; }
.ap-card-danger { border-color: rgba(233,17,8,0.3); }
.ap-card-danger .ap-card-header { border-bottom-color: rgba(233,17,8,0.2); }

/* Profile hero */
.ap-profile-hero {
    display: flex; gap: 24px;
    padding: 22px 24px;
    flex-wrap: wrap;
}
.ap-profile-hero-left {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.ap-profile-hero-right { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 14px; }
.ap-link-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: 0;
    color: var(--fj-primary); font-size: 12px; font-weight: 600;
    cursor: pointer; padding: 4px 8px;
}
.ap-link-btn:hover { text-decoration: underline; }

.ap-field { display: flex; flex-direction: column; gap: 4px; }
.ap-field-label {
    color: var(--fj-body); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.ap-field-row {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
}
.ap-field-value { color: #fff; font-size: 14px; }
.ap-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ap-text-btn {
    background: transparent; border: 0;
    color: var(--fj-primary); font-size: 12px; font-weight: 600;
    cursor: pointer; padding: 2px 4px;
    text-decoration: none;
}
.ap-text-btn:hover { text-decoration: underline; }
.ap-pill {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 99px;
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.ap-pill-muted {
    background: rgba(255,255,255,0.06);
    color: var(--fj-body);
}

/* Stats grid */
.ap-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px; margin-bottom: 16px;
}
.ap-stat {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 14px 16px;
}
.ap-stat-label {
    color: var(--fj-body); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.ap-stat-value {
    color: #fff; font-size: 22px; font-weight: 700;
    line-height: 1.1;
}
.ap-stat-meta { color: var(--fj-body); font-size: 11px; margin-top: 2px; }

/* GPU usage */
.ap-gpu-row { margin-bottom: 16px; }
.ap-gpu-row:last-child { margin-bottom: 0; }
.ap-gpu-row-top { display: flex; justify-content: space-between; margin-bottom: 6px; }
.ap-gpu-row-label { color: #fff; font-size: 13px; font-weight: 600; }
.ap-gpu-row-meta { color: var(--fj-body); font-size: 12px; }
.ap-gpu-bar {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 99px; overflow: hidden;
    margin-bottom: 4px;
}
.ap-gpu-bar > div {
    height: 100%; border-radius: 99px;
    transition: width 0.3s;
}
.ap-gpu-row-window { color: var(--fj-body); font-size: 11px; }
.ap-gpu-breakdown {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.ap-gpu-breakdown-label {
    color: var(--fj-body); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.ap-gpu-breakdown-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 6px;
}
.ap-gpu-breakdown-list li {
    display: flex; justify-content: space-between;
    padding: 6px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
}
.ap-gpu-breakdown-name { color: var(--fj-body); font-size: 12px; }
.ap-gpu-breakdown-value { color: #fff; font-size: 12px; font-weight: 600; }

/* Plan card */
.ap-plan-card { padding: 20px 22px; }
.ap-plan-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; flex-wrap: wrap;
}
.ap-plan-name {
    color: #fff; font-size: 22px; font-weight: 700;
    margin: 4px 0 6px;
}
.ap-plan-meta { color: var(--fj-body); font-size: 13px; }
.ap-plan-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 18px 0; }
.ap-balance-row { display: flex; gap: 24px; }
.ap-balance { flex: 1; }
.ap-balance-label {
    color: var(--fj-body); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.ap-balance-value { color: #fff; font-size: 22px; font-weight: 700; }
.ap-balance-currency { color: var(--fj-body); font-size: 14px; margin-right: 2px; }

/* Transactions */
.ap-tx-list { list-style: none; padding: 0; margin: 0; }
.ap-tx-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ap-tx-item:last-child { border-bottom: 0; }
.ap-tx-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    background: rgba(255,255,255,0.04);
}
.ap-tx-icon.credit { color: #34d399; background: rgba(52,211,153,0.1); }
.ap-tx-icon.debit { color: #fb923c; background: rgba(251,146,60,0.1); }
.ap-tx-body { flex: 1; min-width: 0; }
.ap-tx-title {
    color: #fff; font-size: 13px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ap-tx-date { color: var(--fj-body); font-size: 11px; }
.ap-tx-amount {
    color: #fff; font-size: 14px; font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.ap-tx-amount.credit { color: #34d399; }
.ap-tx-amount.debit { color: #fb923c; }

/* Row layout (used in Connections / Notifications / Security) */
.ap-row {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ap-row:last-child { border-bottom: 0; }
.ap-row-text { flex: 1; min-width: 0; }
.ap-row-title { color: #fff; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.ap-row-desc { color: var(--fj-body); font-size: 12px; line-height: 1.4; }
.ap-center { text-align: center; }

/* Switch */
.ap-switch {
    position: relative;
    width: 38px; height: 22px;
    flex-shrink: 0;
}
.ap-switch input {
    opacity: 0; width: 0; height: 0;
    position: absolute;
}
.ap-switch-track {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
    cursor: pointer;
    transition: background 0.18s;
}
.ap-switch-track::before {
    content: '';
    position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.18s;
}
.ap-switch input:checked + .ap-switch-track {
    background: var(--fj-primary);
}
.ap-switch input:checked + .ap-switch-track::before {
    transform: translateX(16px);
}

/* Buttons */
.ap-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border-radius: 9px;
    border: 1px solid transparent;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.ap-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ap-btn-primary { background: var(--fj-primary); color: #000; border-color: var(--fj-primary); }
.ap-btn-primary:hover:not(:disabled) { background: var(--fj-primary-hover); }
.ap-btn-secondary { background: rgba(255,255,255,0.06); color: #fff; border-color: rgba(255,255,255,0.12); }
.ap-btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.12); }
.ap-btn-ghost { background: transparent; color: var(--fj-body); border-color: rgba(255,255,255,0.1); }
.ap-btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.04); color: #fff; }
.ap-btn-danger { background: rgba(233,17,8,0.15); color: #fca5a5; border-color: rgba(233,17,8,0.3); }
.ap-btn-danger:hover:not(:disabled) { background: rgba(233,17,8,0.25); color: #fff; }

/* Standing */
.ap-standing-card {
    display: flex; align-items: center; gap: 16px;
    padding: 18px 20px;
}
.ap-standing-badge {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(8,233,129,0.12);
    color: var(--fj-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.ap-standing-badge.is-bad {
    background: rgba(233,17,8,0.12);
    color: var(--fj-danger);
}
.ap-standing-title { color: #fff; font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.ap-standing-desc { color: var(--fj-body); font-size: 13px; line-height: 1.5; }

/* Empty / loading */
.ap-empty, .ap-loading {
    padding: 20px;
    color: var(--fj-body);
    font-size: 13px;
    text-align: center;
}

/* Delete account modal */
.ap-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    padding: 16px;
}
.ap-modal {
    background: #16181d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    width: 100%; max-width: 480px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.ap-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ap-modal-header h2 { margin: 0; color: #fff; font-size: 16px; font-weight: 600; }
.ap-modal-close {
    background: transparent; border: 0;
    color: rgba(255,255,255,0.5); cursor: pointer;
    padding: 6px; border-radius: 6px;
}
.ap-modal-close:hover { background: rgba(255,255,255,0.06); color: #fff; }
.ap-modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.ap-modal-lead { margin: 0; color: #fff; font-size: 14px; line-height: 1.5; }
.ap-modal-note { margin: 0; color: var(--fj-body); font-size: 13px; line-height: 1.5; }
.ap-modal-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    outline: none;
}
.ap-modal-input:focus { border-color: rgba(8,233,129,0.5); }
.ap-modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.ap-danger-text { color: var(--fj-danger); }
.ap-strong { color: #fff; }

/* Mobile drill-down */
@media (max-width: 860px) {
    .ap-page {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .ap-sidebar {
        position: static;
        background: transparent;
        border: 0;
        padding: 0;
    }
    .ap-sidebar-identity {
        padding: 0 4px 16px;
    }
    .ap-nav-item {
        padding: 14px 12px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    .ap-nav-item.active {
        background: rgba(8,233,129,0.06);
    }
    .ap-nav-chev { display: inline; }
    .ap-sidebar-footer { margin-top: 18px; }
    .ap-back-btn { display: flex; }

    .ap-page[data-view="menu"] .ap-content { display: none; }
    .ap-page[data-view="section"] .ap-sidebar { display: none; }
}

/* ============================================================
   Generate page (generate.html)
   ============================================================ */
.generate-page-root { min-height: 70vh; }

.generate-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    margin-bottom: 14px;
}
.generate-header-left { flex: 1; min-width: 0; }
.queue-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    color: var(--fj-body); font-size: 13px;
}
.queue-status i { color: var(--fj-primary); }
.queue-count {
    background: var(--fj-primary); color: #000;
    font-weight: 700; font-size: 11px;
    padding: 1px 7px; border-radius: 99px;
}

/* Workflow selector */
.workflow-selector { position: relative; max-width: 480px; }
.workflow-selector-trigger {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 9px 12px;
    color: #fff; font-size: 14px; font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.workflow-selector-trigger:hover { background: rgba(255,255,255,0.08); }
.workflow-selector-trigger > i:first-child { color: var(--fj-primary); }
.workflow-selector-text { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-selector-placeholder { color: var(--fj-body); font-weight: 400; }
.workflow-dropdown {
    position: absolute; top: calc(100% + 6px); left: 0;
    width: min(560px, 90vw);
    background: #16181d;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.5);
    z-index: 50;
    display: none;
    max-height: 70vh; overflow: hidden;
}
.workflow-dropdown.show { display: flex; flex-direction: column; gap: 10px; }
.workflow-search {
    width: 100%;
    padding: 8px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #fff; font-size: 13px;
    outline: none;
}
.workflow-search:focus { border-color: rgba(8,233,129,0.4); }
.workflow-categories { display: flex; gap: 6px; flex-wrap: wrap; }
.workflow-category-btn {
    padding: 5px 11px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 99px;
    color: var(--fj-body); font-size: 11px; font-weight: 600;
    cursor: pointer;
}
.workflow-category-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.workflow-category-btn.active {
    background: rgba(8,233,129,0.15);
    border-color: rgba(8,233,129,0.4);
    color: var(--fj-primary);
}
.workflow-list { overflow-y: auto; max-height: 50vh; }
.workflow-list-item {
    display: flex; gap: 12px; align-items: center;
    padding: 9px 10px;
    border-radius: 9px;
    cursor: pointer;
    transition: background 0.12s;
}
.workflow-list-item:hover { background: rgba(255,255,255,0.04); }
.workflow-list-item.selected { background: rgba(8,233,129,0.1); }
.workflow-list-icon {
    width: 40px; height: 40px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    color: var(--fj-body);
    flex-shrink: 0;
}
.workflow-list-icon img { width: 100%; height: 100%; object-fit: cover; }
.workflow-list-info { flex: 1; min-width: 0; }
.workflow-list-name { color: #fff; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-list-meta { display: flex; gap: 8px; color: var(--fj-body); font-size: 11px; text-transform: capitalize; }
.workflow-empty-dropdown {
    padding: 30px; text-align: center; color: var(--fj-body);
}
.workflow-empty-dropdown i { font-size: 24px; display: block; margin-bottom: 8px; opacity: 0.4; }
.workflow-empty-dropdown p { margin: 0; font-size: 13px; }

/* Layout */
.generate-layout {
    display: flex; gap: 0;
    min-height: 64vh;
}
.generation-panel {
    flex-shrink: 0;
    overflow-y: auto;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 18px;
}
.generate-splitter {
    width: 6px;
    cursor: col-resize;
    background: transparent;
    margin: 0 6px;
    border-radius: 3px;
    position: relative;
}
.generate-splitter:hover, .generate-splitter.active {
    background: rgba(8,233,129,0.3);
}
.results-panel {
    flex: 1;
    overflow-y: auto;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 18px;
    min-width: 200px;
}
body.resizing-panels { user-select: none; cursor: col-resize; }

.workflow-form-header { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.workflow-form-header h2 { color: #fff; font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.workflow-form-header p { color: var(--fj-body); font-size: 12px; margin: 0; }

.no-workflow-state {
    padding: 50px 20px; text-align: center;
    color: var(--fj-body);
}
.no-workflow-state i { font-size: 36px; display: block; margin-bottom: 14px; opacity: 0.3; }
.no-workflow-state p { font-size: 13px; margin: 0; }

.form-section-title {
    color: rgba(255,255,255,0.6);
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}

/* Prompt */
.prompt-section { margin-bottom: 16px; }
.prompt-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.prompt-header-buttons { display: flex; gap: 4px; }
.prompt-builder-btn, .prompt-history-btn {
    width: 28px; height: 28px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 7px;
    color: var(--fj-body);
    font-size: 11px; cursor: pointer;
}
.prompt-builder-btn:hover, .prompt-history-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.prompt-field { position: relative; }
.prompt-textarea {
    width: 100%;
    min-height: 90px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9px;
    color: #fff; font-family: inherit; font-size: 13px; line-height: 1.5;
    resize: vertical;
    outline: none;
}
.prompt-textarea:focus { border-color: rgba(8,233,129,0.4); }
.prompt-textarea.negative { background: rgba(233,17,8,0.04); border-color: rgba(233,17,8,0.18); }
.prompt-history-dropdown {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px);
    background: #16181d;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    box-shadow: 0 16px 30px rgba(0,0,0,0.5);
    display: none;
    z-index: 30;
    max-height: 280px; overflow-y: auto;
}
.prompt-history-dropdown.show { display: block; }
.prompt-history-empty { padding: 16px; text-align: center; color: var(--fj-body); font-size: 12px; }
.prompt-history-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.6); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.prompt-history-clear {
    background: transparent; border: 0;
    color: var(--fj-primary); font-size: 11px; cursor: pointer;
}
.prompt-history-item {
    padding: 8px 12px; cursor: pointer;
    color: rgba(255,255,255,0.85); font-size: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.prompt-history-item:hover { background: rgba(255,255,255,0.04); color: #fff; }
.negative-prompt-section { margin-top: 8px; }
.negative-prompt-toggle {
    display: flex; align-items: center; gap: 6px;
    background: transparent; border: 0;
    color: var(--fj-body); font-size: 12px; font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
}
.negative-prompt-toggle:hover { color: #fff; }
.negative-prompt-toggle .toggle-icon { font-weight: 700; }
.negative-prompt-content { max-height: 0; overflow: hidden; transition: max-height 0.18s; }
.negative-prompt-content.open { max-height: 200px; margin-top: 6px; }

/* Quick settings */
.quick-settings {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
}
.setting-row {
    display: flex; align-items: center; gap: 8px;
    flex: 1; min-width: 180px;
}
.setting-label {
    color: var(--fj-body); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.setting-select {
    flex: 1;
    padding: 6px 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    color: #fff; font-size: 12px;
    outline: none;
}
.compact-dimensions, .compact-quantity {
    display: flex; align-items: center; gap: 6px;
}
.dim-label, .qty-label {
    color: var(--fj-body); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.dim-select {
    padding: 5px 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #fff; font-size: 12px;
    outline: none;
}
.dim-x { color: var(--fj-body); font-size: 12px; }
.qty-btn {
    width: 26px; height: 26px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #fff; font-size: 14px; font-weight: 700; line-height: 1;
    cursor: pointer;
}
.qty-btn:hover:not(:disabled) { background: rgba(255,255,255,0.12); }
.qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.qty-value { min-width: 24px; text-align: center; color: #fff; font-size: 13px; font-weight: 600; }

/* Folder selector */
.folder-selector-section { margin-bottom: 16px; }
.folder-selector { position: relative; }
.folder-selector-trigger {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9px;
    color: #fff; font-size: 13px;
    cursor: pointer;
}
.folder-selector-trigger:hover { background: rgba(255,255,255,0.08); }
.folder-selector-trigger > i:first-child { color: var(--fj-primary); }
.folder-selector-text { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: #16181d;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
    z-index: 40;
    display: none;
    max-height: 320px; overflow-y: auto;
}
.folder-dropdown.show { display: block; }
.folder-dropdown-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border-radius: 7px;
    color: rgba(255,255,255,0.85); font-size: 12px;
    cursor: pointer;
}
.folder-dropdown-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.folder-dropdown-item.active { background: rgba(8,233,129,0.1); color: var(--fj-primary); }
.folder-dropdown-item i { color: rgba(255,255,255,0.4); width: 14px; text-align: center; }
.folder-dropdown-item.active i { color: var(--fj-primary); }
.folder-dropdown-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 4px 6px; }
.folder-dropdown-create { color: var(--fj-primary); }

/* Form fields */
.main-fields { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.generate-form-field { display: flex; flex-direction: column; gap: 4px; }
.generate-form-field label {
    color: rgba(255,255,255,0.85); font-size: 12px; font-weight: 500;
}
.input-field {
    width: 100%;
    padding: 8px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff; font-size: 13px;
    outline: none;
    font-family: inherit;
}
.input-field:focus { border-color: rgba(8,233,129,0.4); }
textarea.input-field { min-height: 64px; resize: vertical; }
.generate-form-field small {
    color: var(--fj-body); font-size: 11px; line-height: 1.4;
}
.slider-container { display: flex; align-items: center; gap: 10px; }
.slider-container input[type="range"] { flex: 1; accent-color: var(--fj-primary); }
.slider-value {
    width: 72px;
    padding: 4px 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #fff; font-size: 12px;
    outline: none;
    text-align: center;
}
.seed-field { display: flex; align-items: center; gap: 6px; }
.seed-field .input-field { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.seed-field .input-field.seed-random { color: var(--fj-body); font-style: italic; font-family: inherit; }
.seed-lock-btn {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 7px;
    color: var(--fj-body); cursor: pointer;
}
.seed-lock-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.seed-lock-btn.locked { background: rgba(8,233,129,0.15); border-color: rgba(8,233,129,0.35); color: var(--fj-primary); }

.input-image-field .input-image-container {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 8px; align-items: start;
}
.input-image-preview {
    width: 80px; height: 80px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.15);
    overflow: hidden;
    position: relative;
}
.input-image-preview.has-image { border-style: solid; border-color: rgba(8,233,129,0.4); }
.input-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.input-image-clear {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px;
    background: rgba(0,0,0,0.6); color: #fff;
    border: 0; border-radius: 50%;
    cursor: pointer; font-size: 14px;
}
.input-image-id-field {
    padding: 8px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff; font-size: 12px;
    font-family: ui-monospace, monospace;
    outline: none;
}
.input-image-select {
    padding: 8px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff; font-size: 12px; font-weight: 600;
    cursor: pointer;
}
.input-image-select:hover { background: rgba(255,255,255,0.12); }

/* Field groups */
.field-group {
    margin-bottom: 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 9px;
    overflow: hidden;
}
.field-group-toggle {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 10px 12px;
    background: transparent; border: 0;
    color: #fff; font-size: 12px; font-weight: 500;
    cursor: pointer;
    text-align: left;
}
.field-group-toggle:hover { background: rgba(255,255,255,0.04); }
.field-group-toggle i { color: var(--fj-body); font-size: 11px; }
.field-group-content {
    padding: 0 14px 12px;
    display: flex; flex-direction: column; gap: 12px;
}

/* Generate button */
.generate-btn {
    width: 100%;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 18px;
    margin-top: 14px;
    background: var(--fj-primary);
    color: #000;
    border: 0; border-radius: 10px;
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.generate-btn:hover:not(:disabled) { background: var(--fj-primary-hover); }
.generate-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.spinner {
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gp-spin 0.85s linear infinite;
    display: inline-block;
}
@keyframes gp-spin { to { transform: rotate(360deg); } }
.generate-loading {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 60px 0;
    color: var(--fj-body);
}
.generate-loading .spinner { width: 28px; height: 28px; border-width: 3px; border-top-color: var(--fj-primary); }
.generate-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--fj-body);
}
.generate-empty-state i { font-size: 36px; display: block; margin-bottom: 14px; opacity: 0.4; }
.generate-empty-state h3 { color: #fff; font-size: 16px; margin: 0 0 6px; }
.generate-empty-state p { font-size: 13px; margin: 0; }

/* Mobile generate bar */
.mobile-generate-bar {
    display: none;
    position: sticky; bottom: 8px;
    margin-top: 12px;
    z-index: 10;
    padding: 0 4px;
}
@media (max-width: 900px) {
    .generate-layout { flex-direction: column; }
    .generation-panel { width: 100% !important; }
    .generate-splitter { display: none; }
    .results-panel { width: 100%; }
    .mobile-generate-bar { display: block; }
    .mobile-generate-bar .generate-btn { margin-top: 0; }
}

/* Results panel */
.results-section { margin-bottom: 22px; }
.results-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.results-section-title {
    display: flex; align-items: center; gap: 8px;
    margin: 0;
    color: #fff; font-size: 13px; font-weight: 600;
}
.results-section-title i { color: var(--fj-primary); font-size: 13px; }
.results-limit-selector {
    display: flex; align-items: center; gap: 6px;
    color: var(--fj-body); font-size: 12px;
}
.results-limit-selector select {
    padding: 4px 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #fff; font-size: 12px; outline: none;
}

.active-jobs-list { display: flex; flex-direction: column; gap: 8px; }
.job-card-compact {
    padding: 10px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px;
}
.job-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.job-card-info { flex: 1; min-width: 0; }
.job-card-info h4 { margin: 0; color: #fff; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-card-meta { color: var(--fj-body); font-size: 11px; }
.job-card-status {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px;
    border-radius: 99px;
    font-size: 11px; font-weight: 600;
    flex-shrink: 0;
}
.job-card-status.queued { background: rgba(255,255,255,0.06); color: var(--fj-body); }
.job-card-status.running { background: rgba(8,233,129,0.12); color: var(--fj-primary); }
.job-card-status.running i { animation: gp-spin 1s linear infinite; }
.job-progress-bar {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 99px;
    margin-top: 8px; overflow: hidden;
}
.job-progress-fill { height: 100%; background: var(--fj-primary); border-radius: 99px; transition: width 0.3s; }
.job-progress-text { color: var(--fj-body); font-size: 11px; margin-top: 4px; }

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.result-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 9px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
}
.result-card img { width: 100%; height: 100%; object-fit: cover; }
.result-card-empty {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.3); font-size: 22px;
}
.result-card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.6) 100%);
    opacity: 0;
    transition: opacity 0.15s;
    display: flex; align-items: flex-end; justify-content: flex-end;
    padding: 8px;
}
.result-card:hover .result-card-overlay { opacity: 1; }
.result-card-action {
    width: 28px; height: 28px;
    background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
    border-radius: 7px;
    color: #fff; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
}
.results-empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--fj-body);
}
.results-empty-state i { font-size: 30px; display: block; margin-bottom: 10px; opacity: 0.4; }
.results-empty-state h3 { color: #fff; font-size: 14px; margin: 0 0 4px; }
.results-empty-state p { font-size: 12px; margin: 0; }

/* Create folder modal (used by GenerateController.showCreateFolderModal) */
.generate-folder-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 16px;
}
.generate-folder-modal {
    background: #16181d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    width: 100%; max-width: 420px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.6);
}
.generate-folder-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.generate-folder-modal-header h3 { margin: 0; color: #fff; font-size: 15px; font-weight: 600; }
.generate-folder-modal-close {
    background: transparent; border: 0;
    color: rgba(255,255,255,0.5); cursor: pointer; padding: 6px; border-radius: 6px;
}
.generate-folder-modal-close:hover { background: rgba(255,255,255,0.06); color: #fff; }
.generate-folder-modal-body { padding: 18px; }
.generate-folder-input-wrapper {
    display: flex; align-items: center; gap: 10px;
    padding: 0 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9px;
}
.generate-folder-input-wrapper i { color: var(--fj-primary); }
.generate-folder-input-wrapper input {
    flex: 1; background: transparent; border: 0; outline: none;
    color: #fff; font-size: 14px; padding: 10px 0;
}
.generate-folder-modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.generate-folder-modal-footer .btn-primary {
    background: var(--fj-primary); color: #000;
    border: 0; padding: 8px 16px; border-radius: 8px;
    font-size: 13px; font-weight: 600; cursor: pointer;
}
.generate-folder-modal-footer .btn-secondary {
    background: rgba(255,255,255,0.06); color: #fff;
    border: 1px solid rgba(255,255,255,0.1); padding: 8px 16px; border-radius: 8px;
    font-size: 13px; font-weight: 600; cursor: pointer;
}

/* Toasts (shared by generate page) */
.gp-toast-host {
    position: fixed; bottom: 18px; right: 18px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 2000;
    pointer-events: none;
}
.gp-toast {
    padding: 10px 16px;
    border-radius: 9px;
    color: #fff;
    font-size: 13px; font-weight: 500;
    box-shadow: 0 10px 28px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    background: #1d2026;
    pointer-events: auto;
    animation: gp-toast-in 0.18s ease-out;
}
.gp-toast.out { opacity: 0; transform: translateY(8px); transition: all 0.25s; }
.gp-toast-success { border-color: rgba(8,233,129,0.4); background: rgba(8,233,129,0.12); color: #d8ffeb; }
.gp-toast-error   { border-color: rgba(233,17,8,0.4);  background: rgba(233,17,8,0.12);  color: #ffd8d4; }
.gp-toast-info    { border-color: rgba(56,189,248,0.4); background: rgba(56,189,248,0.12); color: #d9efff; }
@keyframes gp-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* File-selector modal stub */
.gp-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1100; padding: 16px;
}
.gp-modal {
    background: #16181d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    width: 100%; max-width: 440px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.6);
}
.gp-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.gp-modal-header h3 { margin: 0; color: #fff; font-size: 15px; font-weight: 600; }
.gp-modal-close { background: transparent; border: 0; color: rgba(255,255,255,0.5); cursor: pointer; padding: 6px; }
.gp-modal-close:hover { color: #fff; }
.gp-modal-body { padding: 18px; }
.gp-modal-note { color: var(--fj-body); font-size: 12px; margin: 0 0 10px; line-height: 1.5; }
.gp-modal-note code { background: rgba(255,255,255,0.06); padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 11px; }
.gp-modal-body input {
    width: 100%; padding: 9px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9px;
    color: #fff; font-size: 13px;
    font-family: ui-monospace, monospace;
    outline: none;
}
.gp-modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.gp-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}
.gp-btn-primary { background: var(--fj-primary); color: #000; }
.gp-btn-primary:hover { background: var(--fj-primary-hover); }
.gp-btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.1); }
.gp-btn-ghost:hover { background: rgba(255,255,255,0.04); }

/* ============================================================
   Generate2 page (generate2.html — "Beta")
   ============================================================ */
.g2 {
    position: relative;
    min-height: calc(100vh - 80px);
    color: #fff;
    overflow: hidden;
}
.g2-ambient {
    position: absolute; inset: 0;
    pointer-events: none;
    z-index: 0;
}
.g2-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
}
.g2-orb--1 { top: -120px; left: 12%; width: 380px; height: 380px; background: rgba(8,233,129,0.4); }
.g2-orb--2 { bottom: -120px; right: 8%; width: 320px; height: 320px; background: rgba(99,102,241,0.4); }

.g2-loading {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 80px 0;
    color: var(--fj-body);
}
.g2-loading .spinner {
    width: 28px; height: 28px;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--fj-primary);
    border-radius: 50%;
    animation: gp-spin 0.85s linear infinite;
}

/* Layout */
.g2-layout {
    position: relative; z-index: 1;
    display: flex;
    height: calc(100vh - 80px);
    gap: 0;
}
.g2-panel {
    flex-shrink: 0;
    width: 420px;
    display: flex; flex-direction: column;
    background: rgba(255,255,255,0.025);
    border-right: 1px solid rgba(255,255,255,0.06);
    transition: width 0.2s;
}
.g2-panel.collapsed { width: 0 !important; overflow: hidden; }

.g2-panel__header {
    position: relative;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.g2-panel__collapse {
    display: none;
    position: absolute; top: 12px; right: 12px;
    width: 28px; height: 28px;
    background: rgba(255,255,255,0.06);
    border: 0; border-radius: 7px;
    color: var(--fj-body); cursor: pointer;
}
.g2-panel__scroll {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px 6px;
}
.g2-panel__footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Workflow card */
.g2-workflow {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    cursor: pointer;
    transition: border-color 0.15s;
}
.g2-workflow:hover { border-color: rgba(8,233,129,0.3); }
.g2-workflow__icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(8,233,129,0.12);
    color: var(--fj-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.g2-workflow__info { flex: 1; min-width: 0; }
.g2-workflow__name { color: #fff; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g2-workflow__tags { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.g2-workflow__tag {
    padding: 1px 7px;
    background: rgba(255,255,255,0.06);
    border-radius: 99px;
    color: var(--fj-body);
    font-size: 10px; font-weight: 500;
    text-transform: capitalize;
}
.g2-workflow__tag--accent {
    background: rgba(8,233,129,0.15);
    color: var(--fj-primary);
}
.g2-workflow__arrow {
    color: rgba(255,255,255,0.35); font-size: 13px;
}

.g2-workflow-dropdown {
    position: absolute; top: calc(100% + 6px); left: 14px; right: 14px;
    background: #16181d;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.6);
    z-index: 100;
    display: none;
    flex-direction: column; gap: 10px;
    max-height: 65vh;
}
.g2-workflow-dropdown.show { display: flex; }
.g2-workflow-dropdown__search {
    width: 100%;
    padding: 8px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #fff; font-size: 13px;
    outline: none;
}
.g2-workflow-dropdown__cats { display: flex; gap: 6px; flex-wrap: wrap; }
.g2-workflow-dropdown__cat {
    padding: 5px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 99px;
    color: var(--fj-body); font-size: 11px; font-weight: 600;
    cursor: pointer;
}
.g2-workflow-dropdown__cat:hover { background: rgba(255,255,255,0.08); color: #fff; }
.g2-workflow-dropdown__cat.active {
    background: rgba(8,233,129,0.15);
    border-color: rgba(8,233,129,0.4);
    color: var(--fj-primary);
}
.g2-workflow-dropdown__list { overflow-y: auto; max-height: 45vh; display: flex; flex-direction: column; gap: 2px; }
.g2-workflow-dropdown__item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    cursor: pointer;
}
.g2-workflow-dropdown__item:hover { background: rgba(255,255,255,0.04); }
.g2-workflow-dropdown__item.selected { background: rgba(8,233,129,0.08); }

/* Labels */
.g2-label {
    display: flex; align-items: center; gap: 8px;
    color: rgba(255,255,255,0.65); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin: 12px 0 6px;
}
.g2-label__dot {
    width: 5px; height: 5px;
    background: var(--fj-primary);
    border-radius: 50%;
}

/* Prompt */
.g2-prompt {
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    overflow: hidden;
    transition: border-color 0.15s;
}
.g2-prompt:focus-within { border-color: rgba(8,233,129,0.4); }
.g2-prompt__textarea {
    width: 100%;
    background: transparent;
    border: 0;
    padding: 12px;
    color: #fff;
    font-family: inherit; font-size: 14px; line-height: 1.5;
    min-height: 100px;
    outline: none;
    resize: vertical;
}
.g2-prompt__footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 0;
}
.g2-prompt__tools { display: flex; gap: 6px; }
.g2-prompt__tool {
    width: 28px; height: 28px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 7px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 12px;
}
.g2-prompt__tool:hover { background: rgba(255,255,255,0.08); color: #fff; }
.g2-prompt__chars { color: rgba(255,255,255,0.35); font-size: 11px; font-family: JetBrains Mono, ui-monospace, monospace; }
.g2-prompt-history {
    position: absolute; left: 16px; right: 16px;
    background: #16181d;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    margin-top: 4px;
    box-shadow: 0 14px 28px rgba(0,0,0,0.5);
    display: none;
    max-height: 280px; overflow-y: auto;
    z-index: 50;
}
.g2-prompt-history.show { display: block; }
.g2-prompt-history__empty { padding: 14px; text-align: center; color: rgba(255,255,255,0.4); font-size: 12px; }
.g2-prompt-history__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5); font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.g2-prompt-history__clear { background: transparent; border: 0; color: var(--fj-primary); font-size: 11px; cursor: pointer; }
.g2-prompt-history__item {
    padding: 8px 12px; cursor: pointer;
    color: rgba(255,255,255,0.8); font-size: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.g2-prompt-history__item:hover { background: rgba(255,255,255,0.04); color: #fff; }

.g2-neg-toggle {
    background: transparent;
    border: 0;
    color: var(--fj-body);
    font-size: 12px;
    cursor: pointer;
    padding: 6px 0;
    margin-top: 4px;
}
.g2-neg-toggle:hover { color: #fff; }
.g2-neg-content { max-height: 0; overflow: hidden; transition: max-height 0.2s; margin-top: 6px; }
.g2-neg-content.open { max-height: 220px; }

.g2-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 14px 0;
}

/* Dimensions */
.g2-dims {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px;
}
.g2-dims__field {
    flex: 1;
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px;
}
.g2-dims__label {
    color: var(--fj-body); font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.g2-dims__select {
    flex: 1;
    background: transparent; border: 0;
    color: #fff; font-size: 13px;
    outline: none;
}
.g2-dims__select option { background: #16181d; }
.g2-dims__x { color: var(--fj-body); }

/* Count stepper */
.g2-count {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px;
    margin-bottom: 12px;
}
.g2-count__label { color: rgba(255,255,255,0.85); font-size: 13px; font-weight: 500; }
.g2-count__stepper { display: flex; align-items: center; gap: 6px; }
.g2-count__btn {
    width: 26px; height: 26px;
    background: rgba(255,255,255,0.06);
    border: 0; border-radius: 7px;
    color: #fff; font-size: 14px; font-weight: 700;
    cursor: pointer;
}
.g2-count__btn:hover { background: rgba(255,255,255,0.12); }
.g2-count__value { min-width: 28px; text-align: center; color: #fff; font-size: 14px; font-weight: 600; }

/* Input image */
.g2-input-image { margin-bottom: 12px; }
.g2-input-image__row {
    display: grid; grid-template-columns: 80px 1fr auto;
    gap: 8px; align-items: start;
}
.g2-input-image__preview {
    width: 80px; height: 80px;
    border-radius: 9px;
    background: rgba(255,255,255,0.04);
    border: 1px dashed rgba(255,255,255,0.15);
    overflow: hidden; position: relative;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.3); font-size: 18px;
}
.g2-input-image__preview.has-image { border-style: solid; border-color: rgba(8,233,129,0.4); }
.g2-input-image__preview img { width: 100%; height: 100%; object-fit: cover; }
.g2-input-image__clear {
    position: absolute; top: 4px; right: 4px;
    width: 20px; height: 20px;
    background: rgba(0,0,0,0.6); color: #fff;
    border: 0; border-radius: 50%; cursor: pointer; font-size: 12px;
}
.g2-input-image__id {
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff; font-size: 12px;
    font-family: JetBrains Mono, ui-monospace, monospace;
    outline: none;
}
.g2-input-image__browse {
    padding: 8px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff; font-size: 12px; font-weight: 600;
    cursor: pointer;
}

/* Folder */
.g2-folder-wrap { position: relative; margin-bottom: 12px; }
.g2-folder {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px;
    cursor: pointer;
}
.g2-folder:hover { background: rgba(255,255,255,0.06); }
.g2-folder > i:first-child { color: var(--fj-primary); }
.g2-folder__name { color: #fff; font-size: 13px; }
.g2-folder-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: #16181d;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 5px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.5);
    z-index: 30;
    display: none;
    max-height: 320px; overflow-y: auto;
}
.g2-folder-dropdown.show { display: block; }
.g2-folder-dropdown__item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px;
    border-radius: 7px;
    color: rgba(255,255,255,0.85); font-size: 12px;
    cursor: pointer;
}
.g2-folder-dropdown__item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.g2-folder-dropdown__item.active { background: rgba(8,233,129,0.1); color: var(--fj-primary); }
.g2-folder-dropdown__item i { color: rgba(255,255,255,0.4); width: 14px; text-align: center; }
.g2-folder-dropdown__item.active i { color: var(--fj-primary); }
.g2-folder-dropdown__divider { height: 1px; background: rgba(255,255,255,0.06); margin: 4px 6px; }
.g2-folder-dropdown__create { color: var(--fj-primary); }

/* Groups */
.g2-group {
    margin-bottom: 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 9px;
    overflow: hidden;
}
.g2-group__header {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 10px 12px;
    background: transparent; border: 0;
    color: #fff; font-size: 13px; font-weight: 500;
    cursor: pointer;
    text-align: left;
}
.g2-group__header:hover { background: rgba(255,255,255,0.04); }
.g2-group__header > i:first-child { color: var(--fj-primary); font-size: 13px; }
.g2-group__name { flex: 1; }
.g2-group__badge {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.65);
    font-size: 10px; font-weight: 600;
    padding: 1px 7px;
    border-radius: 99px;
}
.g2-group__arrow { color: rgba(255,255,255,0.35); font-size: 11px; transition: transform 0.15s; }
.g2-group.open .g2-group__arrow { transform: rotate(90deg); }
.g2-group__content {
    display: none;
    padding: 0 14px 12px;
    flex-direction: column; gap: 12px;
}
.g2-group.open .g2-group__content { display: flex; }

/* Fields */
.g2-field__label {
    color: rgba(255,255,255,0.85); font-size: 12px; font-weight: 500;
    margin-bottom: 4px;
}
.g2-field__description { color: var(--fj-body); font-size: 11px; line-height: 1.4; margin-top: 4px; }
.g2-field__input, .g2-field__select {
    width: 100%;
    padding: 8px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #fff; font-size: 13px;
    outline: none;
}
.g2-field__select option { background: #16181d; }
.g2-field__seed { display: flex; gap: 6px; }
.g2-field__seed-input {
    flex: 1;
    padding: 8px 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--fj-body); font-family: JetBrains Mono, ui-monospace, monospace; font-size: 12px;
    font-style: italic;
    outline: none;
}
.g2-field__seed-btn {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
}
.g2-field__seed-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.g2-field__seed-btn.locked { background: rgba(8,233,129,0.15); border-color: rgba(8,233,129,0.35); color: var(--fj-primary); }

.g2-field__slider { display: flex; align-items: center; gap: 12px; }
.g2-slider { flex: 1; padding: 8px 0; cursor: pointer; touch-action: none; }
.g2-slider__track {
    position: relative;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
}
.g2-slider__fill {
    position: absolute; inset: 0;
    background: var(--fj-primary);
    border-radius: 99px;
    pointer-events: none;
}
.g2-slider__thumb {
    position: absolute; top: 50%;
    width: 14px; height: 14px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    pointer-events: none;
}
.g2-field__value {
    width: 64px;
    padding: 5px 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    color: #fff; font-size: 12px;
    text-align: center;
    font-family: JetBrains Mono, ui-monospace, monospace;
    outline: none;
}

/* Switch (boolean field) */
.g2-switch { position: relative; width: 40px; height: 22px; cursor: pointer; display: inline-block; }
.g2-switch input { display: none; }
.g2-switch__track {
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.06);
    border-radius: 11px;
    transition: background 0.15s;
}
.g2-switch__track::before {
    content: '';
    position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s;
}
.g2-switch input:checked + .g2-switch__track { background: var(--fj-primary); }
.g2-switch input:checked + .g2-switch__track::before { transform: translateX(18px); }

/* Generate button */
.g2-generate {
    width: 100%;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 18px;
    background: var(--fj-primary);
    color: #000;
    border: 0; border-radius: 10px;
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.g2-generate:hover:not(:disabled) { background: var(--fj-primary-hover); }
.g2-generate:disabled { opacity: 0.45; cursor: not-allowed; }
.g2-generate__shortcut {
    margin-left: 6px;
    font-size: 11px;
    opacity: 0.6;
    background: rgba(0,0,0,0.15);
    padding: 2px 6px;
    border-radius: 5px;
    font-family: JetBrains Mono, ui-monospace, monospace;
}

/* Splitter */
.g2-splitter {
    position: relative;
    width: 6px;
    flex-shrink: 0;
    cursor: col-resize;
    transition: background 0.15s;
}
.g2-splitter:hover, .g2-splitter.dragging, .g2-splitter.touched {
    background: rgba(8,233,129,0.25);
}
.g2-splitter__line {
    position: absolute; inset: 0;
}
.g2-splitter__toggle {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 22px; height: 36px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 5px;
    color: var(--fj-body);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
    font-size: 11px;
}
.g2-splitter:hover .g2-splitter__toggle, .g2-splitter.touched .g2-splitter__toggle { opacity: 1; }

/* Results */
.g2-results {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex; flex-direction: column;
    min-width: 0;
}
.g2-results__tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.g2-results__tab {
    padding: 8px 16px;
    background: transparent; border: 0;
    color: var(--fj-body); font-size: 13px; font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.g2-results__tab:hover { color: #fff; }
.g2-results__tab.active {
    color: var(--fj-primary);
    border-bottom-color: var(--fj-primary);
}
.g2-results__pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.g2-results__pane[hidden] { display: none; }
.g2-results__pane--library { padding: 0; }

.g2-results__header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px;
}
.g2-results__search-wrap { flex: 1; position: relative; }
.g2-results__search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,0.35);
}
.g2-results__search {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px;
    color: #fff; font-size: 13px; outline: none;
}
.g2-results__search:focus { border-color: rgba(8,233,129,0.4); }
.g2-results__controls { display: flex; align-items: center; gap: 8px; }
.g2-results__count {
    color: rgba(255,255,255,0.5); font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.g2-col-selector { position: relative; }
.g2-col-trigger {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 7px;
    color: rgba(255,255,255,0.6); cursor: pointer;
}
.g2-col-trigger:hover { background: rgba(255,255,255,0.08); color: #fff; }
.g2-col-menu {
    position: absolute; top: calc(100% + 4px); right: 0;
    background: #16181d;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 9px;
    padding: 4px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.5);
    display: none;
    min-width: 140px;
    z-index: 25;
}
.g2-col-selector.open .g2-col-menu { display: block; }
.g2-col-menu__item {
    display: block; width: 100%;
    text-align: left;
    padding: 7px 10px;
    background: transparent; border: 0;
    color: rgba(255,255,255,0.8); font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
}
.g2-col-menu__item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.g2-col-menu__item.active { background: rgba(8,233,129,0.12); color: var(--fj-primary); }

.g2-grid {
    display: flex;
    gap: 10px;
}
.g2-grid-col {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 10px;
}
.g2-load-trigger { height: 20px; }
.g2-library-mount { padding: 4px; }

/* Card */
.g2-card {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    transition: transform 0.15s;
}
.g2-card:hover { transform: translateY(-2px); }
.g2-card__media {
    position: absolute;
    inset: 0;
    background: #111115;
}
.g2-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.g2-card__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.7) 100%);
    opacity: 0;
    transition: opacity 0.15s;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 8px;
    gap: 6px;
}
.g2-card:hover .g2-card__overlay { opacity: 1; }
.g2-card__prompt {
    color: rgba(255,255,255,0.95);
    font-size: 11px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.g2-card__actions { display: flex; gap: 4px; }
.g2-card__action {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    padding: 5px 8px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    color: #fff;
    border: 0; border-radius: 6px;
    font-size: 10px; font-weight: 600;
    cursor: pointer;
}
.g2-card__action:hover { background: rgba(8,233,129,0.7); color: #000; }
.g2-card__video-badge {
    position: absolute; top: 8px; left: 8px;
    background: rgba(0,0,0,0.6); color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
}

/* Progress card (active job in results) */
.g2-progress {
    position: relative;
    aspect-ratio: 1 / 1;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(8,233,129,0.2);
}
.g2-progress__content {
    position: absolute; inset: 0;
    padding: 14px;
    display: flex; flex-direction: column; gap: 6px;
    background: linear-gradient(135deg, rgba(8,233,129,0.05), rgba(99,102,241,0.05));
}
.g2-progress__name { color: #fff; font-size: 13px; font-weight: 600; }
.g2-progress__status { color: rgba(255,255,255,0.6); font-size: 11px; }
.g2-progress__bar {
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 4px;
}
.g2-progress__fill { height: 100%; background: var(--fj-primary); border-radius: 99px; transition: width 0.3s; }
.g2-progress__pct { color: var(--fj-primary); font-size: 11px; font-weight: 700; }
.g2-progress__meta { color: rgba(255,255,255,0.45); font-size: 10px; }
.g2-progress__log {
    color: rgba(255,255,255,0.5);
    font-size: 10px;
    font-family: JetBrains Mono, ui-monospace, monospace;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.g2-progress__info {
    position: absolute; top: 8px; right: 8px;
    width: 22px; height: 22px;
    background: rgba(0,0,0,0.4);
    border: 0; border-radius: 6px;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 11px;
}
.g2-progress__info:hover { background: rgba(0,0,0,0.7); color: #fff; }

.g2-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--fj-body);
}
.g2-empty i { font-size: 36px; display: block; margin-bottom: 14px; opacity: 0.4; }
.g2-empty h3 { color: #fff; font-size: 15px; margin: 0 0 6px; }
.g2-empty p { font-size: 12px; margin: 0; }

/* Mobile */
.g2-mobile-bar {
    display: none;
    position: fixed; bottom: 12px; left: 12px; right: 12px;
    z-index: 50;
}
.g2-mobile-bar.hidden { display: none !important; }
@media (max-width: 900px) {
    .g2-layout { flex-direction: column; height: auto; min-height: calc(100vh - 80px); }
    .g2-panel { width: 100% !important; border-right: 0; border-bottom: 1px solid rgba(255,255,255,0.06); max-height: 60vh; }
    .g2-panel.mobile-collapsed .g2-panel__scroll, .g2-panel.mobile-collapsed .g2-panel__footer { display: none; }
    .g2-panel__collapse { display: flex; align-items: center; justify-content: center; }
    .g2-splitter { display: none; }
    .g2-results { min-height: 60vh; }
    .g2-mobile-bar { display: block; }
}

/* Job log modal */
.g2-log-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1100; padding: 16px;
}
.g2-log-modal {
    background: #16181d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    width: 100%; max-width: 640px;
    max-height: 80vh;
    display: flex; flex-direction: column;
    box-shadow: 0 18px 50px rgba(0,0,0,0.6);
}
.g2-log-modal__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: #fff; font-size: 14px; font-weight: 600;
}
.g2-log-modal__close {
    background: transparent; border: 0;
    color: rgba(255,255,255,0.5); cursor: pointer; padding: 6px;
}
.g2-log-modal__close:hover { color: #fff; }
.g2-log-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    font-family: JetBrains Mono, ui-monospace, monospace;
    font-size: 11px;
    line-height: 1.5;
}
.g2-log-modal__line {
    color: rgba(255,255,255,0.7);
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

/* Lightbox fallback */
.g2-lightbox-fallback {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    cursor: zoom-out;
}
.g2-lightbox-fallback img { max-width: 95vw; max-height: 95vh; object-fit: contain; }
.g2-lightbox-fallback__close {
    position: absolute; top: 18px; right: 18px;
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.1);
    border: 0; border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
}

/* ============================================================
   ComfyUI page (comfyui.html)
   ============================================================ */
.comfyui-page { min-height: calc(100vh - 80px); }
.panel-content.panel-comfyui {
    display: flex; flex-direction: column;
    min-height: 70vh;
    color: #fff;
}
.panel-content.panel-comfyui-active {
    height: calc(100vh - 110px);
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    overflow: hidden;
}

.comfyui-center-state {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    padding: 80px 20px;
    color: var(--fj-body); text-align: center;
}
.comfyui-center-icon {
    font-size: 36px; color: var(--fj-primary);
}
.comfyui-center-icon.error { color: var(--fj-danger); }
.comfyui-center-state h3 { color: #fff; font-size: 18px; margin: 0; }
.comfyui-center-state p { font-size: 13px; margin: 0; max-width: 360px; line-height: 1.5; }
.comfyui-error-text { color: var(--fj-body); }
.panel-loading-spinner {
    width: 32px; height: 32px;
    border: 3px solid rgba(255,255,255,0.12);
    border-top-color: var(--fj-primary);
    border-radius: 50%;
    animation: gp-spin 0.85s linear infinite;
}

.comfyui-empty {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    padding: 80px 20px; text-align: center;
}
.comfyui-empty-icon-wrap {
    width: 80px; height: 80px;
    border-radius: 22px;
    background: rgba(8,233,129,0.1);
    color: var(--fj-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
}
.comfyui-empty h3 { color: #fff; font-size: 20px; font-weight: 700; margin: 0; }
.comfyui-empty p { color: var(--fj-body); font-size: 14px; margin: 0; line-height: 1.6; }

.comfyui-availability {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.comfyui-availability::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
}
.comfyui-availability.available {
    background: rgba(8,233,129,0.12);
    color: var(--fj-primary);
}
.comfyui-availability.available::before { background: var(--fj-primary); }
.comfyui-availability.unavailable {
    background: rgba(255,255,255,0.06);
    color: var(--fj-body);
}
.comfyui-availability.unavailable::before { background: var(--fj-body); }

.comfyui-create-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px;
    background: var(--fj-primary);
    color: #000;
    border: 0; border-radius: 10px;
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.comfyui-create-btn:hover:not(:disabled) { background: var(--fj-primary-hover); }
.comfyui-create-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.comfyui-sessions-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.comfyui-sessions-header h3 { color: #fff; font-size: 18px; font-weight: 700; margin: 0; }
.comfyui-sessions-list {
    display: flex; flex-direction: column; gap: 10px;
    padding: 20px 24px;
}
.comfyui-sessions-actions {
    padding: 0 24px 24px;
    display: flex; justify-content: flex-start;
}

.comfyui-session-card {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 11px;
}
.session-card-info {
    display: flex; align-items: center; gap: 14px;
    flex-wrap: wrap;
}
.session-card-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px; font-weight: 600;
    color: var(--fj-primary);
    background: rgba(8,233,129,0.08);
    padding: 3px 9px;
    border-radius: 6px;
}
.session-card-timer {
    color: #fff; font-size: 13px; font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.session-card-prompts {
    color: var(--fj-body); font-size: 12px;
}
.session-card-actions {
    display: flex; gap: 6px;
}
.session-card-actions button {
    padding: 6px 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    color: #fff; font-size: 12px; font-weight: 600;
    cursor: pointer;
    transition: background 0.12s;
}
.session-card-actions button:hover:not(:disabled) { background: rgba(255,255,255,0.12); }
.session-card-actions button:disabled { opacity: 0.4; cursor: not-allowed; }
.session-open-btn { background: rgba(8,233,129,0.15) !important; border-color: rgba(8,233,129,0.35) !important; color: var(--fj-primary) !important; }
.session-open-btn:hover { background: rgba(8,233,129,0.25) !important; }
.session-end-btn:hover:not(:disabled) { background: rgba(233,17,8,0.2) !important; border-color: rgba(233,17,8,0.4) !important; color: #fca5a5 !important; }

/* Active session view */
.comfyui-active-toolbar {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-wrap: wrap;
}
.comfyui-back-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    color: #fff; font-size: 12px; font-weight: 600;
    cursor: pointer;
}
.comfyui-back-btn:hover { background: rgba(255,255,255,0.1); }
.comfyui-tabs {
    display: flex; gap: 4px;
    background: rgba(255,255,255,0.04);
    padding: 3px;
    border-radius: 9px;
}
.ws-tab {
    padding: 6px 14px;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--fj-body); font-size: 12px; font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
}
.ws-tab:hover { color: #fff; }
.ws-tab.active {
    background: var(--fj-primary);
    color: #000;
}
.comfyui-toolbar-info {
    display: flex; align-items: center; gap: 10px;
    margin-left: auto;
}
.comfyui-session-label {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    color: var(--fj-body);
    background: rgba(255,255,255,0.04);
    padding: 3px 8px;
    border-radius: 6px;
}
.comfyui-timer {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px; font-weight: 700;
    color: var(--fj-warning);
    background: rgba(233,147,8,0.1);
    padding: 3px 9px;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
}
.comfyui-toolbar-actions { display: flex; gap: 6px; }
.comfyui-toolbar-actions button {
    padding: 6px 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 7px;
    color: #fff; font-size: 12px; font-weight: 600;
    cursor: pointer;
}
.comfyui-toolbar-actions button:hover { background: rgba(255,255,255,0.12); }
.comfyui-end-btn:hover { background: rgba(233,17,8,0.2) !important; border-color: rgba(233,17,8,0.4) !important; color: #fca5a5; }

.comfyui-iframe-container {
    flex: 1;
    background: #000;
    position: relative;
    overflow: hidden;
}
.aitk-trial-ribbon {
    padding: 10px 14px;
    background: #3a2c10;
    color: #f5d28b;
    border-bottom: 1px solid #6b4d1a;
    font-size: 13px;
    line-height: 1.4;
}
.aitk-trial-ribbon a {
    color: #f0c040; text-decoration: underline; font-weight: 600;
}
.comfyui-iframe-container iframe {
    width: 100%; height: 100%;
    border: 0;
    background: #1a1a1f;
    display: block;
}
.comfyui-return-btn, .comfyui-retry-btn {
    padding: 9px 16px;
    background: var(--fj-primary);
    color: #000;
    border: 0; border-radius: 9px;
    font-size: 13px; font-weight: 700;
    cursor: pointer;
}
.comfyui-return-btn:hover, .comfyui-retry-btn:hover { background: var(--fj-primary-hover); }

@media (max-width: 700px) {
    .comfyui-session-card { flex-direction: column; align-items: stretch; }
    .session-card-actions { justify-content: flex-end; }
    .comfyui-active-toolbar { padding: 8px 10px; }
    .comfyui-tabs { order: 3; width: 100%; justify-content: center; }
    .comfyui-toolbar-info { margin-left: 0; }
}
