 :root {
            --primary-color: #2563eb;
            --primary-hover: #1d4ed8;
            --success-color: #16a34a;
            --success-hover: #15803d;
            --danger-color: #ef4444;
            --danger-hover: #dc2626;
            --bg-color: #f3f4f6;
            --surface-color: #ffffff;
            --text-main: #1f2937;
            --text-secondary: #6b7280;
            --border-color: #e5e7eb;
            --border-hover: #9ca3af;
        }

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

        body {
            
            background-color: var(--bg-color);
            color: var(--text-main);
            height: 100vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        
         html,body{ font-size:inherit;}

        /* Layout */
        header {
            background-color: var(--surface-color);
            box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            z-index: 10;
            flex-shrink: 0;
        }

        .header-content {
            max-width: 1280px;
            margin: 0 auto;
            padding: 1rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

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

        .brand-icon {
            background-color: var(--primary-color);
            color: white;
            padding: 0.5rem;
            border-radius: 0.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .brand-text h1 {
            font-size: 1.25rem;
            font-weight: 700;
            color: #111827;
            line-height: 1.2;
        }

        .brand-text p {
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

        .github-link {
            color: #9ca3af;
            font-size: 1.5rem;
            transition: color 0.2s;
        }

        .github-link:hover {
            color: #4b5563;
        }

        main {
            flex: 1;
            display: flex;
            overflow: hidden;
            padding-top: 60px;
        }

        /* Sidebar */
        aside {
            width: 320px;
            background-color: var(--surface-color);
            border-right: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            z-index: 5;
            flex-shrink: 0;
        }

        .sidebar-section {
            padding: 1.25rem;
            border-bottom: 1px solid #f3f4f6;
        }

        .section-title {
            font-weight: 600;
            color: #374151;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        /* Forms & Inputs */
        .form-group {
            margin-bottom: 1.25rem;
        }

        label {
            display: block;
            font-size: 0.875rem;
            font-weight: 500;
            color: #374151;
            margin-bottom: 0.5rem;
        }

        select, input[type="number"], input[type="text"] {
            width: 100%;
            border: 1px solid #d1d5db;
            border-radius: 0.375rem;
            padding: 0.5rem;
            font-size: 0.875rem;
            outline: none;
            background-color: #f9fafb;
            transition: border-color 0.2s, box-shadow 0.2s;
        }

        select:focus, input:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
        }

        /* Range Slider */
        .range-wrapper {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        input[type="range"] {
            width: 100%;
            height: 0.5rem;
            background: #e5e7eb;
            border-radius: 0.5rem;
            appearance: none;
            outline: none;
            cursor: pointer;
        }
        input[type="range"]::-webkit-slider-thumb {
            appearance: none;
            width: 1rem;
            height: 1rem;
            background: var(--primary-color);
            border-radius: 50%;
            cursor: pointer;
        }

        .value-display {
            font-family: monospace;
            font-size: 0.875rem;
            min-width: 2.5rem;
            text-align: right;
        }

        /* Grid for Dimensions */
        .grid-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.75rem;
        }

        .checkbox-wrapper {
            margin-top: 0.5rem;
            display: flex;
            align-items: center;
        }
        .checkbox-wrapper input {
            width: auto;
            margin-right: 0.5rem;
        }
        .checkbox-wrapper label {
            margin-bottom: 0;
            color: #4b5563;
        }

        /* Format Buttons */
        .format-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 0.5rem;
        }

        .format-btn {
            background-color: white;
            border: 1px solid var(--border-color);
            color: #4b5563;
            border-radius: 0.25rem;
            padding: 0.25rem 0.5rem;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .format-btn:hover {
            background-color: #f9fafb;
        }

        .format-btn.active {
            background-color: #eff6ff;
            border-color: #bfdbfe;
            color: #1d4ed8;
        }

        /* Buttons */
        .btn {
            width: 100%;
            padding: 0.75rem 1rem;
            border-radius: 0.5rem;
            font-weight: 700;
            cursor: pointer;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: transform 0.1s, background-color 0.2s;
            color: white;
            box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
        }

        .btn:active {
            transform: scale(0.98);
        }

        .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            background-color: #9ca3af !important;
        }

        .btn-primary {
            background-color: var(--primary-color);
        }
        .btn-primary:hover {
            background-color: var(--primary-hover);
        }

        .btn-success {
            background-color: var(--success-color);
        }
        .btn-success:hover {
            background-color: var(--success-hover);
        }

        /* Main Work Area */
        .work-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            height: 100%;
            background-color: var(--bg-color);
            position: relative;
            overflow: hidden;
        }

        .mobile-header {
            display: none;
            background: white;
            padding: 0.5rem;
            border-bottom: 1px solid var(--border-color);
            justify-content: space-between;
            align-items: center;
        }

        /* Drop Zone */
        .drop-zone {
            margin: 1.5rem;
            border: 2px dashed #d1d5db;
            border-radius: 0.75rem;
            background-color: white;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 2.5rem;
            cursor: pointer;
            transition: all 0.2s;
            min-height: 200px;
            flex-shrink: 0;
        }

        .drop-zone:hover, .drop-zone.drag-active {
            border-color: #60a5fa;
            background-color: #eff6ff;
        }

        .drop-zone .icon-container {
            background-color: #dbeafe;
            padding: 1rem;
            border-radius: 9999px;
            margin-bottom: 1rem;
            color: var(--primary-color);
            transition: background-color 0.2s;
        }
        
        .drop-zone:hover .icon-container {
            background-color: #bfdbfe;
        }

        .drop-zone h3 {
            font-size: 1.125rem;
            font-weight: 500;
            color: #374151;
            margin-bottom: 0.25rem;
        }
        
        .drop-zone p {
            font-size: 0.875rem;
            color: #6b7280;
        }

        /* File List Area */
        .file-list-container {
            flex: 1;
            overflow-y: auto;
            padding: 0 1.5rem 1.5rem 1.5rem;
        }

        .list-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .list-title {
            font-weight: 600;
            color: #374151;
        }

        .btn-clear {
            color: var(--danger-color);
            font-size: 0.875rem;
            font-weight: 500;
            background: none;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }
        .btn-clear:hover {
            color: var(--danger-hover);
        }

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

        @media (min-width: 640px) { .file-grid { grid-template-columns: repeat(2, 1fr); } }
        @media (min-width: 1024px) { .file-grid { grid-template-columns: repeat(3, 1fr); } }
        @media (min-width: 1280px) { .file-grid { grid-template-columns: repeat(4, 1fr); } }

        /* File Card */
        .file-card {
            background-color: white;
            border-radius: 0.5rem;
            box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            padding: 0.75rem;
            border: 1px solid #f3f4f6;
            display: flex;
            flex-direction: column;
            position: relative;
        }

        .file-card:hover .btn-remove {
            opacity: 1;
        }

        .btn-remove {
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            background-color: var(--danger-color);
            color: white;
            border-radius: 50%;
            width: 1.5rem;
            height: 1.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.2s, background-color 0.2s;
            border: none;
            cursor: pointer;
            z-index: 2;
            box-shadow: 0 1px 2px rgba(0,0,0,0.2);
        }

        .btn-remove:hover {
            background-color: var(--danger-hover);
        }

        .card-preview {
            height: 8rem;
            width: 100%;
            background-color: #f3f4f6;
            border-radius: 0.375rem;
            overflow: hidden;
            margin-bottom: 0.75rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .card-preview img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
        }

        .card-info {
            margin-top: auto;
        }

        .file-name {
            font-size: 0.875rem;
            font-weight: 500;
            color: #1f2937;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .file-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 0.25rem;
        }

        .badge {
            font-size: 0.75rem;
            color: #6b7280;
            background-color: #f3f4f6;
            padding: 0.125rem 0.5rem;
            border-radius: 0.25rem;
        }

        .file-size {
            font-size: 0.75rem;
            color: #9ca3af;
        }

        .processed-indicator {
            margin-top: 0.5rem;
            font-size: 0.75rem;
            color: var(--primary-color);
            display: flex;
            align-items: center;
            gap: 0.25rem;
        }

        /* Empty State */
        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 10rem;
            color: #9ca3af;
            text-align: center;
        }
        .empty-state i {
            font-size: 2.25rem;
            margin-bottom: 0.5rem;
        }

        /* Overlay */
        .overlay {
            position: absolute;
            inset: 0;
            background-color: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(4px);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 50;
        }

        .spinner {
            width: 3rem;
            height: 3rem;
            border: 4px solid #bfdbfe;
            border-top-color: var(--primary-color);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 1rem;
        }

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

        /* Helpers */
        .hidden { display: none !important; }
        .text-xs { font-size: 0.75rem; }
        .text-gray-400 { color: #9ca3af; }
        .mt-1 { margin-top: 0.25rem; }
        .mt-auto { margin-top: auto; }
        .status-msg { height: 1rem; margin-top: 0.5rem; text-align: center; font-size: 0.75rem; color: #6b7280; }
        .text-green { color: var(--success-color); font-weight: 500; }
        .disabled-group { opacity: 0.5; pointer-events: none; }

        /* Scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        ::-webkit-scrollbar-track {
            background: #f1f1f1; 
        }
        ::-webkit-scrollbar-thumb {
            background: #c1c1c1; 
            border-radius: 4px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8; 
        }

        /* Responsive */
        @media (max-width: 768px) {
            aside { display: none; }
            .mobile-header { display: flex; }
            
            /* Mobile Settings Modal */
            .mobile-modal {
                position: fixed;
                inset: 0;
                background-color: rgba(0,0,0,0.5);
                z-index: 50;
                display: flex;
                justify-content: flex-end;
            }
            .mobile-modal-content {
                background: white;
                width: 85%;
                height: 100%;
                padding: 1.25rem;
                overflow-y: auto;
            }
            .mobile-modal-header {
                display: flex;
                justify-content: space-between;
                align-items: center;
                margin-bottom: 1.25rem;
            }
        }