:root { --banana-yellow: #facc15; --bg-dark: #09090b; }
body { background-color: var(--bg-dark); color: #e4e4e7; padding-bottom: 120px; }
body.compact-mode .input-field { padding: 0.35rem; font-size: 0.75rem; }
body.compact-mode .grid-card { padding: 1rem; }
.tab-btn.active { border-bottom: 2px solid var(--banana-yellow); color: var(--banana-yellow); }
.gallery-card:hover img { transform: scale(1.05); }

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE VISIBILITY HELPERS (no Tailwind CDN dependency)
   ══════════════════════════════════════════════════════════════════════ */
@media (min-width: 1024px) {
    .mobile-only  { display: none !important; }
    .desktop-only { display: flex !important; }   /* flex for sidebar / header */
    .output-grid  { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1023px) {
    .desktop-only { display: none !important; }
    .mobile-only  { display: block !important; }
    .output-grid  { grid-template-columns: 1fr; }
    #mainApp      { padding-bottom: 56px; } /* room for mob-action-bar */
}

/* ══════════════════════════════════════════════════════════════════════
   MOBILE NAV BAR
   ══════════════════════════════════════════════════════════════════════ */
.mob-nav-bar {
    background: #09090b;
    border-bottom: 1px solid #27272a;
}
.mob-nav-arrow {
    padding: 0 18px;
    font-size: 16px;
    font-weight: 700;
    background: transparent;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    transition: color .15s;
    min-height: 48px;
}
.mob-nav-arrow:hover  { color: #fff; }
.mob-nav-icon {
    padding: 0 14px;
    font-size: 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    min-height: 48px;
    opacity: .7;
    transition: opacity .15s;
}
.mob-nav-icon:hover { opacity: 1; }
.mob-cat-name {
    font-size: 13px;
    font-weight: 800;
    color: #f4f4f5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mob-cat-pos {
    font-size: 10px;
    color: #71717a;
    margin-top: 1px;
}
.mob-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    border-top: 1px solid #27272a;
    background: #09090b;
}

/* Light mode overrides for mobile nav */
html.light-mode .mob-nav-bar   { background: #fff; border-color: #e5e7eb; }
html.light-mode .mob-nav-arrow { color: #6b7280; }
html.light-mode .mob-nav-arrow:hover { color: #111827; }
html.light-mode .mob-cat-name  { color: #111827; }
html.light-mode .mob-cat-pos   { color: #9ca3af; }
html.light-mode .mob-action-bar { background: #fff; border-color: #e5e7eb; }

/* ========== STUDIO SIDEBAR NAV ========== */
#cat-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#cat-nav::-webkit-scrollbar { display: none; }

#cat-nav button {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s, color 0.15s;
    background: transparent;
    color: #71717a;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
#cat-nav button:hover      { background: #27272a; color: #d4d4d8; }
#cat-nav button.active     { background: var(--banana-yellow); color: #000 !important; font-weight: 700; }
#cat-nav button .fill-dot  { font-size: 9px; opacity: 0.8; flex-shrink: 0; }

/* Mobile pill bar */
#mobile-cat-bar button {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid #3f3f46;
    background: transparent;
    color: #71717a;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
#mobile-cat-bar button:hover  { border-color: #71717a; color: #d4d4d8; }
#mobile-cat-bar button.active { background: var(--banana-yellow); border-color: var(--banana-yellow); color: #000; font-weight: 700; }

/* Studio sidebar chrome */
.studio-sidebar          { border-color: #27272a; }
.studio-sidebar-footer   { border-color: #27272a; }

/* Output cards */
.output-card    { border-color: #27272a; }
.prompt-textarea{ background: #000; color: #fef9c3; }
.json-pre       { background: #000; color: #34d399; }
.copy-btn-yellow{ border-color: #a16207; color: var(--banana-yellow); }
.copy-btn-yellow:hover { background: rgba(250,204,21,.15); }
.copy-btn-green { border-color: #065f46; color: #34d399; }
.copy-btn-green:hover { background: rgba(52,211,153,.1); }

/* Prev/Next nav buttons */
.nav-btn      { border-color: #3f3f46; color: #71717a; background: transparent; }
.nav-btn:hover{ border-color: #71717a; color: #d4d4d8; background: #27272a; }
.nav-btn-next { border-color: #3f3f46; color: #71717a; background: transparent; }
.nav-btn-next:hover { border-color: #a16207; color: var(--banana-yellow); background: rgba(250,204,21,.08); }

/* Cat header roll tab btn */
.cat-roll-btn       { border-color: #3f3f46; color: #71717a; background: transparent; }
.cat-roll-btn:hover { border-color: #047857; color: #34d399; background: rgba(52,211,153,.08); }

/* ── Light mode overrides ───────────────────────────── */
html.light-mode #cat-nav button                  { color: #6b7280; }
html.light-mode #cat-nav button:hover            { background: #f3f4f6; color: #111827; }
html.light-mode #cat-nav button.active           { background: var(--banana-yellow); color: #000 !important; }
html.light-mode #mobile-cat-bar button           { border-color: #e5e7eb; color: #6b7280; background: #fff; }
html.light-mode #mobile-cat-bar button:hover     { border-color: #9ca3af; color: #111827; }
html.light-mode #mobile-cat-bar button.active    { background: var(--banana-yellow); border-color: var(--banana-yellow); color: #000; }
html.light-mode .studio-sidebar                  { border-color: #e5e7eb; }
html.light-mode .studio-sidebar-footer           { border-color: #e5e7eb; }
html.light-mode .output-card                     { border-color: #e5e7eb; background: #fff; }
html.light-mode .prompt-textarea                 { background: #fffbeb; color: #78350f; border: 1px solid #fde68a; }
html.light-mode .json-pre                        { background: #f0fdf4; color: #065f46; border: 1px solid #bbf7d0; }
html.light-mode .copy-btn-yellow                 { border-color: #fde68a; color: #b45309; }
html.light-mode .copy-btn-green                  { border-color: #bbf7d0; color: #047857; }
html.light-mode .nav-btn                         { border-color: #e5e7eb; color: #6b7280; background: #fff; }
html.light-mode .nav-btn:hover                   { background: #f3f4f6; color: #111827; border-color: #9ca3af; }
html.light-mode .nav-btn-next                    { border-color: #e5e7eb; color: #6b7280; background: #fff; }
html.light-mode .nav-btn-next:hover              { border-color: #fde68a; color: #b45309; background: #fffbeb; }
html.light-mode .cat-roll-btn                    { border-color: #e5e7eb; color: #6b7280; background: #fff; }
html.light-mode .cat-roll-btn:hover              { border-color: #bbf7d0; color: #047857; background: #f0fdf4; }
html.light-mode #mobile-cat-bar-wrap             { background: #f9fafb; border-color: #e5e7eb; }

/* Masterclass specific */
.prose h2 { color: white; font-weight: 800; font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1rem; border-bottom: 1px solid #27272a; padding-bottom: 0.5rem; }
.prose h3 { color: var(--banana-yellow); font-weight: 700; font-size: 1.125rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }
.prose p { margin-bottom: 1.25rem; line-height: 1.75; color: #a1a1aa; }
.prose ul { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 1.25rem; color: #a1a1aa; }
/* =========================================
   LIGHT MODE OVERRIDE ENGINE
   ========================================= */
html.light-mode body {
    --bg-dark: #f4f4f5; /* Changes root background to light gray */
    background-color: var(--bg-dark);
    color: #18181b;
}

/* =========================================
   REFINED LIGHT MODE OVERRIDES
   ========================================= */
html.light-mode body {
    background-color: #f9fafb !important; /* Very light gray app background */
    color: #111827 !important;
}

/* Main Cards & Panels */
html.light-mode .bg-\[\#18181b\],
html.light-mode .bg-zinc-950,
html.light-mode .bg-\[\#09090b\]\/80,
html.light-mode .bg-\[#18181b\],
html.light-mode .bg-black\/40 {
    background-color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
}

/* Secondary/Inner Areas (Tabs wrapper, Ad space) */
html.light-mode .bg-zinc-900,
html.light-mode .bg-\[\#09090b\],
html.light-mode .bg-zinc-900\/50,
html.light-mode .bg-zinc-950,
html.light-mode .bg-black\/40 {
    background-color: #f9fafb !important;
}

/* Soften all borders */
html.light-mode .border-zinc-800, 
html.light-mode .border-zinc-800\/80,
html.light-mode .border-zinc-700 { 
    border-color: #e5e7eb !important; 
}

/* General Text */
html.light-mode .text-white { color: #111827 !important; }
html.light-mode .text-zinc-300 { color: #b0b1b5 !important; }   /* #374151 */
html.light-mode .text-zinc-400 { color: #b0b1b5 !important; }   /* #4b5563 */
html.light-mode .text-zinc-500 { color: #b0b1b5 !important; }   /* #6b7280 */

/* FIX: Ensure Output Textareas are readable in Light Mode! */
html.light-mode .text-yellow-100\/90 { color: #854d0e !important; font-weight: 600; } /* Dark Brown/Yellow */
html.light-mode .text-emerald-400\/80 { color: #065f46 !important; font-weight: 600; } /* Dark Green */

/* Buttons & Interactive Elements */
html.light-mode .bg-zinc-800 { background-color: #f3f4f6 !important; color: #111827 !important; border: 1px solid #e5e7eb !important; }
html.light-mode .hover\:bg-zinc-700:hover { background-color: #e5e7eb !important; }

/* Fix Tom Select Dropdowns for Light Mode */
html.light-mode .ts-control {
    background-color: #ffffff !important;
    border-color: #d1d5db !important;
    color: #111827 !important;
}
html.light-mode .ts-control > input {
    color: #111827 !important;
}
html.light-mode .ts-dropdown {
    background-color: #ffffff !important;
    border-color: #e5e7eb !important;
    color: #111827 !important;
}
html.light-mode .ts-dropdown .option.active,
html.light-mode .ts-dropdown .option:hover {
    background-color: #f3f4f6 !important;
    color: #d97706 !important;
}
html.light-mode .ts-control .item {
    background-color: #f3f4f6 !important;
    color: #d97706 !important;
    border-color: #d1d5db !important;
}

/* Light mode dropdown trigger buttons */
html.light-mode [class*="bg-white\/50"] {
    background-color: #ffffff !important;
    border-color: #d1d5db !important;
}

/* =========================================
   LIGHT MODE TAB STYLING
   ========================================= */
html.light-mode #tabsContainer {
    border-bottom-color: #d1d5db !important;
}

html.light-mode #tabsContainer button {
    color: #9ca3af !important;
    background-color: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
}

html.light-mode #tabsContainer button:hover {
    background-color: transparent !important;
    color: #6b7280 !important;
    border-bottom-color: #d1d5db !important;
}

html.light-mode #tabsContainer button.active {
    background-color: transparent !important;
    color: #d97706 !important;
    border-bottom-color: #d97706 !important;
    font-weight: 700 !important;
}

/* =========================================
   LIGHT MODE HERO & SECTION STYLING
   ========================================= */
html.light-mode #heroSection {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%) !important;
    border-bottom-color: #e5e7eb !important;
}

html.light-mode #heroSection {
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%) !important;
}

html.light-mode #heroSection .absolute {
    display: none !important;
}

html.light-mode #heroSection h1 {
    color: #111827 !important;
}

html.light-mode #heroSection p {
    color: #6b7280 !important;
}

html.light-mode .bg-indigo-900\/40,
html.light-mode .bg-yellow-900\/40 {
    background-color: rgba(255, 255, 255, 0.7) !important;
    border-color: #e5e7eb !important;
}

html.light-mode .text-indigo-100,
html.light-mode .text-yellow-100 {
    color: #374151 !important;
}

html.light-mode .text-indigo-200\/60,
html.light-mode .text-yellow-200\/60 {
    color: #6b7280 !important;
}

/* =========================================
   LIGHT MODE CONTAINER & CARD STYLING
   ========================================= */
html.light-mode .bg-gradient-to-b,
html.light-mode [class*="from-zinc-900"] {
    background: linear-gradient(to bottom, #ffffff, #f9fafb) !important;
}

html.light-mode .border-zinc-800\/80 {
    border-color: #e5e7eb !important;
}

html.light-mode .bg-black\/40 {
    background-color: #f9fafb !important;
}

html.light-mode label {
    color: #374151 !important;
}

html.light-mode .text-zinc-600 {
    color: #9ca3af !important;
}

html.light-mode .text-zinc-700 {
    color: #9ca3af !important;
}

html.light-mode .rounded-2xl {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}

/* =========================================
   LIGHT MODE BACKGROUND CLEANUP
   ========================================= */
html.light-mode [class*="bg-zinc-900"],
html.light-mode [class*="bg-gray-200"],
html.light-mode [class*="bg-gray-100"],
html.light-mode [class*="bg-gray-300"],
html.light-mode [class*="bg-slate"] {
    background-color: transparent !important;
}

html.light-mode [class*="py-8"],
html.light-mode [class*="px-4"] {
    background-color: transparent !important;
}

html.light-mode #mainApp {
    background-color: transparent !important;
}

html.light-mode [class*="text-zinc-700"] {
    color: #374151 !important;
}
/* =========================================
   MODERN DROPDOWN (TOM SELECT) OVERRIDES
   ========================================= */
.ts-control { background-color: #09090b !important; border: 1px solid #27272a !important; color: #fff !important; border-radius: 0.5rem !important; padding: 0.85rem !important; box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05); transition: border-color 0.2s; }
.ts-control.focus { border-color: rgba(250, 204, 21, 0.5) !important; box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.5) !important; }
.ts-control > input { color: #fff !important; }
.ts-dropdown { background-color: #18181b !important; border: 1px solid #27272a !important; color: #d4d4d8 !important; border-radius: 0.5rem !important; margin-top: 4px; box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.3); }
.ts-dropdown .option { padding: 0.75rem 1rem !important; cursor: pointer; }
.ts-dropdown .option.active, .ts-dropdown .option:hover { background-color: #27272a !important; color: var(--banana-yellow) !important; }
.ts-control .item { background-color: #27272a !important; color: var(--banana-yellow) !important; border: 1px solid #3f3f46 !important; border-radius: 0.25rem !important; padding: 2px 8px !important; font-weight: bold; font-size: 0.75rem; }
/* Light Mode logic */
html.light-mode .ts-control { background-color: #ffffff !important; border-color: #d4d4d8 !important; }
html.light-mode .ts-control > input { color: #000 !important; }
html.light-mode .ts-dropdown { background-color: #ffffff !important; border-color: #e4e4e7 !important; color: #09090b !important; }
html.light-mode .ts-dropdown .option.active { background-color: #f4f4f5 !important; color: #d97706 !important; }
/* =========================================
   IDE SCROLLBARS
   ========================================= */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #27272a;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}
html.light-mode ::-webkit-scrollbar-thumb {
    background: #d4d4d8;
}

/* Make TomSelect Inputs smaller for the IDE */
.ts-control { padding: 0.5rem 0.75rem !important; min-height: 36px !important; font-size: 12px !important; }
.ts-control .item { padding: 1px 6px !important; font-size: 10px !important; }

/* =========================================
   AMBIENT BACKGROUND DOT GRID
   ========================================= */
body {
    background-image: radial-gradient(circle, rgba(63, 63, 70, 0.55) 1px, transparent 1px);
    background-size: 28px 28px;
}
html.light-mode body {
    background-image: radial-gradient(circle, rgba(209, 213, 219, 0.7) 1px, transparent 1px);
}

/* =========================================
   SCROLL PROGRESS BAR
   ========================================= */
#scrollProgressBar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, var(--banana-yellow), var(--banana-yellow));
    z-index: 9999;
    transition: width 0.08s linear;
    pointer-events: none;
}

/* =========================================
   SLOT MACHINE ANIMATIONS
   ========================================= */
@keyframes slotBorderPulse {
    0%, 100% { border-color: rgba(250,204,21,0.15); box-shadow: 0 0 0px rgba(250,204,21,0); }
    50%       { border-color: rgba(250,204,21,0.5);  box-shadow: 0 0 20px rgba(250,204,21,0.15); }
}
.slot-container-spinning {
    animation: slotBorderPulse 0.4s ease-in-out infinite;
}

/* =========================================
   FORM FIELD SLIDE-IN ANIMATION
   ========================================= */
@keyframes fieldSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.field-enter { animation: fieldSlideIn 0.22s ease-out forwards; }

/* =========================================
   OUTPUT PANEL GLOW STATES
   ========================================= */
.output-has-content-yellow {
    box-shadow: 0 0 35px rgba(250, 204, 21, 0.09) !important;
    border-color: rgba(250, 204, 21, 0.22) !important;
    transition: box-shadow 0.6s ease, border-color 0.6s ease;
}
.output-has-content-green {
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.09) !important;
    border-color: rgba(16, 185, 129, 0.22) !important;
    transition: box-shadow 0.6s ease, border-color 0.6s ease;
}

/* =========================================
   HERO SECTION
   ========================================= */
#heroSection {
    animation: heroFadeIn 0.6s ease-out forwards;
}
@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================
   RECENT GALLERY - SLIDE-UP ACTION ROW
   ========================================= */
.gallery-action-bar {
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.group:hover .gallery-action-bar {
    transform: translateY(0);
}

/* =========================================
   JSON SYNTAX HIGHLIGHT DISPLAY
   ========================================= */
#jsonDisplay {
    height: 200px !important;
    max-height: 200px !important;
    min-height: 200px !important;
    resize: none !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    line-height: 1.65;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 1.5rem;
    color: rgba(52, 211, 153, 0.8);
}
html.light-mode #jsonDisplay { color: #065f46; }

/* =========================================
   PROMPT OUTPUT FIXED HEIGHT
   ========================================= */
#promptOutput {
    height: 200px !important;
    max-height: 200px !important;
    min-height: 200px !important;
    overflow-y: auto !important;
    resize: none !important;
}

/* =========================================
   COUNTER ANIMATION
   ========================================= */
.counter {
    font-variant-numeric: tabular-nums;
    transition: transform 0.1s ease;
}

/* =========================================
   LIGHT MODE COMPAT FOR NEW ELEMENTS
   ========================================= */
html.light-mode .output-has-content-yellow {
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.12) !important;
    border-color: rgba(234, 179, 8, 0.35) !important;
}
html.light-mode .output-has-content-green {
    box-shadow: 0 0 20px rgba(5, 150, 105, 0.12) !important;
    border-color: rgba(5, 150, 105, 0.35) !important;
}

/* =========================================
   LOCKED FIELD STYLING
   ========================================= */
.locked-field {
    border-color: rgba(250, 204, 21, 0.4) !important;
    background-color: rgba(250, 204, 21, 0.05) !important;
}
.locked-field:hover {
    border-color: rgba(250, 204, 21, 0.6) !important;
}
html.light-mode .locked-field {
    border-color: rgba(234, 179, 8, 0.5) !important;
    background-color: rgba(234, 179, 8, 0.08) !important;
}

/* =========================================
   LOCKED BADGE STYLING
   ========================================= */
#locked-badge {
    animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
html.light-mode #locked-badge {
    background-color: rgba(234, 179, 8, 0.15) !important;
    border-color: rgba(234, 179, 8, 0.6) !important;
}
html.light-mode #locked-badge .text-yellow-400 {
    color: #b45309 !important;
}
html.light-mode #locked-badge .text-yellow-600 {
    color: #92400e !important;
}

/* =========================================
   RANDOMIZATION STATUS INDICATOR
   ========================================= */
.randomization-indicator {
    animation: indicatorPulse 0.6s ease-out;
}
@keyframes indicatorPulse {
    0% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.8; transform: scale(1); }
}

/* =========================================
   HERO SECTION STYLES
   ========================================= */
#heroSection {
    animation: heroFadeInNew 0.7s ease-out forwards;
}
@keyframes heroFadeInNew {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================
   PARAMETER CARD STYLING - CLEAN & MINIMAL
   ========================================= */
.param-card {
    background: transparent !important;
    border: none !important;
    transition: none;
    position: relative;
    overflow: visible;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: none !important;
}

/* Sleek dropdown styling */
.param-card > div:nth-child(n+2) {
    background-color: #ffffff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.75rem !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.875rem !important;
    color: #374151 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
}

.param-card > div:nth-child(n+2):hover {
    border-color: #9ca3af !important;
    background-color: #f9fafb !important;
}

.param-card label {
    transition: color 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0;
    color: #374151;
}

.param-card label:hover {
    color: #1f2937;
}

/* =========================================
   PARAMETER GROUP STYLING
   ========================================= */
.param-group-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(120, 113, 108, 0.8);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(113, 113, 122, 0.2);
}

/* =========================================
   LOCK BUTTON ANIMATIONS
   ========================================= */
.lock-toggle-btn {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.lock-toggle-btn:active {
    transform: scale(0.95);
}

@keyframes lockSpinFlash {
    0% { transform: rotateY(0deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.1); }
    100% { transform: rotateY(0deg) scale(1); }
}

.lock-toggle-btn.locked {
    animation: lockSpinFlash 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =========================================
   OUTPUT PANEL ENHANCEMENTS
   ========================================= */
.output-panel {
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none !important;
}

.output-panel:hover {
    transform: none;
}

.output-panel textarea,
.output-panel pre {
    transition: all 0.3s ease;
}

.output-panel textarea:focus-visible,
.output-panel pre:focus-visible {
    outline: none;
    border-color: rgba(250, 204, 21, 0.5);
    box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.1);
}

/* =========================================
   BUTTON INTERACTIONS
   ========================================= */
#btn-randomize {
    position: relative;
    overflow: hidden;
    box-shadow: none !important;
}

#btn-randomize:hover {
    transform: translateY(-2px) !important;
}

#btn-randomize:active {
    transform: translateY(0) !important;
}

/* =========================================
   COPY BUTTON FEEDBACK
   ========================================= */
.copy-btn-success {
    animation: copyButtonPulse 0.6s ease-out;
}

@keyframes copyButtonPulse {
    0% {
        background-color: rgba(250, 204, 21, 0.4);
        transform: scale(1);
    }
    50% {
        background-color: rgba(16, 185, 129, 0.4);
        transform: scale(1.05);
    }
    100% {
        background-color: rgba(250, 204, 21, 0.2);
        transform: scale(1);
    }
}

/* =========================================
   SKELETON LOADER ANIMATION
   ========================================= */
@keyframes skeletonLoad {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton {
    background: linear-gradient(90deg, rgba(113, 113, 122, 0.2) 25%, rgba(113, 113, 122, 0.4) 50%, rgba(113, 113, 122, 0.2) 75%);
    background-size: 1000px 100%;
    animation: skeletonLoad 2s infinite;
}

/* =========================================
   MOBILE OPTIMIZATIONS
   ========================================= */
@media (max-width: 768px) {
    #heroSection {
        padding: 2rem 1rem;
    }

    #heroSection h1 {
        font-size: 1.875rem;
    }

    #mainApp {
        gap: 1.5rem;
        padding: 1rem;
    }

    .param-card {
        padding: 1rem;
    }

    .param-card label {
        font-size: 0.8125rem;
    }

    #btn-randomize {
        width: 100%;
        justify-content: center;
    }

    #tab-randomize-btn {
        width: 100%;
        justify-content: center;
    }

    .output-panel {
        min-height: 300px;
    }

    /* Touch-friendly button sizes */
    button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Larger text for mobile readability */
    textarea,
    pre {
        font-size: 13px !important;
    }

    /* Responsive grid */
    #dynamic-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    #heroSection {
        padding: 1.5rem 0.75rem;
    }

    #heroSection h1 {
        font-size: 1.5rem;
    }

    .param-card {
        padding: 0.875rem;
    }

    .lock-toggle-btn {
        padding: 0.5rem 0.75rem !important;
    }
}

/* =========================================
   LIGHT MODE OPTIMIZATIONS
   ========================================= */
html.light-mode .param-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(249, 250, 251, 0.6) 100%);
    border-color: rgba(209, 213, 219, 0.5);
}

html.light-mode .param-card:hover {
    border-color: rgba(209, 213, 219, 0.8);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

html.light-mode .param-group-header {
    color: rgba(107, 114, 128, 0.8);
    border-color: rgba(209, 213, 219, 0.3);
}

html.light-mode .output-panel {
    background: linear-gradient(to br, rgba(255, 255, 255, 0.95), rgba(249, 250, 251, 0.9)) !important;
}

/* Enhanced dynamic form grid */
#dynamic-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

html.light-mode #heroSection {
    background: linear-gradient(to br, #f9fafb, #f3f4f6);
    border-color: rgba(209, 213, 219, 0.4);
}

/* COMPREHENSIVE LIGHT MODE - EVERYTHING LIGHT */
html.light-mode {
    background-color: #f5f5f5 !important;
}

html.light-mode body {
    background-color: #f5f5f5 !important;
    color: #1f2937 !important;
}

html.light-mode #heroSection,
html.light-mode .bg-gradient-to-b,
html.light-mode [class*="from-zinc"] {
    background: linear-gradient(to bottom, #ffffff, #f9fafb) !important;
    border-color: #d1d5db !important;
}

html.light-mode .param-card,
html.light-mode [class*="bg-\[#18181b\]"],
html.light-mode .bg-zinc-950,
html.light-mode [class*="bg-zinc-900"] {
    background-color: #ffffff !important;
    border-color: #d1d5db !important;
    color: #1f2937 !important;
}

html.light-mode textarea,
html.light-mode pre,
html.light-mode input[type="text"] {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border-color: #d1d5db !important;
}


html.light-mode #dynamic-form {
    background-color: transparent !important;
}

html.light-mode .randomize {
    background: linear-gradient(to right, #fef3c7, #fef08a) !important;
    border-color: #fcd34d !important;
}

html.light-mode #btn-randomize {
    background-color: var(--banana-yellow) !important;
    color: #000000 !important;
}

html.light-mode #btn-randomize:hover {
    background-color: #f59e0b !important;
}

html.light-mode .param-card {
    background: transparent !important;
    border: none !important;
}

html.light-mode .param-card label {
    color: #374151 !important;
}

html.light-mode .lock-toggle-btn {
    background-color: #ffffff !important;
    border-color: #d1d5db !important;
    color: #6b7280 !important;
}

html.light-mode .lock-toggle-btn:hover {
    background-color: #f3f4f6 !important;
    color: #374151 !important;
}

html.light-mode .lock-toggle-btn.locked {
    background-color: #fef3c7 !important;
    border-color: #fcd34d !important;
    color: #92400e !important;
}

/* =========================================
   REMOVE ALL SHADOWS FOR CLEAN LOOK
   ========================================= */
[class*="shadow"] {
    box-shadow: none !important;
}

/* =========================================
   SMOOTH TRANSITIONS & EASING
   ========================================= */
* {
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   ACCESSIBILITY - FOCUS STATES
   ========================================= */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid rgba(250, 204, 21, 0.7);
    outline-offset: 2px;
}

html.light-mode button:focus-visible,
html.light-mode input:focus-visible,
html.light-mode textarea:focus-visible,
html.light-mode select:focus-visible {
    outline: 2px solid rgba(234, 179, 8, 0.7);
}

/* =========================================
   SCALE ANIMATIONS FOR BADGE
   ========================================= */
.scale-110 {
    transform: scale(1.1);
}

.scale-100 {
    transform: scale(1);
}

/* =========================================
   ENHANCED ANIMATIONS FOR VISUAL POLISH
   ========================================= */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply fade-in to elements as they appear */
.param-card {
    animation: fadeInUp 0.4s ease-out forwards;
}

#heroSection {
    animation: slideInDown 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* =========================================
   BUTTON HOVER EFFECTS
   ========================================= */
button:not(:disabled) {
    cursor: pointer;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================================
   INPUT FIELD ENHANCEMENTS
   ========================================= */
input[type="text"]:hover,
textarea:hover {
    border-color: rgba(113, 113, 122, 0.7) !important;
}

input[type="text"]:focus,
textarea:focus {
    border-color: rgba(250, 204, 21, 0.6) !important;
}

/* =========================================
   DROPDOWN FIELD ENHANCEMENTS
   ========================================= */
.param-card > div:last-child:not(label):hover {
    border-color: rgba(113, 113, 122, 0.7);
}

/* =========================================
   SHAKE ANIMATION FOR ERRORS
   ========================================= */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* =========================================
   DASHBOARD TOOLBAR
   ========================================= */
.dash-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.dash-view-btn {
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #27272a;
    background: transparent;
    color: #71717a;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: auto;
    min-width: auto;
}
.dash-view-btn.active,
.dash-view-btn:hover {
    background: #27272a;
    color: #fff;
    border-color: #3f3f46;
}
.dash-bulk-bar {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(250, 204, 21, 0.08);
    border: 1px solid rgba(250, 204, 21, 0.2);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}
.dash-bulk-bar.visible { display: flex; }

/* =========================================
   DASHBOARD LIST VIEW
   ========================================= */
.bp-list-view { display: none; }
.bp-list-view.active { display: block; }
.bp-grid-view.hidden-view { display: none; }

.list-row {
    display: grid;
    grid-template-columns: 1.5rem 3rem 1fr 8rem 5rem 4rem 4rem 7rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #27272a;
    transition: background 0.15s ease;
    font-size: 0.75rem;
}
.list-row:hover { background: rgba(255,255,255,0.02); }
.list-row.list-header {
    color: #52525b;
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #3f3f46;
    padding-bottom: 0.5rem;
}
.list-thumb {
    width: 3rem;
    height: 3rem;
    border-radius: 0.375rem;
    object-fit: cover;
    background: #18181b;
}
.list-check {
    width: 1rem;
    height: 1rem;
    accent-color: var(--banana-yellow);
    cursor: pointer;
}

/* Card checkboxes for bulk select */
.bp-card-check {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--banana-yellow);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
}
.bulk-mode .bp-card-check { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   QUICK-START TEMPLATES (studio preset chips)
   ═══════════════════════════════════════════════════════════════════════════ */
.preset-bar {
    margin: 4px 0 14px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.07);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(250,204,21,0.07) 0%, transparent 55%),
        rgba(255,255,255,0.02);
}
.preset-bar-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.preset-bar-label {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--banana-yellow);
}
.preset-bar-hint {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.02em;
}
.preset-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.preset-chips::-webkit-scrollbar { height: 6px; }
.preset-chips::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }
.preset-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: rgba(255,255,255,0.82);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s cubic-bezier(.22,.68,0,1.2),
                background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
                box-shadow 0.15s ease;
}
.preset-chip-ico {
    font-size: 15px;
    line-height: 1;
}
.preset-chip:hover {
    transform: translateY(-2px);
    background: rgba(250,204,21,0.12);
    border-color: rgba(250,204,21,0.4);
    color: #fff;
    box-shadow: 0 6px 18px rgba(250,204,21,0.18);
}
.preset-chip:active { transform: translateY(0) scale(0.97); }
.preset-chip.active {
    background: var(--banana-yellow);
    border-color: var(--banana-yellow);
    color: #000;
    box-shadow: 0 6px 22px rgba(250,204,21,0.4);
}

/* Light-mode theming for the Quick-Start bar */
html.light-mode .preset-bar {
    border-color: #e5e7eb;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(250,204,21,0.14) 0%, transparent 55%),
        #ffffff;
}
html.light-mode .preset-bar-label { color: #b45309; }
html.light-mode .preset-bar-hint  { color: #9ca3af; }
html.light-mode .preset-chip {
    color: #374151;
    background: #ffffff;
    border-color: #e5e7eb;
}
html.light-mode .preset-chip:hover {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #111827;
    box-shadow: 0 6px 18px rgba(250,204,21,0.22);
}
html.light-mode .preset-chip.active {
    background: var(--banana-yellow);
    border-color: var(--banana-yellow);
    color: #000;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIBRARY CARD OVERLAY — v2 (beautiful hover)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Base card wrapper ── */
.lib-card {
    position: relative;
    break-inside: avoid;
    border-radius: 16px;
    overflow: hidden;
    background: #111113;
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(.22,.68,0,1.2),
                box-shadow 0.35s ease,
                border-color 0.3s ease;
    cursor: pointer;
}
.lib-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(250,204,21,0.18);
    border-color: rgba(250,204,21,0.22);
}

/* ── Image wrapper ── */
.lib-card-img-wrap {
    position: relative;
    overflow: hidden;
    display: block;
    background: #0a0a0b;
}
.lib-card-img-wrap img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(.25,.46,.45,.94);
}
.lib-card:hover .lib-card-img-wrap img {
    transform: scale(1.07);
}

/* ── Always-visible bottom meta bar ── */
.lib-card-meta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 44px 14px 12px;
    background: linear-gradient(to top,
        rgba(0,0,0,0.92) 0%,
        rgba(0,0,0,0.55) 45%,
        transparent 100%);
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.lib-card:hover .lib-card-meta {
    opacity: 0;
    transform: translateY(8px);
}
.lib-card-meta-name {
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}
.lib-card-meta-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.06em;
}

/* ── Full hover overlay ── */
.lib-card-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(
        165deg,
        rgba(9,9,11,0.62) 0%,
        rgba(9,9,11,0.86) 100%
    );
    backdrop-filter: blur(6px) saturate(1.3);
    -webkit-backdrop-filter: blur(6px) saturate(1.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}
.lib-card:hover .lib-card-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* ── Overlay top: author chip (pinned) ── */
.lib-card-author {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100% - 24px);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px;
    padding: 3px 9px 3px 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translateY(-6px);
    opacity: 0;
    transition: transform 0.3s ease 0.05s, opacity 0.3s ease 0.05s;
}
.lib-card-author img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.lib-card:hover .lib-card-author {
    transform: translateY(0);
    opacity: 1;
}

/* ── Overlay center: action buttons ── */
.lib-card-actions {
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: 100%;
    max-width: 200px;
    transform: translateY(6px) scale(0.96);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(.22,.68,0,1.2) 0.06s, opacity 0.3s ease 0.06s;
}
.lib-card:hover .lib-card-actions {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.lib-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    line-height: 1;
}
.lib-card-btn:hover {
    transform: translateY(-1px);
}
.lib-card-btn-load {
    background: var(--banana-yellow);
    color: #000;
    box-shadow: 0 4px 20px rgba(250,204,21,0.35);
}
.lib-card-btn-load:hover {
    background: #fde047;
    box-shadow: 0 6px 28px rgba(250,204,21,0.55);
}
.lib-card-btn-view {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: none;
}
.lib-card-btn-view:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
}

/* ── Overlay bottom: prompt preview ── */
.lib-card-prompt {
    width: 100%;
    max-width: 220px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 9px;
    padding: 8px 10px;
    transform: translateY(6px);
    opacity: 0;
    transition: transform 0.3s ease 0.12s, opacity 0.3s ease 0.12s;
    overflow: hidden;
}
.lib-card:hover .lib-card-prompt {
    transform: translateY(0);
    opacity: 1;
}
.lib-card-prompt::before {
    content: "PROMPT";
    display: block;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: 0.18em;
    color: rgba(250,204,21,0.7);
    margin-bottom: 4px;
}
.lib-card-prompt p {
    font-size: 9px;
    font-weight: 500;
    color: rgba(255,255,255,0.6);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: 0.01em;
    font-family: ui-monospace, 'Cascadia Code', monospace;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   AI STUDIO AESTHETIC — Parameter cards, inputs, sidebar, outputs
   ═══════════════════════════════════════════════════════════════════════════ */

/* Entry animation */
@keyframes aiCardIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Parameter card (dark glass) */
.ai-param-card {
    background: #0c0c10;
    border: 1px solid #1f1f27;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}
.ai-param-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(250,204,21,0.18) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}
.ai-param-card:hover              { border-color: #2d2d3a; }
.ai-param-card:focus-within       { border-color: rgba(250,204,21,0.32); box-shadow: 0 0 0 1px rgba(250,204,21,0.06), 0 6px 24px rgba(0,0,0,0.4); }
.ai-param-card:focus-within::after { opacity: 1; }

/* Field header row */
.ai-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Field label */
.ai-field-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #4a4a5a;
}

/* Lock button */
.ai-lock-btn {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 5px;
    background: transparent;
    border: 1px solid #27272a;
    color: #3f3f46;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.ai-lock-btn:hover        { border-color: #52525b; color: #71717a; }
.ai-lock-btn.locked       { background: rgba(250,204,21,0.08); border-color: rgba(250,204,21,0.35); color: var(--banana-yellow); }
.ai-lock-btn.locked:hover { background: rgba(250,204,21,0.14); }

/* Text input */
.ai-field-input {
    width: 100%;
    background: #08080c;
    border: 1px solid #27272a;
    color: #d4d4d8;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 12px;
    border-radius: 8px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
    box-sizing: border-box;
    outline: none;
}
.ai-field-input::placeholder { color: #3f3f46; }
.ai-field-input:hover        { border-color: #3f3f46; }
.ai-field-input:focus        { border-color: rgba(250,204,21,0.45); box-shadow: 0 0 0 2px rgba(250,204,21,0.06); color: #f4f4f5; }
.ai-field-input.locked       { background: rgba(250,204,21,0.04); border-color: rgba(250,204,21,0.22); color: var(--banana-yellow); }

/* Dropdown trigger */
.ai-field-trigger {
    width: 100%;
    background: #08080c;
    border: 1px solid #27272a;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
    user-select: none;
}
.ai-trigger-text    { font-size: 13px; font-weight: 500; color: #4a4a5a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; transition: color 0.2s; }
.ai-trigger-chevron { flex-shrink: 0; color: #27272a; transition: color 0.2s; }

.ai-field-trigger:hover .ai-trigger-text    { color: #a1a1aa; }
.ai-field-trigger:hover .ai-trigger-chevron { color: #52525b; }
.ai-field-trigger:hover                     { border-color: #3f3f46; background: #0e0e14; }

.ai-field-trigger.configured .ai-trigger-text    { color: #e4e4e7; font-weight: 600; }
.ai-field-trigger.configured .ai-trigger-chevron { color: rgba(250,204,21,0.35); }
.ai-field-trigger.configured                     { border-color: rgba(250,204,21,0.18); }
.ai-field-trigger.configured:hover               { border-color: rgba(250,204,21,0.35); }

.ai-field-trigger.locked .ai-trigger-text    { color: var(--banana-yellow); }
.ai-field-trigger.locked .ai-trigger-chevron { color: rgba(250,204,21,0.3); }
.ai-field-trigger.locked                     { background: rgba(250,204,21,0.04); border-color: rgba(250,204,21,0.22); }

/* Sidebar: VS Code-style left-border active indicator */
#cat-nav button {
    border-left: 2px solid transparent;
    border-radius: 0 8px 8px 0;
    padding-left: 8px;
}
#cat-nav button:hover  { border-left-color: #3f3f46; background: #18181b; color: #d4d4d8; }
#cat-nav button.active { border-left-color: var(--banana-yellow); background: rgba(250,204,21,0.07); color: var(--banana-yellow) !important; }

/* Output panels terminal look */
.prompt-textarea {
    background: #030305 !important;
    color: rgba(250,204,21,0.85) !important;
    border: 1px solid #1a1a20 !important;
    font-family: ui-monospace, 'Fira Code', monospace !important;
    font-size: 12px !important;
    line-height: 1.7 !important;
    caret-color: var(--banana-yellow);
}
.json-pre {
    background: #030305 !important;
    color: rgba(52,211,153,0.85) !important;
    border: 1px solid #1a1a20 !important;
    font-family: ui-monospace, 'Fira Code', monospace !important;
}
.output-card { border-color: #1f1f27 !important; background: #08080c !important; }
.output-card:hover { border-color: #2d2d3a !important; }

/* Ambient top glow */
#mainApp { position: relative; }
#mainApp::before {
    content: '';
    pointer-events: none;
    position: absolute;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 600px; height: 160px;
    background: radial-gradient(ellipse at top, rgba(250,204,21,0.04) 0%, transparent 70%);
    z-index: 0;
}

/* Roll button glow */
#btn-randomize:hover { box-shadow: 0 0 20px rgba(250,204,21,0.25) !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT MODE overrides for AI components
   ═══════════════════════════════════════════════════════════════════════════ */
html.light-mode .ai-param-card            { background: #fff; border-color: #e5e7eb; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
html.light-mode .ai-param-card:hover      { border-color: #d1d5db; box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
html.light-mode .ai-param-card:focus-within { border-color: rgba(234,179,8,0.45); box-shadow: 0 0 0 2px rgba(234,179,8,0.08); }
html.light-mode .ai-field-label           { color: #9ca3af; }
html.light-mode .ai-lock-btn              { border-color: #e5e7eb; color: #d1d5db; background: #fff; }
html.light-mode .ai-lock-btn:hover        { border-color: #9ca3af; color: #6b7280; }
html.light-mode .ai-lock-btn.locked       { background: #fffbeb; border-color: rgba(234,179,8,0.4); color: #b45309; }
html.light-mode .ai-field-input           { background: #f9fafb; border-color: #e5e7eb; color: #111827; }
html.light-mode .ai-field-input::placeholder { color: #d1d5db; }
html.light-mode .ai-field-input:focus     { border-color: rgba(234,179,8,0.5); color: #111827; }
html.light-mode .ai-field-input.locked    { background: #fffbeb; border-color: rgba(234,179,8,0.35); color: #92400e; }
html.light-mode .ai-field-trigger         { background: #f9fafb; border-color: #e5e7eb; }
html.light-mode .ai-trigger-text          { color: #9ca3af; }
html.light-mode .ai-trigger-chevron       { color: #e5e7eb; }
html.light-mode .ai-field-trigger:hover   { background: #f3f4f6; border-color: #d1d5db; }
html.light-mode .ai-field-trigger:hover .ai-trigger-text { color: #374151; }
html.light-mode .ai-field-trigger.configured .ai-trigger-text { color: #111827; }
html.light-mode .ai-field-trigger.locked  { background: #fffbeb; border-color: rgba(234,179,8,0.35); }
html.light-mode .ai-field-trigger.locked .ai-trigger-text { color: #92400e; }
html.light-mode .output-card              { background: #fff !important; border-color: #e5e7eb !important; }
html.light-mode .prompt-textarea          { background: #fffbeb !important; color: #78350f !important; border-color: #fde68a !important; }
html.light-mode .json-pre                 { background: #f0fdf4 !important; color: #065f46 !important; border-color: #bbf7d0 !important; }
html.light-mode #cat-nav button.active    { border-left-color: #d97706; background: rgba(234,179,8,0.07); color: #b45309 !important; }
html.light-mode #cat-nav button:hover     { background: #f3f4f6; border-left-color: #e5e7eb; }

/* ════════════════════════════════════════════════════════════════════════
   UX ENHANCEMENTS — progress (#14), empty states (#13), share/help, tour (#8),
   accessibility focus (#17)
   ════════════════════════════════════════════════════════════════════════ */

/* ── Global build progress (#14) ─────────────────────────────────────── */
.studio-progress { margin: 14px 16px 0; }
.studio-progress-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
.studio-progress-label { font-size:10px; font-weight:900; letter-spacing:.1em; text-transform:uppercase; color:#71717a; }
.studio-progress-count { font-size:10px; font-weight:800; color:#a1a1aa; }
.studio-progress-track { height:6px; border-radius:999px; background:#27272a; overflow:hidden; }
.studio-progress-fill  { height:100%; width:0; border-radius:999px;
    background:linear-gradient(90deg,#eab308,var(--banana-yellow));
    box-shadow:0 0 12px rgba(250,204,21,.45); transition:width .35s cubic-bezier(.4,0,.2,1); }
html.light-mode .studio-progress-track { background:#e5e7eb; }
html.light-mode .studio-progress-label { color:#9ca3af; }
html.light-mode .studio-progress-count { color:#6b7280; }

/* ── Empty state (#13) ───────────────────────────────────────────────── */
.studio-empty { text-align:center; padding:48px 20px; border:1px dashed #27272a; border-radius:16px; background:rgba(39,39,42,.25); }
.studio-empty-icon { font-size:32px; margin-bottom:10px; opacity:.7; }
.studio-empty-title { font-size:14px; font-weight:800; color:#d4d4d8; margin-bottom:4px; }
.studio-empty-sub { font-size:12px; color:#71717a; max-width:360px; margin:0 auto; line-height:1.5; }
html.light-mode .studio-empty { border-color:#e5e7eb; background:#f9fafb; }
html.light-mode .studio-empty-title { color:#374151; }
html.light-mode .studio-empty-sub { color:#9ca3af; }

/* ── Share + tour-help buttons ───────────────────────────────────────── */
.share-btn { background:transparent; color:#a1a1aa; border-color:#3f3f46 !important; }
.share-btn:hover { background:#27272a; color:#fff; border-color:#52525b !important; }
.tour-help-btn { width:22px; height:22px; border-radius:999px; border:1px solid #3f3f46;
    background:transparent; color:#a1a1aa; font-size:12px; font-weight:900; cursor:pointer; line-height:1;
    display:inline-flex; align-items:center; justify-content:center; transition:all .15s; flex-shrink:0; }
.tour-help-btn:hover { background:var(--banana-yellow); color:#000; border-color:var(--banana-yellow); }

/* ── Onboarding tour (#8) ────────────────────────────────────────────── */
.tour-backdrop { position:fixed; inset:0; z-index:9998; background:transparent; }
.tour-spotlight { position:fixed; z-index:9999; border-radius:14px; pointer-events:none;
    box-shadow:0 0 0 3px rgba(250,204,21,.9), 0 0 0 9999px rgba(9,9,11,.72);
    transition:top .3s, left .3s, width .3s, height .3s; }
.tour-tip { position:fixed; z-index:10000; width:300px; max-width:calc(100vw - 24px);
    background:#18181b; border:1px solid #3f3f46; border-radius:16px; padding:16px;
    box-shadow:0 20px 50px rgba(0,0,0,.5); animation:tourIn .25s ease; }
@keyframes tourIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
.tour-step { font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:#eab308; margin-bottom:6px; }
.tour-title { font-size:15px; font-weight:900; color:#fff; margin-bottom:6px; }
.tour-body { font-size:12.5px; line-height:1.55; color:#a1a1aa; margin-bottom:14px; }
.tour-actions { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.tour-skip { background:transparent; border:none; color:#71717a; font-size:11px; font-weight:700; cursor:pointer; padding:6px 4px; }
.tour-skip:hover { color:#a1a1aa; }
.tour-next { background:var(--banana-yellow); color:#000; border:none; font-size:12px; font-weight:900; cursor:pointer; padding:8px 16px; border-radius:10px; transition:background .15s; }
.tour-next:hover { background:#fde047; }
html.light-mode .tour-tip { background:#fff; border-color:#e5e7eb; }
html.light-mode .tour-title { color:#111827; }
html.light-mode .tour-body { color:#6b7280; }

/* ── Accessibility focus rings (#17) ─────────────────────────────────── */
.ai-field-trigger:focus-visible,
#modalOptionsGrid [role="button"]:focus-visible,
#cat-nav button:focus-visible,
.tour-help-btn:focus-visible,
.share-btn:focus-visible,
.copy-btn-yellow:focus-visible,
.copy-btn-green:focus-visible,
.tour-next:focus-visible,
.tour-skip:focus-visible,
.gen-tab:focus-visible {
    outline:2px solid var(--banana-yellow); outline-offset:2px;
}

/* ── Generator switcher tabs (Image Prompt / Character) ──────────────── */
.gen-tabs { display:flex; gap:6px; padding:6px; margin:8px 16px 0;
    background:#18181b; border:1px solid #27272a; border-radius:14px; width:fit-content; }
.gen-tab { appearance:none; border:none; cursor:pointer; font-size:13px; font-weight:800;
    color:#a1a1aa; background:transparent; padding:8px 18px; border-radius:10px;
    display:inline-flex; align-items:center; gap:7px; transition:all .18s; white-space:nowrap; }
.gen-tab:hover { color:#fff; background:#27272a; }
.gen-tab.active { color:#000; background:linear-gradient(180deg,var(--banana-yellow),#eab308);
    box-shadow:0 4px 14px rgba(250,204,21,.3); }
@media (max-width:640px){ .gen-tabs { margin:8px 12px 0; width:auto; } .gen-tab { flex:1; justify-content:center; padding:9px 10px; } }
html.light-mode .gen-tabs { background:#f3f4f6; border-color:#e5e7eb; }
html.light-mode .gen-tab { color:#6b7280; }
html.light-mode .gen-tab:hover { color:#111827; background:#e5e7eb; }
html.light-mode .gen-tab.active { color:#000; }

/* ── Lock-tab button active (locked) state ───────────────────────────── */
.cat-roll-btn.active,
.mob-nav-icon.active {
    color:var(--banana-yellow) !important;
    border-color:rgba(250,204,21,0.45) !important;
    background:rgba(250,204,21,0.12) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT-MODE HEADER / NAV (top bar was staying dark)
   ═══════════════════════════════════════════════════════════════════════════ */
html.light-mode header.sticky {
    background: rgba(255,255,255,0.88) !important;
    border-bottom-color: #e5e7eb !important;
}
html.light-mode header .text-white { color: #111827 !important; }
html.light-mode header .text-zinc-300 { color: #374151 !important; }
html.light-mode header .text-zinc-400 { color: #6b7280 !important; }
html.light-mode header .text-zinc-500,
html.light-mode header .text-zinc-600 { color: #9ca3af !important; }
html.light-mode header nav a:hover,
html.light-mode header a.hover\:text-white:hover { color: #111827 !important; }
html.light-mode header .bg-zinc-900 { background: #f3f4f6 !important; }
html.light-mode header .border-zinc-800,
html.light-mode header .border-zinc-700 { border-color: #e5e7eb !important; }
html.light-mode header input { background: #f3f4f6 !important; color: #111827 !important; }
html.light-mode header input::placeholder { color: #9ca3af !important; }
/* user dropdown menu */
html.light-mode header .group .bg-zinc-900 { background: #ffffff !important; }
html.light-mode header .group a:hover { background: #f3f4f6 !important; }
/* mobile bottom nav (footer.php) */
html.light-mode nav.fixed.bottom-0 {
    background: rgba(255,255,255,0.95) !important;
    border-top-color: #e5e7eb !important;
}
html.light-mode nav.fixed.bottom-0 .text-zinc-500 { color: #6b7280 !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   BETA BANNER (above studio)
   ═══════════════════════════════════════════════════════════════════════════ */
.beta-banner {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 0 0 12px; padding: 8px 14px; border-radius: 12px;
    border: 1px solid rgba(250,204,21,0.28);
    background: linear-gradient(90deg, rgba(250,204,21,0.10), rgba(250,204,21,0.03));
    font-size: 12px;
}
.beta-pill {
    font-size: 9px; font-weight: 900; letter-spacing: 0.12em;
    background: var(--banana-yellow); color: #000; padding: 2px 7px; border-radius: 5px;
}
.beta-text { color: rgba(255,255,255,0.65); font-weight: 600; }
.beta-link {
    margin-left: auto; color: var(--banana-yellow); font-weight: 800; text-decoration: none;
    white-space: nowrap; transition: color .15s;
}
.beta-link:hover { color: #fde047; text-decoration: underline; }
html.light-mode .beta-text { color: #6b7280; }
html.light-mode .beta-banner { border-color: #fcd34d; background: #fffbeb; }
html.light-mode .beta-link { color: #b45309; }

/* ── Homepage polish (social pill light-mode + accents) ── */
html.light-mode #social-pill { background:#ffffff; border-color:#e5e7eb; box-shadow:0 4px 18px rgba(0,0,0,.06); }
html.light-mode #social-pill #social-text { color:#3f3f46; }
html.light-mode #social-pill #social-icon { color:#52525b; }
html.light-mode #social-pill:hover { border-color:#d4d4d8; background:#fafafa; }
#social-pill { transition: transform .35s cubic-bezier(.2,.7,.3,1), border-color .25s, background .25s, box-shadow .25s; }
/* hero headline subtle glow */
#heroSection h1 .text-yellow-500 { text-shadow:0 0 34px rgba(250,204,21,.28); }
/* stats numbers tick up nicely */
.counter { font-variant-numeric: tabular-nums; letter-spacing:-.01em; }
html.light-mode .border-y { border-color:#e5e7eb !important; }
