:root {
            --primary: #2563eb;
            --primary-light: #3b82f6;
            --primary-dark: #1d4ed8;
            --secondary: #0ea5e9;
            --secondary-light: #38bdf8;
            --secondary-dark: #0284c7;
            --accent: #f59e0b;
            --info: #6366f1;
            --bg: #f8fafc;
            --bg-accent: #eff6ff;
            --sidebar-bg: #ffffff;
            --card-bg: #ffffff;
            --text-main: #1e293b;
            --text-muted: #64748b;
            --border: #e2e8f0;
            --border-light: #f1f5f9;
            --shadow: 0 2px 4px rgba(0,0,0,0.06), 0 8px 16px rgba(0,0,0,0.1);
            --shadow-lg: 0 4px 12px rgba(0,0,0,0.1), 0 12px 28px rgba(0,0,0,0.14);
            --radius: 12px;
            --emerald: #10b981;
            --emerald-dark: #059669;
            --fs-h1: 2rem;
            --fs-h2: 1.5rem;
            --fs-h3: 1.125rem;
            --fs-body: 1rem;
            --fs-label: 0.875rem;
            --fs-caption: 0.75rem;
        }

        [data-theme="dark"] {
            --bg: #0f172a;
            --sidebar-bg: #1e293b;
            --card-bg: #1e293b;
            --text-main: #e2e8f0;
            --text-muted: #94a3b8;
            --border: #334155;
            --border-light: #1e293b;
            --shadow: 0 2px 4px rgba(0,0,0,0.3), 0 8px 16px rgba(0,0,0,0.4);
            --bg-accent: #0f1729;
        }

        [data-theme="dark"] input, [data-theme="dark"] textarea, [data-theme="dark"] select {
            background-color: #0f172a;
            color: #e2e8f0;
            border-color: #334155;
        }

        [data-theme="dark"] .upload-btn { background-color: #1e293b; border-color: #334155; }
        [data-theme="dark"] .action-btn.export { background: #1e293b; border-color: #334155; color: #e2e8f0; }
        [data-theme="dark"] .segment-row:hover { background: #0f172a; }
        [data-theme="dark"] .segment-time { background: rgba(37, 99, 235, 0.15); }
        [data-theme="dark"] .badge { border-color: #334155; color: #94a3b8; }
        [data-theme="dark"] .duplicate-banner { background: #422006; border-color: #713f12; }
        [data-theme="dark"] .duplicate-banner p { color: #fbbf24; }

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

        body {
            font-family: 'Outfit', 'Noto Sans KR', sans-serif;
            background-color: var(--bg);
            color: var(--text-main);
            display: flex;
            min-height: 100vh;
        }

        /* Sidebar */
        .sidebar {
            width: 260px;
            background-color: var(--sidebar-bg);
            border-right: 1px solid var(--border);
            padding: 2rem 1.5rem;
            display: flex;
            flex-direction: column;
            position: fixed;
            height: 100vh;
        }

        .logo {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--text-main);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 2rem;
            text-decoration: none;
        }
        .logo-icon {
            width: 36px;
            height: 36px;
            flex-shrink: 0;
        }
        .logo-text { letter-spacing: -0.5px; }

        .nav-menu { list-style: none; }
        .nav-item { margin-bottom: 0.5rem; }

        .nav-link {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 0.75rem 1rem;
            text-decoration: none;
            color: var(--text-muted);
            border-radius: var(--radius);
            transition: all 0.2s;
            font-weight: 500;
            cursor: pointer;
        }

        .nav-link:hover, .nav-link.active {
            background-color: rgba(37, 99, 235, 0.06);
            color: var(--primary);
        }

        .platform-badges {
            padding-top: 1rem;
        }

        .platform-badges p {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-bottom: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .badge-list {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .badge {
            font-size: 0.7rem;
            padding: 0.25rem 0.6rem;
            border-radius: 999px;
            font-weight: 600;
            border: 1px solid var(--border);
            color: var(--text-muted);
        }

        /* Main Content */
        .main-content {
            margin-left: 260px;
            flex: 1;
            padding: 2rem 3rem;
            max-width: 1200px;
        }

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

        .header-title h1 { font-size: var(--fs-h1); font-weight: 700; margin-bottom: 0.25rem; }
        .header-title p { color: var(--text-muted); }

        .header-actions {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-shrink: 0;
        }
        .header-btn {
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 0.8rem;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.35rem 0.5rem;
            border-radius: 6px;
            font-family: inherit;
            transition: color 0.2s, background 0.2s;
        }
        .header-btn:hover {
            color: var(--primary);
            background: rgba(37, 99, 235, 0.06);
        }

        .hero-section {
            background: linear-gradient(135deg, var(--bg-accent) 0%, rgba(37,99,235,0.04) 100%);
            border: 1px solid rgba(37,99,235,0.12);
            border-radius: 16px;
            padding: 2.5rem 2rem;
            margin-bottom: 2rem;
            text-align: center;
        }
        .hero-section h2 {
            font-size: 1.75rem;
            font-weight: 700;
            color: var(--text-main);
            margin-bottom: 0.5rem;
        }
        .hero-section h2 span { color: var(--primary); }
        .hero-section p {
            font-size: var(--fs-body);
            color: var(--text-muted);
            margin-bottom: 1.5rem;
            max-width: 500px;
            margin-left: auto;
            margin-right: auto;
        }
        .hero-features {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1.25rem;
            max-width: 720px;
            margin: 0 auto;
        }
        .hero-feature {
            padding: 0.75rem;
            font-size: var(--fs-label);
            color: var(--text-muted);
        }
        .hero-feature i {
            display: block;
            font-size: 1.25rem;
            color: var(--primary);
            margin-bottom: 0.5rem;
        }
        .hero-feature strong { color: var(--text-main); }

        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 3rem 2rem;
            text-align: center;
            border: 2px dashed var(--border);
            border-radius: var(--radius);
            background: var(--bg-accent);
            min-height: 200px;
        }
        .empty-state-icon { font-size: 2.5rem; color: var(--primary); opacity: 0.5; margin-bottom: 0.75rem; }
        .empty-state-title { font-size: var(--fs-h3); font-weight: 600; color: var(--text-main); margin-bottom: 0.35rem; }
        .empty-state-text { font-size: var(--fs-label); color: var(--text-muted); max-width: 300px; }

        .model-indicator {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.875rem;
            color: var(--text-muted);
            background: var(--border-light);
            padding: 0.5rem 1rem;
            border-radius: var(--radius);
        }

        .model-indicator .dot {
            width: 8px; height: 8px;
            border-radius: 50%;
            background: var(--emerald);
        }

        /* Input Card */
        .input-card {
            background: var(--card-bg);
            padding: 1.5rem 2rem;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            margin-bottom: 1.5rem;
            border: 1px solid var(--border-light);
        }

        .input-group {
            display: flex;
            gap: 0.75rem;
        }

        input[type="text"] {
            flex: 1;
            padding: 0.875rem 1.25rem;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            font-family: inherit;
            font-size: 1rem;
            outline: none;
            transition: border-color 0.2s;
        }

        input[type="text"]:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
        }

        .input-group button {
            padding: 0.875rem 2rem;
            font-size: var(--fs-body);
            font-weight: 700;
            min-height: 48px;
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
            letter-spacing: 0.3px;
        }

        .input-group button:hover {
            box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
        }

        /* Options Row */
        .options-row {
            display: flex;
            gap: 1rem;
            margin-top: 1rem;
            flex-wrap: wrap;
        }

        .option-group {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .option-group label {
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--text-muted);
            white-space: nowrap;
        }

        .option-group select {
            padding: 0.5rem 0.75rem;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-family: inherit;
            font-size: 0.85rem;
            outline: none;
            background: var(--card-bg);
            cursor: pointer;
        }

        .option-group select:focus {
            border-color: var(--primary);
        }

        /* Batch Input */
        .batch-input textarea {
            width: 100%;
            height: 120px;
            padding: 1rem;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            font-family: inherit;
            font-size: 0.95rem;
            line-height: 1.6;
            resize: vertical;
            outline: none;
        }

        .batch-input textarea:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
        }

        .batch-input p {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 0.5rem;
        }

        /* Buttons */
        button {
            padding: 0.75rem 1.5rem;
            min-height: 44px;
            background-color: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius);
            font-weight: 600;
            font-size: var(--fs-body);
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
        }

        button:hover { background-color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.25); }
        button:disabled { background-color: #94a3b8; cursor: not-allowed; }

        .upload-btn {
            background-color: var(--card-bg);
            border: 1px solid var(--border);
            color: var(--text-main);
            padding: 0 1rem;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.4rem;
        }

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

        /* Loader */
        .loader-container {
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 4rem;
        }

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

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

        .loader-status { font-weight: 600; margin-bottom: 0.25rem; }
        .loader-sub { color: var(--text-muted); font-size: 0.875rem; }

        .progress-bar-container {
            width: 300px;
            height: 6px;
            background: var(--border);
            border-radius: 3px;
            margin-top: 1rem;
            overflow: hidden;
        }

        .progress-bar-fill {
            height: 100%;
            background: var(--primary);
            border-radius: 3px;
            transition: width 0.4s ease;
            width: 0%;
        }

        /* History */
        .history-list { display: flex; flex-direction: column; gap: 0.75rem; }

        .history-item {
            background: var(--card-bg);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            border: 1px solid var(--border-light);
            padding: 1rem 1.5rem;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.875rem;
        }

        .history-item:hover { border-color: var(--primary); }

        .history-item-thumb {
            width: 72px;
            height: 72px;
            object-fit: cover;
            border-radius: 8px;
            flex-shrink: 0;
            background: var(--border-light);
        }

        @media (max-width: 640px) {
            .history-item-thumb { width: 56px; height: 56px; }
        }

        .history-item-info { flex: 1; min-width: 0; }

        .history-item-title {
            font-weight: 600;
            font-size: 0.9rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .history-item-meta {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 0.25rem;
            display: flex;
            gap: 1rem;
        }

        .history-item-actions { flex-shrink: 0; margin-left: 1rem; }

        .history-delete-btn {
            background: none;
            border: 1px solid #fee2e2;
            color: #dc2626;
            padding: 0.3rem 0.6rem;
            border-radius: 6px;
            font-size: 0.75rem;
            cursor: pointer;
        }

        .history-delete-btn:hover { background: #fee2e2; }

        .history-empty i { display: block; font-size: 2rem; color: var(--primary); opacity: 0.4; margin-bottom: 0.75rem; }
        .history-empty strong { display: block; font-size: var(--fs-h3); color: var(--text-main); margin-bottom: 0.25rem; }
        .history-empty {
            text-align: center;
            padding: 3rem;
            color: var(--text-muted);
        }

        .duplicate-banner {
            background: #fef3c7;
            border: 1px solid #fde68a;
            border-radius: var(--radius);
            padding: 1rem 1.5rem;
            margin-bottom: 1rem;
            display: none;
            align-items: center;
            justify-content: space-between;
        }

        .duplicate-banner p { font-size: 0.875rem; color: #92400e; }

        .duplicate-actions { display: flex; gap: 0.5rem; }

        .duplicate-actions button {
            padding: 0.4rem 1rem;
            font-size: 0.8rem;
            border-radius: 8px;
        }

        /* Result Area */
        .result-container { display: none; }

        .result-card {
            background: var(--card-bg);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            border: 1px solid var(--border-light);
            overflow: hidden;
        }

        .card-header {
            padding: 1rem 2rem;
            border-bottom: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .card-tabs { display: flex; gap: 1.5rem; }

        .tab {
            padding-bottom: 0.75rem;
            color: var(--text-muted);
            cursor: pointer;
            font-weight: 600;
            font-size: 0.9rem;
            position: relative;
            border: none;
            background: none;
        }

        .tab.active { color: var(--primary); }

        .tab.active::after {
            content: '';
            position: absolute;
            bottom: 0; left: 0;
            width: 100%;
            height: 3px;
            background-color: var(--primary);
            border-radius: 3px;
        }

        .card-meta {
            display: flex;
            gap: 1rem;
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        .card-body { padding: 1.5rem 2rem; }

        .tab-content { display: none; }
        .tab-content.active { display: block; }

        .transcript-textarea {
            width: 100%;
            height: 350px;
            padding: 1.25rem;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            font-family: inherit;
            font-size: 1rem;
            line-height: 1.8;
            color: var(--text-main);
            resize: vertical;
            background-color: var(--bg);
            outline: none;
        }

        .transcript-textarea:focus {
            border-color: var(--primary);
            background-color: var(--card-bg);
            box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
        }

        /* Timestamp view */
        .segments-list {
            max-height: 400px;
            overflow-y: auto;
            border: 1px solid var(--border);
            border-radius: var(--radius);
        }

        .segment-row {
            display: flex;
            gap: 1rem;
            padding: 0.75rem 1.25rem;
            border-bottom: 1px solid var(--border-light);
            font-size: 0.95rem;
            align-items: flex-start;
        }

        .segment-row:last-child { border-bottom: none; }
        .segment-row:hover { background: var(--bg); }

        .segment-time {
            font-family: 'SF Mono', 'Fira Code', monospace;
            font-size: 0.8rem;
            color: var(--primary);
            background: rgba(37, 99, 235, 0.08);
            padding: 0.2rem 0.5rem;
            border-radius: 6px;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .segment-text { color: var(--text-main); line-height: 1.5; }

        /* Action buttons row */
        .action-row {
            display: flex;
            gap: 0.75rem;
            margin-top: 1.25rem;
        }

        .action-btn {
            flex: 1;
            padding: 0.875rem;
            border-radius: var(--radius);
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: all 0.2s;
        }

        .action-btn.copy {
            background-color: var(--emerald);
            color: white;
            border: none;
        }

        .action-btn.copy:hover { background-color: var(--emerald-dark); }

        .action-btn.export {
            background: var(--card-bg);
            border: 1px solid var(--border);
            color: var(--text-main);
        }

        .action-btn.export:hover {
            border-color: var(--primary);
            color: var(--primary);
        }

        /* Batch results */
        .batch-results { display: none; }

        .batch-item {
            background: var(--card-bg);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            border: 1px solid var(--border-light);
            margin-bottom: 1rem;
            overflow: hidden;
        }

        .batch-item-header {
            padding: 1rem 1.5rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            border-bottom: 1px solid var(--border-light);
        }

        .batch-item-header:hover { background: var(--bg); }

        .batch-item-title {
            font-weight: 600;
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .batch-status {
            font-size: 0.75rem;
            padding: 0.2rem 0.6rem;
            border-radius: 999px;
            font-weight: 600;
        }

        .batch-status.success { background: #dcfce7; color: #16a34a; }
        .batch-status.error { background: #fee2e2; color: #dc2626; }

        .batch-item-body {
            padding: 1rem 1.5rem;
            display: none;
        }

        .batch-item-body.open { display: block; }

        .batch-item-body textarea {
            width: 100%;
            height: 120px;
            padding: 0.75rem;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-family: inherit;
            font-size: 0.9rem;
            line-height: 1.6;
            resize: vertical;
            outline: none;
        }

        .batch-copy-btn {
            margin-top: 0.5rem;
            width: 100%;
            padding: 0.5rem;
            background-color: var(--emerald);
            color: white;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        .batch-copy-btn:hover { background-color: var(--emerald-dark); }

        /* Viral Badge */
        .viral-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.3rem 0.75rem;
            border-radius: 999px;
            font-size: 0.8rem;
            font-weight: 700;
        }

        .viral-badge.grade-S { background: #fef3c7; color: #b45309; }
        .viral-badge.grade-A { background: #dbeafe; color: #1d4ed8; }
        .viral-badge.grade-B { background: #f3f4f6; color: #4b5563; }
        .viral-badge.grade-C { background: #f9fafb; color: #9ca3af; }

        .viral-score-num { font-size: 0.7rem; font-weight: 500; opacity: 0.8; }

        /* Viral Score Card */
        .viral-card {
            display: none;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 1.5rem;
            margin-bottom: 1rem;
            box-shadow: var(--shadow);
        }
        .viral-card.visible { display: block; }
        .viral-card-header {
            display: flex;
            align-items: center;
            gap: 1.25rem;
            margin-bottom: 1.25rem;
        }
        .viral-score-circle {
            width: 80px; height: 80px;
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            flex-shrink: 0;
        }
        .viral-score-circle .score-num { font-size: 1.5rem; line-height: 1; }
        .viral-score-circle .score-max { font-size: 0.7rem; font-weight: 500; opacity: 0.6; }
        .viral-score-circle .score-grade { font-size: 0.65rem; font-weight: 600; opacity: 0.8; margin-top: 3px; }
        .viral-score-circle.grade-S { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }
        .viral-score-circle.grade-A { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1e40af; }
        .viral-score-circle.grade-B { background: linear-gradient(135deg, #f3f4f6, #e5e7eb); color: #374151; }
        .viral-score-circle.grade-C { background: linear-gradient(135deg, #f9fafb, #f3f4f6); color: #6b7280; }
        .viral-card-summary { flex: 1; }
        .viral-card-summary h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
        .viral-card-summary p { font-size: 0.85rem; color: var(--text-muted); }
        .viral-bars { display: flex; flex-direction: column; gap: 0.6rem; }
        .viral-bar-row {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-size: 0.8rem;
        }
        .viral-bar-label { width: 90px; color: var(--text-muted); flex-shrink: 0; }
        .viral-bar-track {
            flex: 1; height: 8px;
            background: var(--border-light);
            border-radius: 4px;
            overflow: hidden;
        }
        .viral-bar-fill {
            height: 100%;
            border-radius: 4px;
            transition: width 0.6s ease;
        }
        .viral-bar-fill.bar-views { background: #2563eb; }
        .viral-bar-fill.bar-likes { background: #ef4444; }
        .viral-bar-fill.bar-comments { background: #8b5cf6; }
        .viral-bar-fill.bar-engage { background: #10b981; }
        .viral-bar-val { width: 36px; text-align: right; font-weight: 600; font-size: 0.75rem; }
        .viral-criteria {
            margin-top: 1rem;
            padding-top: 0.75rem;
            border-top: 1px solid var(--border-light);
            font-size: 0.75rem;
            color: var(--text-muted);
            line-height: 1.6;
        }

        /* Hook Finder Card */
        .hook-card {
            display: none;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 1.5rem;
            margin-bottom: 1rem;
            box-shadow: var(--shadow);
        }
        .hook-card.visible { display: block; }
        .hook-card h3 { font-size: 1rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
        .hook-card h3 i { color: var(--primary); }
        .hook-zone {
            background: rgba(37,99,235,0.06);
            border: 1px solid rgba(37,99,235,0.15);
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 0.75rem;
        }
        .hook-zone-label {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--primary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 0.5rem;
        }
        .hook-zone-text { font-size: 0.95rem; line-height: 1.6; }
        .hook-segments { display: flex; flex-direction: column; gap: 0.5rem; }
        .hook-segment {
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            padding: 0.5rem 0;
            border-bottom: 1px solid var(--border-light);
            font-size: 0.85rem;
        }
        .hook-segment:last-child { border-bottom: none; }
        .hook-time {
            font-family: monospace;
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--primary);
            background: rgba(37,99,235,0.1);
            padding: 0.2rem 0.5rem;
            border-radius: 4px;
            white-space: nowrap;
        }
        .hook-tip {
            margin-top: 0.75rem;
            padding: 0.75rem 1rem;
            background: rgba(99,102,241,0.06);
            border: 1px solid rgba(99,102,241,0.15);
            border-radius: 8px;
            font-size: 0.8rem;
            color: var(--text-muted);
        }

        /* Metadata Panel */
        .meta-panel {
            display: none;
            gap: 1.25rem;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 1.25rem;
            margin-bottom: 1rem;
            box-shadow: var(--shadow);
        }

        .meta-panel.visible { display: flex; }

        .meta-thumbnail {
            width: 160px;
            height: 200px;
            border-radius: 8px;
            object-fit: cover;
            background: var(--border-light);
            flex-shrink: 0;
        }

        .meta-info { flex: 1; min-width: 0; }

        .meta-info h3 {
            font-size: 1rem;
            font-weight: 700;
            margin-bottom: 0.25rem;
            line-height: 1.4;
        }

        .meta-uploader {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-bottom: 0.75rem;
        }

        .meta-stats {
            display: flex;
            gap: 1rem;
            margin-bottom: 0.75rem;
            flex-wrap: wrap;
        }

        .meta-stat {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-main);
        }

        .meta-stat i { color: var(--text-muted); font-size: 0.8rem; }

        .meta-description {
            font-size: 0.85rem;
            color: var(--text-muted);
            line-height: 1.5;
            white-space: pre-wrap;
            word-break: break-word;
        }
        .meta-description.collapsed {
            max-height: 80px;
            overflow: hidden;
            cursor: pointer;
            position: relative;
        }
        .meta-description.collapsed::after {
            content: '...더보기';
            position: absolute;
            bottom: 0;
            right: 0;
            padding: 0 0.5rem;
            background: var(--bg-primary);
            color: var(--primary);
            font-size: 0.75rem;
        }

        .meta-thumb-ocr {
            font-size: 0.75rem;
            color: var(--primary);
            margin-top: 0.5rem;
            background: rgba(37, 99, 235, 0.06);
            padding: 0.4rem 0.6rem;
            border-radius: 6px;
        }

        /* Drag & Drop */
        .dropzone-active {
            border: 2px dashed var(--primary) !important;
            background: rgba(37, 99, 235, 0.05) !important;
        }

        .drop-overlay {
            display: none;
            position: absolute;
            inset: 0;
            background: rgba(37, 99, 235, 0.08);
            border-radius: var(--radius);
            z-index: 10;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            color: var(--primary);
            font-size: 1.1rem;
            pointer-events: none;
        }

        .dropzone-active .drop-overlay { display: flex; }

        /* Stats Cards */
        .stats-row {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .stat-card {
            background: var(--card-bg);
            border: 1px solid var(--border-light);
            border-radius: var(--radius);
            padding: 1rem 1.25rem;
            box-shadow: var(--shadow);
        }

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

        .stat-card .stat-value {
            font-size: 1.5rem;
            font-weight: 700;
            margin-top: 0.25rem;
        }

        /* Theme Toggle */
        .theme-toggle {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1rem;
            border-radius: var(--radius);
            cursor: pointer;
            color: var(--text-muted);
            font-weight: 500;
            font-size: 0.9rem;
            transition: all 0.2s;
            border: none;
            background: none;
            width: 100%;
        }

        .theme-toggle:hover { background: rgba(37, 99, 235, 0.08); color: var(--primary); }

        /* Mobile hamburger */
        .mobile-header {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0;
            height: 56px;
            background: var(--sidebar-bg);
            border-bottom: 1px solid var(--border);
            z-index: 100;
            align-items: center;
            padding: 0 1rem;
            gap: 1rem;
        }

        .hamburger {
            background: none; border: none; font-size: 1.4rem;
            color: var(--text-main); cursor: pointer;
            min-width: 44px; min-height: 44px;
            display: flex; align-items: center; justify-content: center;
        }

        .mobile-header .logo { margin-bottom: 0; font-size: 1.2rem; }

        .sidebar-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.4);
            z-index: 199;
        }

        .sidebar-overlay.open { display: block; }

        /* CDO #14 — mobile intent-authenticated visibility.
           Fixes KO-mobile case where .open class leaked without user ever clicking hamburger.
           On mobile, require data-user-opened="true" (set by JS hamburger click) AND .open. */
        @media (max-width: 768px) {
            .sidebar-overlay:not([data-user-opened="true"]) { display: none !important; }
        }

        /* Animations */
        @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
        @keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(0.96); } }
        @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-4px); } }

        .fade-in { animation: fadeIn 0.3s ease-out; }
        .pulse { animation: pulse 0.15s ease; }
        .fade-out { animation: fadeOut 0.25s ease-out forwards; }

        /* Responsive */
        @media (max-width: 768px) {
            .mobile-header { display: flex; }
            .sidebar { transform: translateX(-100%); z-index: 200; transition: transform 0.25s ease; }
            .sidebar.open { transform: translateX(0); }
            .main-content { margin-left: 0; padding: 1rem; padding-top: 72px; }
            .input-group { flex-direction: column; }
            .input-group button { width: 100%; justify-content: center; padding: 0.875rem; }
            .options-row { flex-direction: column; }
            .action-row { flex-direction: column; }
            .stats-row { grid-template-columns: 1fr; }
            header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
            .hero-section { padding: 1.5rem 1rem; }
            .hero-section h2 { font-size: 1.35rem; }
            .hero-features { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
            /* Fix 2: Pricing cards 1-column on mobile */
            #pricingView [style*="grid-template-columns"] { grid-template-columns: 1fr !important; max-width: 400px !important; }
        }

/* How it works */
.how-it-works {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 0;
    margin-bottom: 1rem;
}
.how-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex: 1;
    max-width: 200px;
    position: relative;
}
.how-step-num {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.how-step i { font-size: 1.5rem; color: var(--primary); }
.how-step strong { font-size: 0.95rem; }
.how-step span { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }
.how-step-arrow { color: var(--text-muted); font-size: 0.9rem; }

/* Social proof */
.social-proof {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.social-proof strong { color: var(--primary); font-weight: 700; }

@media (max-width: 768px) {
    .how-it-works { flex-direction: column; gap: 0.75rem; }
    .how-step { max-width: 100%; flex-direction: row; padding: 1rem; gap: 1rem; text-align: left; }
    .how-step-num { top: 50%; left: -12px; transform: translateY(-50%); }
    .how-step-arrow { display: none; }
    .social-proof { flex-wrap: wrap; gap: 1rem; }
}

/* Sample button */
.sample-btn {
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
}
.sample-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(37, 99, 235, 0.04);
}

/* --- Inline Error Card (replaces alert() -- non-blocking, scannable) --- */
.error-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-left: 4px solid #ef4444;
    border-radius: var(--radius);
    color: var(--text-main);
    font-size: 0.9rem;
    line-height: 1.5;
}
.error-card-icon {
    flex-shrink: 0;
    color: #ef4444;
    font-size: 1.1rem;
    padding-top: 0.1rem;
}
.error-card-body { flex: 1; min-width: 0; }
.error-card-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #b91c1c;
}
.error-card-message {
    white-space: pre-line;
    color: var(--text-main);
}
.error-card-dismiss {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
}
.error-card-dismiss:hover { color: var(--text-main); }

/* --- AI-rewritten label (EU AI Act Art 50(2) transparency requirement) --- */
.ai-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
    border: 1px solid rgba(124, 58, 237, 0.25);
    margin-bottom: 0.75rem;
}
.ai-label::before {
    content: "\f544"; /* fa-robot */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

/* --- Popular pill: pull inside the card edge on narrow viewports --- */
@media (max-width: 480px) {
    [data-i18n="pricing_popular"] {
        right: 0.75rem !important;
        padding: 0.25rem 0.6rem !important;
    }
}
