* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            min-height: 100vh;
            line-height: 1.6;
            background-image: 
                radial-gradient(ellipse at top, rgba(80, 194, 110, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at bottom right, rgba(20, 184, 166, 0.06) 0%, transparent 50%);
            background-attachment: fixed;
        }

        .header {
            background: linear-gradient(135deg, rgba(80, 194, 110, 0.95) 0%, rgba(61, 168, 90, 0.9) 50%, rgba(45, 138, 71, 0.85) 100%);
            backdrop-filter: blur(20px);
            padding: 1rem 1.5rem;
            text-align: center;
            box-shadow: var(--shadow-lg), inset 0 -1px 0 rgba(255, 255, 255, 0.1);
            position: sticky;
            top: 0;
            z-index: 100;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            overflow: visible;
        }

        .header-brand {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .header h1 {
            font-size: 1.5rem;
            font-weight: 700;
            margin: 0;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
            letter-spacing: -0.02em;
            white-space: nowrap;
        }

        .header p {
            display: none; /* Hide tagline in compact header */
        }

        .header-nav {
            display: flex;
            justify-content: center;
            gap: 0.5rem;
            flex-wrap: wrap;
            flex: 1;
        }

        .header-nav button {
            padding: 0.5rem 1rem;
            border: 1px solid rgba(255, 255, 255, 0.25);
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            color: white;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
            font-size: 0.85rem;
            transition: all 0.2s ease;
            letter-spacing: 0.01em;
        }

        .header-nav button:hover {
            background: rgba(255, 255, 255, 0.2);
            border-color: rgba(255, 255, 255, 0.4);
        }

        .header-nav button.active {
            background: white;
            color: var(--accent);
            border-color: white;
            box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
        }

        .header-nav .admin-link {
            padding: 0.5rem 1rem;
            border: 1px solid rgba(255, 255, 255, 0.2);
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            color: white;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
            font-size: 0.85rem;
            transition: all 0.2s ease;
            letter-spacing: 0.01em;
            text-decoration: none;
        }

        .header-nav .admin-link:hover {
            background: rgba(255, 255, 255, 0.2);
            border-color: rgba(255, 255, 255, 0.4);
        }

        /* User Auth Section */
        .user-auth {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex-shrink: 0;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.35rem 0.7rem 0.35rem 0.35rem;
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            border-radius: 6px;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .user-avatar {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: 2px solid rgba(255, 255, 255, 0.5);
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
        }

        .user-name {
            color: white;
            font-weight: 500;
            font-size: 0.8rem;
        }

        .auth-btn {
            padding: 0.4rem 0.9rem;
            border: 1px solid rgba(255, 255, 255, 0.25);
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            color: white;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
            font-size: 0.8rem;
            transition: all 0.2s;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
        }

        .auth-btn:hover {
            background: white;
            color: var(--accent);
            border-color: white;
        }

        .auth-btn.logout {
            border-color: rgba(255,255,255,0.25);
            padding: 0.4rem 0.9rem;
            font-size: 0.75rem;
        }

        .stats-bar {
            display: flex;
            justify-content: center;
            gap: 3rem;
            padding: 1.25rem 2rem;
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            border-bottom: 1px solid var(--border-color);
            flex-wrap: wrap;
        }

        .stat {
            text-align: center;
        }

        .stat-value {
            font-size: 1.75rem;
            font-weight: 700;
            background: var(--accent-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .stat-label {
            font-size: 0.75rem;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            font-weight: 500;
        }

        .container {
            max-width: 1800px;
            margin: 0 auto;
            padding: 1.5rem;
        }

        /* Generation Panel */
        .generate-panel {
            display: none;
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-xl);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
            box-shadow: var(--shadow-lg), var(--shadow-glow);
        }

        .generate-panel.active {
            display: block;
        }

        .generate-panel h2 {
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-size: 1.35rem;
            font-weight: 600;
        }

        .generate-form {
            display: grid;
            gap: 1rem;
        }

        .form-row {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 0.75rem;
        }

        .form-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .form-group label {
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .form-group input, .form-group select, .form-group textarea {
            padding: 0.85rem 1rem;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            background: var(--bg-input);
            color: var(--text-primary);
            font-size: 0.95rem;
            font-family: inherit;
            transition: all 0.2s;
        }

        .form-group textarea {
            min-height: 110px;
            resize: vertical;
        }

        .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(80, 194, 110, 0.15);
        }

        /* Advanced Options */
        .advanced-toggle {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            cursor: pointer;
            color: var(--accent);
            font-size: 0.9rem;
            padding: 0.75rem 0;
            margin-top: 0.5rem;
            user-select: none;
            transition: color 0.2s;
        }

        .advanced-toggle:hover {
            color: var(--accent-secondary);
        }

        .advanced-options {
            background: rgba(0, 0, 0, 0.2);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            padding: 1rem;
            margin-bottom: 1rem;
        }

        .slider-value {
            display: inline-block;
            min-width: 3rem;
            text-align: center;
            font-family: monospace;
            font-size: 0.9rem;
            color: var(--accent);
            background: rgba(80, 194, 110, 0.1);
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            margin-left: 0.5rem;
        }

        .param-info {
            font-size: 0.75rem;
            color: rgba(255, 255, 255, 0.5);
            font-weight: normal;
        }

        .form-group input[type="range"] {
            -webkit-appearance: none;
            width: 100%;
            height: 6px;
            border-radius: 3px;
            background: rgba(255, 255, 255, 0.1);
            outline: none;
            padding: 0;
        }

        .form-group input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: var(--accent);
            cursor: pointer;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
        }

        .form-group input[type="range"]::-moz-range-thumb {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: var(--accent);
            cursor: pointer;
            border: none;
        }

        .checkbox-group {
            flex-direction: row;
            align-items: center;
        }

        .checkbox-group input[type="checkbox"] {
            width: 18px;
            height: 18px;
            margin-right: 0.5rem;
            accent-color: var(--accent);
        }

        /* Prompt Helper Buttons */
        .prompt-helper-btn {
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 1rem;
        }

        .prompt-helper-btn:hover {
            transform: scale(1.1);
            filter: brightness(1.2);
        }

        /* Style Tag Buttons for Prompt Builder */
        .style-tag-btn {
            padding: 0.35rem 0.65rem;
            border-radius: 16px;
            border: 1px solid rgba(80, 194, 110, 0.3);
            background: rgba(80, 194, 110, 0.1);
            color: var(--text-primary);
            font-size: 0.75rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            white-space: nowrap;
            -webkit-tap-highlight-color: rgba(80, 194, 110, 0.3);
            touch-action: manipulation;
            user-select: none;
            -webkit-user-select: none;
        }

        .style-tag-btn:hover {
            background: rgba(80, 194, 110, 0.25);
            border-color: rgba(80, 194, 110, 0.5);
            transform: translateY(-1px);
        }

        .style-tag-btn:active {
            transform: translateY(0);
            background: rgba(80, 194, 110, 0.4);
            border-color: rgba(80, 194, 110, 0.7);
        }

        /* Mobile-friendly touch targets */
        @media (max-width: 768px) {
            .style-tag-btn {
                padding: 0.5rem 0.75rem;
                font-size: 0.8rem;
                min-height: 36px;
            }
            
            .prompt-helper-btn {
                min-width: 44px;
                min-height: 44px;
            }
        }

        /* Prompt Builder Section */
        .prompt-builder {
            padding: 0.75rem;
            background: rgba(0, 0, 0, 0.15);
            border-radius: var(--radius-md);
            border: 1px solid var(--border-color);
        }

        .generate-btn {
            padding: 1rem 2.5rem;
            background: var(--accent-gradient);
            border: none;
            border-radius: var(--radius-md);
            color: white;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.6rem;
            box-shadow: 0 4px 15px rgba(80, 194, 110, 0.35);
        }

        .generate-btn:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(80, 194, 110, 0.45);
        }

        .generate-btn:active:not(:disabled) {
            transform: translateY(0);
        }

        .generate-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
        }

        /* Incognito Mode Toggle */
        .incognito-toggle-row {
            display: flex;
            justify-content: center;
            margin-bottom: 1rem;
        }

        .incognito-toggle {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            cursor: pointer;
            padding: 0.6rem 1rem;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            transition: all 0.2s ease;
        }

        .incognito-toggle:hover {
            background: var(--surface-3);
            border-color: rgba(80, 194, 110, 0.3);
        }

        .incognito-toggle input {
            display: none;
        }

        .incognito-slider {
            position: relative;
            width: 42px;
            height: 22px;
            background: var(--surface-3);
            border-radius: 11px;
            transition: all 0.3s ease;
        }

        .incognito-slider::before {
            content: '';
            position: absolute;
            top: 3px;
            left: 3px;
            width: 16px;
            height: 16px;
            background: var(--text-muted);
            border-radius: 50%;
            transition: all 0.3s ease;
        }

        .incognito-toggle input:checked + .incognito-slider {
            background: linear-gradient(135deg, #50C26E, #3da85a);
        }

        .incognito-toggle input:checked + .incognito-slider::before {
            transform: translateX(20px);
            background: white;
        }

        .incognito-label {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.9rem;
            color: var(--text-secondary);
        }

        .incognito-icon {
            font-size: 1.1rem;
            transition: all 0.3s ease;
        }

        .incognito-toggle input:checked ~ .incognito-label .incognito-icon {
            filter: drop-shadow(0 0 4px rgba(80, 194, 110, 0.8));
        }

        .incognito-hint {
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        /* Active incognito state */
        .incognito-toggle.active {
            background: rgba(80, 194, 110, 0.15);
            border-color: rgba(80, 194, 110, 0.4);
        }

        .incognito-toggle.active .incognito-label {
            color: #50C26E;
        }

        /* NSFW Toggle - similar to incognito but with red/pink colors */
        .nsfw-toggle-row {
            display: none;  /* Hidden by default, shown via JS for allowed users */
            justify-content: center;
            margin-bottom: 1rem;
        }

        .nsfw-toggle {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            cursor: pointer;
            padding: 0.6rem 1rem;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            transition: all 0.2s ease;
        }

        .nsfw-toggle:hover {
            background: var(--surface-3);
            border-color: rgba(239, 68, 68, 0.3);
        }

        .nsfw-toggle input {
            display: none;
        }

        .nsfw-slider {
            position: relative;
            width: 42px;
            height: 22px;
            background: var(--surface-3);
            border-radius: 11px;
            transition: all 0.3s ease;
        }

        .nsfw-slider::before {
            content: '';
            position: absolute;
            top: 3px;
            left: 3px;
            width: 16px;
            height: 16px;
            background: var(--text-muted);
            border-radius: 50%;
            transition: all 0.3s ease;
        }

        .nsfw-toggle input:checked + .nsfw-slider {
            background: linear-gradient(135deg, #ef4444, #f472b6);
        }

        .nsfw-toggle input:checked + .nsfw-slider::before {
            transform: translateX(20px);
            background: white;
        }

        .nsfw-label {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.9rem;
            color: var(--text-secondary);
        }

        .nsfw-icon {
            font-size: 1.1rem;
            transition: all 0.3s ease;
        }

        .nsfw-toggle input:checked ~ .nsfw-label .nsfw-icon {
            filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.8));
        }

        .nsfw-hint {
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .nsfw-toggle.active {
            background: rgba(239, 68, 68, 0.15);
            border-color: rgba(239, 68, 68, 0.4);
        }

        .nsfw-toggle.active .nsfw-label {
            color: #f87171;
        }

        /* Edit Mode / Source Image Input */
        .edit-mode-row {
            margin-bottom: 1rem;
        }

        .edit-mode-input {
            display: flex;
            gap: 0.5rem;
            align-items: center;
        }

        .edit-mode-input input {
            flex: 1;
            padding: 0.75rem;
            background: var(--surface-2);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            color: var(--text);
            font-size: 0.9rem;
        }

        .edit-mode-input input:focus {
            outline: none;
            border-color: rgba(59, 130, 246, 0.5);
        }

        .edit-mode-input label {
            font-size: 0.85rem;
            color: var(--text-secondary);
            white-space: nowrap;
        }

        .edit-mode-hint {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-top: 0.25rem;
        }

        .access-denied-msg {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 1rem 1.25rem;
            background: rgba(239, 68, 68, 0.15);
            border: 1px solid rgba(239, 68, 68, 0.3);
            border-radius: var(--radius-md);
            color: #fca5a5;
            font-size: 0.9rem;
            margin-top: 0.75rem;
        }

        .access-denied-msg svg {
            flex-shrink: 0;
            color: #f87171;
        }

        .access-denied-msg a {
            color: #93c5fd;
            text-decoration: underline;
        }

        .access-denied-msg a:hover {
            color: #bfdbfe;
        }

        /* Preset buttons */
        .preset-btn {
            padding: 0.5rem 0.75rem;
            border: 1px solid var(--border-color);
            background: rgba(0, 0, 0, 0.2);
            color: var(--text-primary);
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 0.8rem;
            font-weight: 500;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 0.3rem;
        }

        .preset-btn:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        .preset-btn.save {
            border-color: rgba(80, 194, 110, 0.4);
        }

        .preset-btn.save:hover {
            background: rgba(80, 194, 110, 0.2);
            border-color: var(--accent);
        }

        .preset-btn.delete {
            border-color: rgba(239, 68, 68, 0.4);
        }

        .preset-btn.delete:hover {
            background: rgba(239, 68, 68, 0.2);
            border-color: #ef4444;
        }

        #preset-selector {
            padding: 0.5rem 0.75rem;
            background: var(--bg-input);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            color: var(--text-primary);
            font-size: 0.85rem;
        }

        /* Mode Toggle Buttons */
        .mode-toggle {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .mode-btn {
            flex: 1;
            min-width: 130px;
            padding: 0.7rem 1rem;
            border: 2px solid var(--border-color);
            background: rgba(0, 0, 0, 0.2);
            color: var(--text-primary);
            border-radius: var(--radius-md);
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 500;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.4rem;
        }

        .mode-btn:hover {
            border-color: var(--accent);
            background: rgba(80, 194, 110, 0.15);
        }

        .mode-btn.active {
            border-color: var(--accent);
            background: var(--accent-gradient);
            color: white;
            box-shadow: 0 4px 15px rgba(80, 194, 110, 0.3);
        }

        .mode-btn .badge {
            font-size: 0.65rem;
            background: rgba(20, 184, 166, 0.25);
            color: var(--accent-secondary);
            padding: 0.2rem 0.5rem;
            border-radius: 20px;
            font-weight: 600;
        }

        .mode-btn.active .badge {
            background: rgba(255, 255, 255, 0.2);
            color: #fff;
        }

        /* Multi-model select styling */
        .mm-model-select {
            padding: 0.65rem;
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            color: var(--text-primary);
            font-size: 0.9rem;
            width: 100%;
        }

        .mm-model-select:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(80, 194, 110, 0.15);
        }

        /* Multi-model card styling */
        .mm-model-card {
            background: rgba(15, 25, 20, 0.6);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            padding: 0.75rem;
            transition: all 0.2s ease;
        }

        .mm-model-card:hover {
            border-color: var(--accent);
            background: rgba(20, 35, 28, 0.7);
        }

        .mm-model-card:has(select:not([value=""])) {
            border-color: var(--accent-secondary);
            box-shadow: 0 0 12px rgba(80, 194, 110, 0.1);
        }

        /* Multi-model options panel */
        .mm-options {
            background: rgba(0, 0, 0, 0.25);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            padding: 0.65rem;
            margin-top: 0.5rem;
        }

        .mm-options-row {
            display: flex;
            gap: 0.5rem;
            align-items: center;
            flex-wrap: wrap;
        }

        .mm-options label {
            color: var(--text-secondary);
            font-size: 0.75rem;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

        .mm-options input[type="number"] {
            width: 65px;
            padding: 0.4rem 0.5rem;
            background: rgba(0, 0, 0, 0.4);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 6px;
            color: var(--text-primary);
            font-size: 0.85rem;
            font-family: 'Inter', monospace;
            transition: all 0.2s ease;
        }

        .mm-options input[type="number"]:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(80, 194, 110, 0.15);
            background: rgba(0, 0, 0, 0.5);
        }

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

        .mm-options textarea {
            width: 100%;
            padding: 0.4rem 0.5rem;
            background: rgba(0, 0, 0, 0.4);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 6px;
            color: var(--text-primary);
            font-size: 0.8rem;
            font-family: 'Inter', sans-serif;
            resize: none;
            transition: all 0.2s ease;
            margin-top: 0.4rem;
        }

        .mm-options textarea:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(80, 194, 110, 0.15);
            background: rgba(0, 0, 0, 0.5);
        }

        .mm-options textarea::placeholder {
            color: var(--text-secondary);
            opacity: 0.6;
        }

        /* Multimodel grid layout */
        .multimodel-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.75rem;
        }

        @media (max-width: 600px) {
            .multimodel-grid {
                grid-template-columns: 1fr;
            }
        }

        /* Batch Preview Grid */
        .batch-preview {
            margin-top: 1.5rem;
        }

        .batch-preview h3 {
            margin-bottom: 1rem;
            color: var(--accent-secondary);
            font-weight: 600;
        }

        .batch-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
        }

        .batch-item {
            position: relative;
            background: rgba(0, 0, 0, 0.3);
            border-radius: var(--radius-md);
            overflow: hidden;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            border: 3px solid transparent;
        }

        .batch-item:hover {
            border-color: var(--accent);
            transform: scale(1.02);
            box-shadow: var(--shadow-lg);
        }

        .batch-item.selected {
            border-color: var(--accent-secondary);
            box-shadow: 0 0 25px rgba(20, 184, 166, 0.4);
        }

        .batch-item img {
            width: 100%;
            aspect-ratio: 1;
            object-fit: cover;
            display: block;
        }

        .batch-item-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.85) 100%);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            padding: 0.85rem;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .batch-item:hover .batch-item-overlay {
            opacity: 1;
        }

        .batch-item.selected .batch-item-overlay {
            opacity: 1;
        }

        .batch-item-number {
            background: var(--accent-gradient);
            color: #fff;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.85rem;
            box-shadow: var(--shadow-md);
        }

        .batch-item-actions {
            display: flex;
            gap: 0.5rem;
            justify-content: center;
        }

        .batch-expand-btn {
            background: rgba(255, 255, 255, 0.9);
            color: #333;
            border: none;
            width: 36px;
            height: 36px;
            border-radius: var(--radius-md);
            cursor: pointer;
            font-size: 1.1rem;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .batch-expand-btn:hover {
            transform: scale(1.1);
            background: #fff;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        .batch-select-btn {
            background: linear-gradient(135deg, var(--accent-secondary), #0d9488);
            color: #fff;
            border: none;
            padding: 0.6rem 1.25rem;
            border-radius: var(--radius-md);
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 0.4rem;
            transition: all 0.2s;
        }

        .batch-select-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
        }

        .batch-loading {
            text-align: center;
            padding: 3rem;
        }

        .batch-loading-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
        }

        .batch-loading-item {
            aspect-ratio: 1;
            background: linear-gradient(135deg, rgba(80, 194, 110, 0.1), rgba(61, 168, 90, 0.1));
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            animation: pulse 1.5s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 0.4; }
            50% { opacity: 0.8; }
        }

        /* Session History Grid - images accumulate here (now in sidebar) */
        .session-history {
            padding: 1rem;
            background: var(--bg-card);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-color);
            height: 100%;
            min-height: 400px;
            max-height: calc(100vh - 200px);
            overflow-y: auto;
        }

        .session-history h3 {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1rem;
            color: var(--accent-secondary);
            font-weight: 600;
            font-size: 0.95rem;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .session-history h3 .count {
            background: rgba(80, 194, 110, 0.2);
            color: var(--accent);
            font-size: 0.8rem;
            padding: 0.25rem 0.6rem;
            border-radius: 12px;
            font-weight: 600;
        }

        .session-history-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            gap: 0.5rem;
        }

        /* Generate panel with sidebar layout */
        .generate-layout {
            display: grid;
            grid-template-columns: 1fr 320px;
            gap: 1.5rem;
            min-height: calc(100vh - 280px);
        }

        .generate-main {
            display: flex;
            flex-direction: column;
        }

        .generate-sidebar {
            display: flex;
            flex-direction: column;
        }

        @media (max-width: 1200px) {
            .generate-layout {
                grid-template-columns: 1fr;
            }

            .session-history {
                max-height: 350px;
            }
        }

        .session-item {
            position: relative;
            aspect-ratio: 1;
            border-radius: var(--radius-md);
            overflow: hidden;
            cursor: pointer;
            transition: all 0.2s;
            background: rgba(0, 0, 0, 0.3);
        }

        .session-item:hover {
            transform: scale(1.03);
            box-shadow: var(--shadow-lg);
        }

        .session-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .session-item.generating {
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, rgba(80, 194, 110, 0.15), rgba(20, 184, 166, 0.15));
            animation: pulse 1.5s infinite;
        }

        .session-item.generating .gen-number {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--accent);
        }

        .session-item.failed {
            background: rgba(239, 68, 68, 0.15);
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        .session-item.failed::after {
            content: '✕';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 1.5rem;
            color: rgba(239, 68, 68, 0.7);
        }

        .session-item-number {
            position: absolute;
            top: 0.4rem;
            left: 0.4rem;
            background: rgba(0, 0, 0, 0.7);
            color: #fff;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.7rem;
        }

        .session-polish-badge {
            position: absolute;
            top: 0.4rem;
            right: 0.4rem;
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(147, 51, 234, 0.9) 100%);
            padding: 2px 5px;
            border-radius: 4px;
            font-size: 0.65rem;
            box-shadow: 0 2px 8px rgba(147, 51, 234, 0.4);
            pointer-events: none;
        }

        .clear-session-btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 0.8rem;
            cursor: pointer;
            transition: color 0.2s;
        }

        .clear-session-btn:hover {
            color: var(--accent);
        }

        .session-cost {
            background: rgba(147, 51, 234, 0.2);
            color: #a78bfa;
            font-size: 0.8rem;
            padding: 0.25rem 0.6rem;
            border-radius: 12px;
            font-weight: 600;
            margin-left: 0.5rem;
        }

        .session-header-stats {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        /* Bulk Generation Section */
        .bulk-generation-section {
            margin-top: 0.75rem;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            background: rgba(80, 194, 110, 0.03);
        }

        .bulk-gen-toggle {
            padding: 0.75rem 1rem;
            cursor: pointer;
            font-weight: 600;
            color: var(--text);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            user-select: none;
            transition: background 0.2s;
        }

        .bulk-gen-toggle:hover {
            background: rgba(80, 194, 110, 0.08);
        }

        .bulk-gen-content {
            padding: 0 1rem 1rem 1rem;
        }

        .bulk-gen-instructions {
            font-size: 0.85rem;
            color: var(--text-secondary);
            margin-bottom: 0.75rem;
        }

        .bulk-prompts-textarea {
            width: 100%;
            min-height: 120px;
            padding: 0.75rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            color: var(--text);
            font-family: inherit;
            font-size: 0.9rem;
            resize: vertical;
            margin-bottom: 0.75rem;
        }

        .bulk-prompts-textarea:focus {
            outline: none;
            border-color: var(--accent);
        }

        .bulk-gen-actions {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 0.75rem;
        }

        .file-upload-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.5rem 0.75rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            color: var(--text);
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .file-upload-btn:hover {
            border-color: var(--accent);
            background: rgba(80, 194, 110, 0.1);
        }

        .bulk-count {
            margin-left: auto;
            font-size: 0.85rem;
            color: var(--text-secondary);
            font-weight: 600;
        }

        .bulk-gen-btn {
            width: 100%;
        }

        /* Model cost indicator in dropdown */
        .model-cost {
            color: var(--text-secondary);
            font-size: 0.85em;
            opacity: 0.8;
        }

        /* Stats bar pulse animation for updates */
        .stat-value.updated {
            animation: stat-pulse 0.5s ease-out;
        }

        @keyframes stat-pulse {
            0% { transform: scale(1); color: var(--text-primary); }
            50% { transform: scale(1.1); color: var(--accent); }
            100% { transform: scale(1); color: var(--text-primary); }
        }

        .generate-preview {
            margin-top: 1rem;
            display: none;
        }

        .generate-preview.active {
            display: block;
        }

        .preview-container {
            display: grid;
            grid-template-columns: auto 1fr;
            gap: 1rem;
            align-items: start;
        }

        .preview-image {
            max-width: 280px;
            border-radius: var(--radius-lg);
            max-height: 280px;
            object-fit: contain;
            background: rgba(0, 0, 0, 0.5);
            box-shadow: var(--shadow-lg);
        }

        .preview-info {
            padding: 1rem;
            background: rgba(0,0,0,0.25);
            border-radius: var(--radius-md);
            border: 1px solid var(--border-color);
            font-size: 0.9rem;
        }

        /* Non-blocking generation status toast */
        .generation-status {
            position: fixed;
            bottom: 24px;
            right: 24px;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            padding: 1rem 1.25rem;
            display: none;
            align-items: center;
            gap: 1rem;
            z-index: 1500;
            box-shadow: 0 8px 32px rgba(0,0,0,0.4);
            backdrop-filter: blur(20px);
            min-width: 280px;
            max-width: 400px;
            animation: slideInUp 0.3s ease-out;
        }

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

        .generation-status.active {
            display: flex;
        }

        .generation-status.has-queue {
            flex-direction: column;
            align-items: stretch;
        }

        .generation-status-main {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .generation-spinner {
            width: 32px;
            height: 32px;
            border: 3px solid rgba(255,255,255,0.1);
            border-top-color: var(--accent);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            flex-shrink: 0;
        }

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

        .generation-status-text {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
            flex: 1;
        }

        .generation-status-title {
            font-size: 0.95rem;
            color: var(--text-primary);
            font-weight: 600;
        }

        .generation-status-subtitle {
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        .generation-queue {
            margin-top: 0.75rem;
            padding-top: 0.75rem;
            border-top: 1px solid var(--border-color);
        }

        .generation-queue-title {
            font-size: 0.75rem;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.5rem;
        }

        .generation-queue-items {
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
            max-height: 150px;
            overflow-y: auto;
        }

        .queue-item {
            font-size: 0.85rem;
            color: var(--text-secondary);
            padding: 0.35rem 0.5rem;
            background: rgba(255,255,255,0.03);
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .queue-item-number {
            width: 20px;
            height: 20px;
            background: var(--accent);
            border-radius: 50%;
            font-size: 0.7rem;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 600;
        }

        .queue-item-prompt {
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* Legacy overlay - hidden but kept for backwards compat */
        .loading-overlay {
            display: none !important;
        }

        .filters {
            display: flex;
            gap: 1rem;
            margin-bottom: 2rem;
            flex-wrap: wrap;
            align-items: flex-end;
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            padding: 1.25rem;
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-color);
        }

        .filter-group {
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
        }

        .filter-group label {
            font-size: 0.7rem;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            font-weight: 500;
        }

        .filter-group select, .filter-group input {
            padding: 0.6rem 0.85rem;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-color);
            background: var(--bg-input);
            color: var(--text-primary);
            min-width: 150px;
            font-size: 0.9rem;
            transition: all 0.2s;
        }

        .filter-group select:focus, .filter-group input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(80, 194, 110, 0.15);
        }

        /* Toggle Switch for NSFW filter */
        .toggle-switch {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            cursor: pointer;
            padding: 0.5rem;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: var(--radius);
        }

        .toggle-switch input {
            display: none;
        }

        .toggle-slider {
            position: relative;
            width: 36px;
            height: 20px;
            background: var(--surface-3);
            border-radius: 10px;
            transition: all 0.3s ease;
        }

        .toggle-slider::before {
            content: '';
            position: absolute;
            top: 2px;
            left: 2px;
            width: 16px;
            height: 16px;
            background: #888;
            border-radius: 50%;
            transition: all 0.3s ease;
        }

        .toggle-switch input:checked + .toggle-slider {
            background: linear-gradient(135deg, #ef4444, #f472b6);
        }

        .toggle-switch input:checked + .toggle-slider::before {
            transform: translateX(16px);
            background: white;
        }

        .toggle-label {
            font-size: 0.85rem;
            color: var(--text-muted);
        }

        .toggle-switch:hover {
            border-color: rgba(239, 68, 68, 0.4);
        }

        .search-box {
            flex: 1;
            min-width: 220px;
        }

        .search-box input {
            width: 100%;
        }

        .gallery {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1.5rem;
        }

        /* Grid size variants */
        .gallery.grid-xs {
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: 0.75rem;
        }
        .gallery.grid-sm {
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 1rem;
        }
        .gallery.grid-md {
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1.5rem;
        }
        .gallery.grid-lg {
            grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
            gap: 1.75rem;
        }
        .gallery.grid-xl {
            grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
            gap: 2rem;
        }

        /* Compact info for smaller grid sizes */
        .gallery.grid-xs .image-info,
        .gallery.grid-sm .image-info {
            padding: 0.5rem;
        }
        .gallery.grid-xs .image-prompt,
        .gallery.grid-sm .image-prompt {
            font-size: 0.7rem;
            -webkit-line-clamp: 1;
        }
        .gallery.grid-xs .image-meta,
        .gallery.grid-sm .image-meta {
            font-size: 0.65rem;
        }
        .gallery.grid-xs .image-actions,
        .gallery.grid-sm .image-actions {
            padding: 0.4rem;
        }
        .gallery.grid-xs .action-btn,
        .gallery.grid-sm .action-btn {
            padding: 0.3rem 0.5rem;
            font-size: 0.65rem;
        }

        .image-card {
            background: var(--bg-card);
            backdrop-filter: blur(10px);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            overflow: hidden;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
        }

        .image-card:hover {
            transform: translateY(-6px);
            box-shadow: var(--shadow-lg), var(--shadow-glow);
            border-color: rgba(80, 194, 110, 0.3);
        }

        .image-wrapper {
            position: relative;
            padding-top: 100%;
            overflow: hidden;
            cursor: pointer;
        }

        .image-wrapper img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .image-card:hover .image-wrapper img {
            transform: scale(1.08);
        }

        .image-actions {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 0.75rem;
            background: linear-gradient(transparent, rgba(0,0,0,0.85));
            display: flex;
            justify-content: center;
            gap: 0.5rem;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .image-card:hover .image-actions {
            opacity: 1;
        }

        /* Grid size selector */
        .grid-size-selector {
            display: flex;
            gap: 0.25rem;
            background: var(--bg-card);
            padding: 0.25rem;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-color);
        }

        .grid-size-btn {
            padding: 0.4rem 0.6rem;
            background: none;
            border: none;
            border-radius: 4px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.85rem;
            line-height: 1;
        }

        .grid-size-btn:hover {
            color: var(--text-primary);
            background: rgba(255,255,255,0.1);
        }

        .grid-size-btn.active {
            background: var(--accent);
            color: white;
        }

        .action-btn {
            padding: 0.5rem 0.85rem;
            background: var(--accent);
            border: none;
            border-radius: var(--radius-sm);
            color: white;
            font-size: 0.75rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 0.3rem;
        }

        .action-btn:hover {
            background: #4f46e5;
            transform: scale(1.05);
        }

        .action-btn.secondary {
            background: rgba(255,255,255,0.15);
            backdrop-filter: blur(5px);
        }

        .action-btn.secondary:hover {
            background: rgba(255,255,255,0.25);
        }

        .private-badge {
            position: absolute;
            top: 8px;
            right: 8px;
            background: rgba(0, 0, 0, 0.75);
            backdrop-filter: blur(4px);
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.75rem;
            z-index: 5;
            pointer-events: none;
        }

        .source-badge {
            position: absolute;
            top: 8px;
            right: 36px;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(4px);
            padding: 4px 6px;
            border-radius: 4px;
            font-size: 0.65rem;
            z-index: 5;
            pointer-events: none;
            opacity: 0.8;
        }

        .source-badge.no-private {
            right: 8px;
        }

        .image-card:hover .source-badge {
            opacity: 1;
        }

        body:not(.show-source-badges) .source-badge {
            display: none;
        }

        .nsfw-badge {
            position: absolute;
            top: 8px;
            right: 40px;
            background: rgba(239, 68, 68, 0.85);
            backdrop-filter: blur(4px);
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.75rem;
            z-index: 5;
            pointer-events: none;
        }

        .wallpaper-badge {
            position: absolute;
            top: 8px;
            left: 8px;
            background: rgba(139, 92, 246, 0.85);
            backdrop-filter: blur(4px);
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.75rem;
            z-index: 5;
            pointer-events: none;
        }

        .polished-badge {
            position: absolute;
            top: 8px;
            left: 50px;
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.9) 0%, rgba(147, 51, 234, 0.9) 100%);
            backdrop-filter: blur(4px);
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.75rem;
            z-index: 5;
            pointer-events: none;
            box-shadow: 0 2px 8px rgba(147, 51, 234, 0.4);
        }

        .original-badge {
            position: absolute;
            top: 8px;
            left: 50px;
            background: rgba(107, 114, 128, 0.85);
            backdrop-filter: blur(4px);
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.75rem;
            z-index: 5;
            pointer-events: none;
        }

        /* Video card styles */
        .video-card .video-play-overlay {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, 0.3);
            opacity: 0;
            transition: opacity 0.3s;
        }

        .video-card:hover .video-play-overlay {
            opacity: 1;
        }

        .video-play-overlay .play-icon {
            width: 60px;
            height: 60px;
            background: rgba(255, 255, 255, 0.9);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            color: #000;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
            transition: transform 0.2s;
        }

        .video-card:hover .play-icon {
            transform: scale(1.1);
        }

        .video-duration {
            position: absolute;
            bottom: 8px;
            right: 8px;
            background: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 0.75rem;
            font-weight: 500;
        }

        .video-placeholder {
            width: 100%;
            aspect-ratio: 16/9;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, var(--bg-card) 0%, rgba(80, 194, 110, 0.2) 100%);
            font-size: 3rem;
        }

        .video-thumb {
            width: 100%;
            aspect-ratio: 16/9;
            object-fit: cover;
            background: var(--bg-card);
            pointer-events: none;
        }

        .modal-video {
            max-width: 100%;
            max-height: 70vh;
            border-radius: 12px;
        }

        .modal-btn {
            padding: 0.6rem 1.2rem;
            border: none;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-weight: 500;
            font-size: 0.9rem;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            transition: all 0.2s;
        }

        .modal-btn.primary {
            background: var(--accent);
            color: white;
        }

        .modal-btn.primary:hover {
            background: var(--accent-secondary);
        }

        .modal-btn.secondary {
            background: rgba(255, 255, 255, 0.1);
            color: var(--text-primary);
            border: 1px solid var(--border-color);
        }

        .modal-btn.secondary:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .image-info {
            padding: 0.85rem 1rem;
        }

        .image-prompt-wrapper {
            position: relative;
            display: flex;
            align-items: flex-start;
            gap: 0.5rem;
        }

        .image-prompt {
            font-size: 0.85rem;
            line-height: 1.45;
            max-height: 3rem;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            color: var(--text-primary);
            flex: 1;
        }

        .copy-prompt-btn {
            flex-shrink: 0;
            background: transparent;
            border: none;
            font-size: 0.9rem;
            padding: 0.15rem 0.3rem;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.2s, transform 0.15s, background 0.2s;
            border-radius: 4px;
        }

        .image-card:hover .copy-prompt-btn {
            opacity: 0.7;
        }

        .copy-prompt-btn:hover {
            opacity: 1 !important;
            background: rgba(var(--accent-rgb), 0.15);
            transform: scale(1.1);
        }

        .copy-prompt-btn.copied {
            opacity: 1 !important;
            color: #22c55e;
        }

        .image-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 0.4rem 0.75rem;
            margin-top: 0.6rem;
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

        .image-meta span {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
        }

        .image-meta .meta-cost {
            color: #a78bfa;
            font-weight: 500;
        }

        .image-meta .meta-size {
            color: #14b8a6;
        }

        .image-meta .meta-time {
            color: var(--text-secondary);
            opacity: 0.8;
        }

        .image-meta .meta-model {
            color: var(--accent-secondary);
            max-width: 120px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .image-meta .meta-style {
            color: #f472b6;
            font-size: 0.7rem;
        }

        .image-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 0.3rem;
            margin-top: 0.4rem;
            margin-bottom: 0.2rem;
        }

        .tag-chip {
            display: inline-block;
            padding: 0.15rem 0.5rem;
            background: rgba(124, 58, 237, 0.2);
            border: 1px solid rgba(124, 58, 237, 0.3);
            border-radius: 12px;
            font-size: 0.65rem;
            color: #a78bfa;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .tag-chip:hover {
            background: rgba(124, 58, 237, 0.4);
            border-color: rgba(124, 58, 237, 0.6);
        }

        .tag-more {
            display: inline-block;
            padding: 0.15rem 0.5rem;
            background: rgba(100, 100, 100, 0.2);
            border-radius: 12px;
            font-size: 0.65rem;
            color: var(--text-secondary);
        }

        .tag {
            display: inline-block;
            padding: 0.25rem 0.6rem;
            background: linear-gradient(135deg, var(--accent), #3da85a);
            border-radius: 20px;
            font-size: 0.68rem;
            font-weight: 500;
            margin-right: 0.3rem;
        }

        .pagination {
            display: flex;
            justify-content: center;
            gap: 0.6rem;
            margin-top: 2.5rem;
            flex-wrap: wrap;
        }

        .pagination button {
            padding: 0.65rem 1.25rem;
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            background: var(--bg-card);
            color: var(--text-primary);
            cursor: pointer;
            font-weight: 500;
            transition: all 0.2s;
        }

        .pagination button:hover:not(:disabled) {
            background: var(--accent);
            border-color: var(--accent);
            color: white;
        }

        .pagination button:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .pagination button.active {
            background: var(--accent-gradient);
            border-color: var(--accent);
            color: white;
        }

        .loading {
            text-align: center;
            padding: 4rem;
            font-size: 1.1rem;
            color: var(--text-secondary);
        }

        /* Skeleton loader animation */
        @keyframes skeleton-pulse {
            0% { opacity: 0.6; }
            50% { opacity: 0.3; }
            100% { opacity: 0.6; }
        }

        .skeleton-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1.5rem;
        }

        .skeleton-card {
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-lg);
            overflow: hidden;
            animation: skeleton-pulse 1.5s ease-in-out infinite;
        }

        .skeleton-image {
            aspect-ratio: 1;
            background: linear-gradient(135deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%);
            background-size: 200% 100%;
            animation: skeleton-shimmer 1.5s infinite;
        }

        @keyframes skeleton-shimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        .skeleton-text {
            height: 1rem;
            background: var(--surface-3);
            border-radius: 4px;
            margin: 0.5rem 1rem;
        }

        .skeleton-text.short {
            width: 60%;
        }

        .skeleton-meta {
            display: flex;
            gap: 1rem;
            padding: 0.5rem 1rem 1rem;
        }

        .skeleton-meta-item {
            height: 0.75rem;
            width: 80px;
            background: var(--surface-3);
            border-radius: 4px;
        }

        /* Modal */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(13, 13, 26, 0.95);
            backdrop-filter: blur(10px);
            z-index: 1000;
            overflow: auto;
        }

        .modal.active {
            display: flex;
            justify-content: center;
            align-items: flex-start;
            padding: 2rem;
        }

        .modal-content {
            max-width: 1200px;
            width: 100%;
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-xl);
            overflow: hidden;
            box-shadow: var(--shadow-lg), var(--shadow-glow);
        }

        .modal-image {
            width: 100%;
            max-height: 70vh;
            object-fit: contain;
            background: rgba(0, 0, 0, 0.5);
        }

        .modal-info {
            padding: 1.75rem;
        }

        .modal-prompt {
            font-size: 1rem;
            line-height: 1.7;
            margin-bottom: 1.25rem;
            color: var(--text-primary);
        }

        .modal-details {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 1rem;
            font-size: 0.9rem;
        }

        .detail-item {
            padding: 0.75rem;
            background: rgba(0, 0, 0, 0.2);
            border-radius: var(--radius-sm);
            border: 1px solid var(--border-color);
        }

        .detail-label {
            font-size: 0.7rem;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.04em;
            font-weight: 500;
            margin-bottom: 0.25rem;
        }

        .modal-close {
            position: fixed;
            top: 1.25rem;
            right: 1.25rem;
            background: var(--accent-gradient);
            border: none;
            color: white;
            width: 44px;
            height: 44px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.5rem;
            z-index: 1001;
            transition: all 0.2s;
            box-shadow: var(--shadow-md);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .modal-close:hover {
            transform: scale(1.1) rotate(90deg);
        }

        .modal-actions {
            display: flex;
            gap: 0.6rem;
            margin-top: 1.25rem;
            flex-wrap: wrap;
        }

        .modal-actions a, .modal-actions button {
            padding: 0.6rem 1.25rem;
            background: var(--accent);
            color: white;
            text-decoration: none;
            border: none;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-weight: 500;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 0.4rem;
            font-size: 0.88rem;
        }

        .modal-actions a:hover, .modal-actions button:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(80, 194, 110, 0.3);
        }

        .modal-actions button.secondary {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid var(--border-color);
        }

        .modal-actions button.secondary:hover {
            background: rgba(255, 255, 255, 0.15);
        }

        .modal-actions button.delete-btn {
            background: rgba(239, 68, 68, 0.2);
            border-color: rgba(239, 68, 68, 0.4);
            color: #ef4444;
        }

        .modal-actions button.delete-btn:hover {
            background: rgba(239, 68, 68, 0.4);
            border-color: #ef4444;
        }

        .no-gen {
            opacity: 0.5;
            font-size: 0.8rem;
            margin-top: 0.5rem;
        }

        /* Picker panels for style/model/size selection */
        .picker-panel {
            background: rgba(0, 0, 0, 0.25);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-md);
            padding: 1.25rem;
        }

        .picker-panel h4 {
            margin-bottom: 0.85rem;
            color: var(--accent);
            font-weight: 600;
            font-size: 0.95rem;
        }

        .picker-options {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .picker-btn {
            padding: 0.55rem 1.1rem;
            background: var(--bg-input);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            color: var(--text-primary);
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.85rem;
            font-weight: 500;
        }

        .picker-btn:hover {
            border-color: var(--accent);
            background: rgba(80, 194, 110, 0.15);
        }

        .picker-btn.active {
            background: var(--accent-gradient);
            border-color: var(--accent);
            color: white;
        }

        /* Toast notifications */
        .toast-container {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            z-index: 3000;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .toast {
            padding: 1rem 1.5rem;
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            border-left: 4px solid var(--accent);
            border-radius: var(--radius-sm);
            animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: var(--shadow-lg);
            border: 1px solid var(--border-color);
            border-left: 4px solid var(--accent);
        }

        .toast.success {
            border-left-color: var(--accent-secondary);
        }

        .toast.error {
            border-left-color: #ef4444;
        }

        @keyframes slideIn {
            from {
                transform: translateX(100%);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }

        /* Global Footer */
        .global-footer {
            background: var(--bg-card);
            border-top: 1px solid var(--border-color);
            padding: 2.5rem 2rem;
            margin-top: 4rem;
        }

        .footer-content {
            max-width: 1400px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 2rem;
        }

        .footer-section h4 {
            color: var(--text-primary);
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 1rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .footer-section ul {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .footer-section ul li {
            margin-bottom: 0.5rem;
        }

        .footer-section a {
            color: var(--text-muted);
            text-decoration: none;
            font-size: 0.875rem;
            transition: color 0.2s ease;
        }

        .footer-section a:hover {
            color: var(--accent);
        }

        .footer-section p {
            color: var(--text-muted);
            font-size: 0.875rem;
            line-height: 1.6;
            margin: 0;
        }

        .footer-bottom {
            max-width: 1400px;
            margin: 2rem auto 0;
            padding-top: 1.5rem;
            border-top: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .footer-copyright {
            color: var(--text-muted);
            font-size: 0.8rem;
        }

        .footer-copyright a {
            color: var(--accent);
            text-decoration: none;
        }

        .footer-copyright a:hover {
            text-decoration: underline;
        }

        .footer-links {
            display: flex;
            gap: 1.5rem;
        }

        .footer-links a {
            color: var(--text-muted);
            font-size: 0.8rem;
            text-decoration: none;
        }

        .footer-links a:hover {
            color: var(--accent);
        }

        .footer-social {
            display: flex;
            gap: 1rem;
        }

        .footer-social a {
            color: var(--text-muted);
            font-size: 1.25rem;
            transition: color 0.2s ease;
        }

        .footer-social a:hover {
            color: var(--accent);
        }

        @media (max-width: 768px) {
            .footer-bottom {
                flex-direction: column;
                text-align: center;
            }
        }

        /* Profile Section */
        .profile-section {
            display: none;
        }

        .profile-section.active {
            display: block;
        }

        .profile-header {
            display: flex;
            align-items: center;
            gap: 2rem;
            background: var(--bg-card);
            backdrop-filter: blur(20px);
            border: 1px solid var(--border-color);
            padding: 2rem;
            border-radius: var(--radius-xl);
            margin-bottom: 2rem;
            box-shadow: var(--shadow-md);
        }

        .profile-avatar {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            border: 4px solid var(--accent);
            box-shadow: 0 0 25px rgba(80, 194, 110, 0.3);
        }

        .profile-info h2 {
            margin-bottom: 0.5rem;
            font-weight: 700;
        }

        .profile-stats {
            display: flex;
            gap: 2.5rem;
            margin-top: 1.25rem;
        }

        .profile-stat {
            text-align: center;
        }

        .profile-stat-value {
            font-size: 1.75rem;
            font-weight: 700;
            background: var(--accent-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .profile-stat-label {
            font-size: 0.75rem;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.04em;
            font-weight: 500;
        }

        .profile-generations h3 {
            margin-bottom: 1.25rem;
            font-weight: 600;
        }

        /* Profile images grid - use gallery class for consistent styling */
        .profile-generations .gallery {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1.5rem;
        }

        @media (max-width: 768px) {
            .profile-generations .gallery {
                grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
                gap: 1rem;
            }
        }

        /* Profile Tabs */
        .profile-tabs {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 0.5rem;
        }

        .profile-tab {
            padding: 0.75rem 1.5rem;
            background: transparent;
            border: none;
            border-radius: 0.5rem 0.5rem 0 0;
            color: var(--text-secondary);
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 0.95rem;
        }

        .profile-tab:hover {
            color: var(--text-primary);
            background: rgba(255, 255, 255, 0.05);
        }

        .profile-tab.active {
            color: var(--primary-color);
            background: rgba(138, 180, 248, 0.1);
            border-bottom: 2px solid var(--primary-color);
        }

        .profile-tab-content {
            animation: fadeIn 0.3s ease;
        }

        /* Settings Panel */
        .settings-panel {
            max-width: 800px;
        }

        .settings-panel h3 {
            margin-top: 2rem;
            margin-bottom: 0.5rem;
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .settings-panel h3:first-child {
            margin-top: 0;
        }

        .settings-desc {
            color: var(--text-secondary);
            font-size: 0.875rem;
            margin-bottom: 1rem;
        }

        .settings-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .setting-item {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .setting-item label {
            font-size: 0.875rem;
            color: var(--text-secondary);
            font-weight: 500;
        }

        .setting-item input[type="number"],
        .setting-item input[type="text"],
        .setting-item select {
            padding: 0.75rem;
            background: var(--surface-color);
            border: 1px solid var(--border-color);
            border-radius: 0.5rem;
            color: var(--text-primary);
            font-size: 0.95rem;
            transition: border-color 0.2s ease;
        }

        .setting-item input:focus,
        .setting-item select:focus {
            outline: none;
            border-color: var(--primary-color);
        }

        .setting-toggle {
            flex-direction: row !important;
            align-items: center;
        }

        .setting-toggle label {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            cursor: pointer;
            color: var(--text-primary);
        }

        .setting-toggle input[type="checkbox"] {
            width: 18px;
            height: 18px;
            accent-color: var(--primary-color);
            cursor: pointer;
        }

        .settings-actions {
            display: flex;
            gap: 1rem;
            margin-top: 2rem;
            padding-top: 1.5rem;
            border-top: 1px solid var(--border-color);
        }

        .btn {
            padding: 0.75rem 1.5rem;
            border: none;
            border-radius: 0.5rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 0.95rem;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--primary-color), #6b9bff);
            color: white;
        }

        .btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(138, 180, 248, 0.3);
        }

        .btn-secondary {
            background: var(--surface-color);
            color: var(--text-primary);
            border: 1px solid var(--border-color);
        }

        .btn-secondary:hover {
            background: var(--hover-bg);
        }

        /* Usage Panel */
        .usage-panel {
            max-width: 900px;
        }

        .usage-panel h3 {
            margin-top: 2rem;
            margin-bottom: 1rem;
            font-size: 1.1rem;
            font-weight: 600;
        }

        .usage-panel h3:first-child {
            margin-top: 0;
        }

        .usage-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            margin-bottom: 2rem;
        }

        .usage-card {
            background: var(--surface-color);
            border: 1px solid var(--border-color);
            border-radius: 1rem;
            padding: 1.5rem;
            text-align: center;
        }

        .usage-card-header {
            font-size: 0.8rem;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.5rem;
        }

        .usage-card-value {
            font-size: 2rem;
            font-weight: 700;
            background: linear-gradient(135deg, var(--primary-color), #6b9bff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .usage-card-label {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-bottom: 0.75rem;
        }

        .usage-progress {
            height: 6px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 3px;
            overflow: hidden;
            margin-bottom: 0.5rem;
        }

        .usage-progress-bar {
            height: 100%;
            background: linear-gradient(90deg, var(--success-color), var(--primary-color));
            border-radius: 3px;
            transition: width 0.5s ease;
        }

        .usage-progress-bar.warning {
            background: linear-gradient(90deg, #f9a825, #ff6f00);
        }

        .usage-progress-bar.danger {
            background: linear-gradient(90deg, #ef5350, #c62828);
        }

        .usage-card-sub {
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        .usage-chart {
            background: var(--surface-color);
            border: 1px solid var(--border-color);
            border-radius: 1rem;
            padding: 1.5rem;
            margin-bottom: 2rem;
        }

        /* LLM Link Status Banner */
        .llm-link-banner {
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.1));
            border: 1px solid rgba(245, 158, 11, 0.3);
            border-radius: 0.75rem;
            padding: 1rem 1.25rem;
            margin-bottom: 1.5rem;
        }

        .llm-link-banner.linked {
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(52, 211, 153, 0.1));
            border-color: rgba(16, 185, 129, 0.3);
        }

        .link-banner-content {
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
        }

        .link-icon {
            font-size: 1.25rem;
            line-height: 1;
        }

        .link-message {
            flex: 1;
        }

        .link-message strong {
            display: block;
            font-size: 0.95rem;
            margin-bottom: 0.25rem;
            color: var(--text-primary);
        }

        .link-message p {
            margin: 0;
            font-size: 0.85rem;
            color: var(--text-secondary);
            line-height: 1.4;
        }

        /* Loading Spinner */
        .loading-spinner {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 2px solid rgba(80, 194, 110, 0.3);
            border-radius: 50%;
            border-top-color: var(--primary-color);
            animation: spinner 0.8s linear infinite;
        }

        .loading-spinner.large {
            width: 32px;
            height: 32px;
            border-width: 3px;
        }

        @keyframes spinner {
            to { transform: rotate(360deg); }
        }

        .usage-card .loading-spinner {
            margin: 0.5rem 0;
        }

        /* Section headings */
        .usage-section h3 {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text-primary);
            margin: 0 0 1rem 0;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        /* Total card gradient */
        .usage-card.total-card {
            background: linear-gradient(135deg, var(--surface-color), rgba(80, 194, 110, 0.08));
            border-color: rgba(80, 194, 110, 0.3);
        }

        .model-usage {
            display: grid;
            gap: 0.75rem;
        }

        .model-usage-item {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem;
            background: var(--surface-color);
            border: 1px solid var(--border-color);
            border-radius: 0.75rem;
        }

        .model-usage-name {
            flex: 1;
            font-weight: 500;
        }

        .model-usage-count {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .model-usage-cost {
            font-weight: 600;
            color: var(--primary-color);
        }

        .model-usage-bar {
            flex: 2;
            height: 8px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 4px;
            overflow: hidden;
        }

        .model-usage-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--primary-color), #6b9bff);
            border-radius: 4px;
        }

        /* Edit buttons grid for preview */
        .edit-buttons-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
            gap: 0.6rem;
            margin-top: 1.25rem;
        }

        .edit-buttons-grid button {
            padding: 0.65rem;
            font-size: 0.8rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.35rem;
            background: rgba(0, 0, 0, 0.2);
            border: 1px solid var(--border-color);
            border-radius: var(--radius-sm);
            color: var(--text-primary);
            cursor: pointer;
            transition: all 0.2s;
        }

        .edit-buttons-grid button:hover {
            border-color: var(--accent);
            background: rgba(80, 194, 110, 0.15);
        }

        .edit-buttons-grid button .btn-icon {
            font-size: 1.3rem;
        }

        .edit-buttons-grid button .btn-text {
            font-size: 0.68rem;
            font-weight: 500;
            color: var(--text-secondary);
        }

        /* Scrollbar styling */
        ::-webkit-scrollbar {
            width: 10px;
            height: 10px;
        }

        ::-webkit-scrollbar-track {
            background: var(--bg-primary);
        }

        ::-webkit-scrollbar-thumb {
            background: rgba(80, 194, 110, 0.3);
            border-radius: 5px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: rgba(80, 194, 110, 0.5);
        }

        /* Selection styling */
        ::selection {
            background: rgba(80, 194, 110, 0.4);
            color: white;
        }

        /* Mobile hamburger menu */
        .mobile-menu-toggle {
            display: none;
            background: rgba(255, 255, 255, 0.15);
            border: 1px solid rgba(255, 255, 255, 0.25);
            color: white;
            padding: 0.5rem;
            border-radius: 6px;
            cursor: pointer;
            font-size: 1.25rem;
            line-height: 1;
        }

        .mobile-nav-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999;
        }

        .mobile-nav-panel {
            position: fixed;
            top: 0;
            right: -280px;
            width: 280px;
            height: 100vh;
            background: var(--bg-primary);
            z-index: 1000;
            transition: right 0.3s ease;
            padding: 1rem;
            overflow-y: auto;
            box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
        }

        .mobile-nav-panel.open {
            right: 0;
        }

        .mobile-nav-close {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.5rem;
            margin-bottom: 1rem;
            display: block;
            margin-left: auto;
        }

        .mobile-nav-links {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .mobile-nav-links a, .mobile-nav-links button {
            display: block;
            width: 100%;
            padding: 0.75rem 1rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            color: var(--text-primary);
            text-decoration: none;
            font-size: 0.95rem;
            text-align: left;
            cursor: pointer;
        }

        .mobile-nav-links a:hover, .mobile-nav-links button:hover {
            background: var(--bg-card);
            border-color: var(--accent);
        }

        .mobile-nav-links .active {
            background: var(--accent);
            color: white;
            border-color: var(--accent);
        }

        .mobile-nav-user {
            margin-top: 1.5rem;
            padding-top: 1rem;
            border-top: 1px solid var(--border-color);
        }

        /* Mobile responsive */
        @media (max-width: 768px) {
            .mobile-menu-toggle {
                display: block;
            }

            .header {
                padding: 0.5rem 0.75rem;
                flex-direction: row;
                gap: 0.5rem;
            }

            .header-brand {
                flex: 1;
            }

            .header h1 {
                font-size: 1.1rem;
            }

            .header-nav {
                display: none;
            }

            .user-auth {
                display: none;
            }

            .container {
                padding: 0.75rem;
            }

            .gallery {
                grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
                gap: 0.5rem;
            }

            .filters {
                padding: 0.75rem;
                flex-wrap: wrap;
            }

            .filters select, .filters input {
                font-size: 0.8rem;
                padding: 0.4rem 0.5rem;
            }

            .filter-group {
                flex: 1 1 calc(50% - 0.5rem);
                min-width: 120px;
            }

            .image-card {
                border-radius: 8px;
            }

            .image-info {
                padding: 0.4rem;
            }

            .image-prompt {
                font-size: 0.75rem;
                -webkit-line-clamp: 2;
            }

            .image-meta {
                font-size: 0.65rem;
                gap: 0.25rem;
            }

            .preview-container {
                grid-template-columns: 1fr;
            }

            /* Stats bar mobile */
            .stats-bar {
                padding: 0.5rem 0.75rem;
                gap: 0.5rem;
                flex-wrap: wrap;
                font-size: 0.7rem;
            }

            .stat-item {
                font-size: 0.7rem;
                padding: 0.25rem 0.5rem;
            }

            /* Grid size selector mobile */
            .grid-size-selector {
                display: none;
            }

            /* Generate section mobile */
            .generate-container {
                padding: 0.75rem;
            }

            .generate-layout {
                grid-template-columns: 1fr;
                gap: 1rem;
            }

            .prompt-area textarea {
                font-size: 0.9rem;
                min-height: 80px;
            }

            .model-grid {
                grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
                gap: 0.5rem;
            }

            .model-card {
                padding: 0.5rem;
            }

            .model-card .name {
                font-size: 0.75rem;
            }

            /* Session history mobile */
            .session-history {
                max-height: 250px;
                padding: 0.75rem;
            }

            .session-history-grid {
                grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
            }

            /* Footer mobile */
            footer.footer {
                padding: 1.5rem 0.75rem;
            }

            .footer-grid {
                grid-template-columns: 1fr 1fr;
                gap: 1rem;
            }

            /* Modal mobile */
            .modal-content {
                margin: 0.5rem;
                max-height: calc(100vh - 1rem);
                border-radius: 12px;
            }

            .modal-grid {
                grid-template-columns: 1fr;
            }
        }

        /* Extra small screens */
        @media (max-width: 480px) {
            .header h1 {
                font-size: 1rem;
            }

            .gallery {
                grid-template-columns: repeat(2, 1fr);
                gap: 0.4rem;
            }

            .filters {
                gap: 0.4rem;
            }

            .filter-group {
                flex: 1 1 100%;
            }

            .stats-bar {
                justify-content: center;
            }

            .stat-item {
                font-size: 0.65rem;
            }

            .image-prompt {
                font-size: 0.7rem;
            }

            .model-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .footer-grid {
                grid-template-columns: 1fr;
            }
        }

/* ==================== Prompt Templates ====================  */

.template-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.template-cat {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.template-cat:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.template-cat.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.template-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.template-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.template-preview {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==================== Recent Generations ====================  */

.recent-gen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

.recent-gen-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.recent-gen-item:hover {
    border-color: var(--accent);
    transform: scale(1.05);
}

.recent-gen-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-gen-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.recent-gen-item:hover .recent-gen-overlay {
    opacity: 1;
}

.regen-icon {
    font-size: 1.5rem;
}

.regen-text {
    font-size: 0.7rem;
    color: white;
    margin-top: 0.25rem;
}

.recent-gen-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.25rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.recent-gen-info .model-badge {
    font-size: 0.55rem;
    padding: 0.1rem 0.3rem;
    background: var(--accent);
    color: white;
    border-radius: 3px;
}

.my-stats {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ==================== Model Stats Table ====================  */

.model-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.model-stats-table th,
.model-stats-table td {
    padding: 0.6rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.model-stats-table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.model-stats-table tr:hover {
    background: rgba(80, 194, 110, 0.05);
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}
/* ==================== Favorites ====================  */

#favorites-toggle {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#favorites-toggle:hover {
    background: var(--hover);
}

#favorites-toggle.active {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    border-color: #ff6b6b;
    color: white;
}

.gallery-item.favorited {
    box-shadow: 0 0 0 2px #ff6b6b;
}

.fav-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.no-images {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ==================== Keyboard Help Modal ====================  */

.keyboard-help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.keyboard-help-modal {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.2s ease;
}

.keyboard-help-modal h3 {
    margin: 0 0 1.5rem;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.keyboard-help-modal table {
    width: 100%;
    margin-bottom: 1.5rem;
}

.keyboard-help-modal td {
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.keyboard-help-modal td:first-child {
    width: 120px;
}

.keyboard-help-modal kbd {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--accent);
    box-shadow: 0 2px 0 var(--border-color);
}

.keyboard-help-modal .btn-primary {
    width: 100%;
}

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

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
}

.page-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Bulk Selection Styles */
.bulk-select-toggle {
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.bulk-select-toggle:hover {
    background: var(--bg-secondary);
}

.bulk-select-toggle.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.bulk-actions {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--accent);
    border-radius: 8px;
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.bulk-actions button {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

.bulk-actions .download-btn {
    background: white;
    color: var(--accent);
}

.bulk-actions .clear-btn {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.5);
}

.bulk-actions .selected-count {
    color: white;
    font-weight: 600;
    margin-right: 0.5rem;
}

.image-card.selectable {
    cursor: pointer;
}

.image-card.selectable .image-wrapper::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    border: 2px solid white;
    border-radius: 4px;
    background: rgba(0,0,0,0.3);
    z-index: 5;
}

.image-card.selected .image-wrapper::after {
    background: var(--accent);
    border-color: var(--accent);
}

.image-card.selected .image-wrapper::before {
    content: '✓';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    z-index: 6;
}

.image-card.selected {
    outline: 3px solid var(--accent);
    outline-offset: -3px;
}