 :root {
            --primary: #2563eb;
            --primary-light: #dbeafe;
            --gray-200: #e5e7eb;
            --gray-300: #d1d5db;
            --gray-400: #9ca3af;
            --gray-600: #4b5563;
            --gray-900: #111827;
            --bg: #f8fafc;
            --card: #ffffff;
            --shadow: 0 4px 12px rgba(0,0,0,0.05);
            --success: #10b981;
            --warning: #f59e0b;
            --error: #ef4444;
        }

        * { 
            box-sizing: border-box; 
            margin: 0;
            padding: 0;
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg);
            margin: 0;
            padding: 20px 16px;
            color: var(--gray-900);
            line-height: 1.5;
        }

        .container {
            max-width: 560px;
            margin: 0 auto;
            background: var(--card);
            border-radius: 16px;
            box-shadow: var(--shadow);
            overflow: hidden;
        }

        .header {
            text-align: center;
            padding: 24px 20px 16px;
        }

        .header h1 {
            margin: 0;
            font-weight: 700;
            font-size: 1.75rem;
        }

        .header p {
            margin: 8px 0 0;
            color: var(--gray-600);
            font-size: 0.95rem;
        }

        /* Tabs */
        .tabs {
            display: flex;
            border-bottom: 1px solid var(--gray-200);
            background: #fbfcfd;
        }

        .tab {
            flex: 1;
            padding: 16px;
            text-align: center;
            font-weight: 600;
            font-size: 0.95rem;
            color: var(--gray-600);
            cursor: pointer;
            position: relative;
            transition: color 0.2s;
        }

        .tab.active {
            color: var(--primary);
        }

        .tab.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 32px;
            height: 3px;
            background: var(--primary);
            border-radius: 2px;
        }

        .tab-icon {
            display: block;
            margin: 0 auto 6px;
            font-size: 20px;
        }

        /* Tab Content */
        .tab-content {
            display: none;
            padding: 24px 20px;
        }

        .tab-content.active {
            display: block;
            animation: fadeSlide 0.25s ease;
        }

        @keyframes fadeSlide {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* File Input Styles */
        .file-input-container {
            margin-bottom: 16px;
        }

        .file-input-label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: var(--gray-700);
        }

        .file-input {
            width: 100%;
            padding: 12px;
            border: 1px solid var(--gray-300);
            border-radius: 8px;
            font-family: inherit;
            font-size: 0.95rem;
            background-color: white;
        }

        /* URL Input */
        #url-input {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid var(--gray-300);
            border-radius: 8px;
            font-family: inherit;
            font-size: 0.95rem;
            margin-bottom: 12px;
        }

        #url-btn {
            width: 100%;
            padding: 12px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
        }

        #url-btn:hover { 
            background: #1d4ed8; 
        }

        /* Camera Area */
        #camera-preview {
            width: 100%;
            max-height: 300px;
            border-radius: 10px;
            margin-top: 16px;
            display: none;
            background-color: #000;
        }

        #capture-btn {
            margin-top: 16px;
            padding: 10px 20px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 8px;
            display: none;
            cursor: pointer;
            width: 100%;
        }

        /* Preview */
        #preview-container {
            padding: 0 20px;
            text-align: center;
            margin-bottom: 20px;
        }

        #preview {
            max-width: 100%;
            max-height: 300px;
            border-radius: 12px;
            display: none;
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
            margin: 0 auto;
        }

        /* Selected File Info */
        .file-info {
            margin-top: 16px;
            padding: 12px;
            background: var(--primary-light);
            border-radius: 8px;
            display: none;
            font-size: 0.9rem;
        }

        .file-name {
            font-weight: 600;
            margin-bottom: 4px;
        }

        .file-size {
            color: var(--gray-600);
            font-size: 0.85rem;
        }

        /* Predict Button */
        #predict-btn {
            width: 100%;
            padding: 16px;
            font-size: 1.05rem;
            font-weight: 600;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            margin-top: 12px;
            transition: background 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        #predict-btn:hover:not(:disabled) {
            background: #1d4ed8;
        }

        #predict-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        /* Progress */
        .progress-container {
            display: none;
            text-align: center;
            padding: 24px 0;
        }

        .spinner {
            width: 32px;
            height: 32px;
            margin: 0 auto 12px;
            border: 3px solid #e5e7eb;
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Results */
        .results {
            margin-top: 24px;
            padding: 20px;
            background: #f0f9ff;
            border-radius: 12px;
            border-left: 3px solid var(--primary);
            display: none;
            animation: fadeSlide 0.3s ease;
        }

        .results h3 {
            margin: 0 0 16px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .result-row {
            display: flex;
            justify-content: space-between;
            margin-bottom: 8px;
            font-size: 0.95rem;
        }

        .result-label { 
            color: var(--gray-600); 
        }
        .result-value { 
            font-weight: 600; 
        }

        .probs-list {
            list-style: none;
            padding: 0;
            margin: 12px 0 0;
        }

        .probs-list li {
            display: flex;
            justify-content: space-between;
            padding: 4px 0;
            font-size: 0.9rem;
        }

        .action-buttons {
            padding: 0 20px 20px;
        }