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

        :root {
            --primary: #2563EB;
            --primary-dark: #1D4ED8;
            --primary-light: #DBEAFE;
            --primary-lighter: #EFF6FF;
            --secondary: #10B981;
            --secondary-light: #D1FAE5;
            --accent: #F59E0B;
            --bg: #F9FAFB;
            --bg-white: #FFFFFF;
            --text: #1F2937;
            --text-light: #6B7280;
            --text-lighter: #9CA3AF;
            --border: #E5E7EB;
            --border-light: #F3F4F6;
            --danger: #EF4444;
            --danger-light: #FEE2E2;
            --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
            --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
            --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
            --radius: 12px;
            --radius-lg: 16px;
            --radius-full: 9999px;
        }

        /* ========== DARK MODE ========== */
        body { transition: background-color 0.3s, color 0.3s; }

        body.dark-mode {
            --primary: #3B82F6;
            --primary-dark: #2563EB;
            --primary-light: #1E3A5F;
            --primary-lighter: #172554;
            --secondary: #34D399;
            --secondary-dark: #10B981;
            --secondary-light: #064E3B;
            --accent: #FBBF24;
            --accent-dark: #F59E0B;
            --bg: #0F172A;
            --bg-white: #1E293B;
            --text: #F1F5F9;
            --text-light: #94A3B8;
            --text-lighter: #64748B;
            --border: #334155;
            --border-light: #1E293B;
            --danger: #F87171;
            --danger-light: #450A0A;
            --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
            --shadow: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
            --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.3);
        }

        /* Dark mode overrides for hardcoded elements */
        body.dark-mode .sidebar { background: var(--bg) !important; }
        body.dark-mode .sidebar-plan-badge { background: #854D0E !important; color: #FDE68A !important; }
        body.dark-mode .upload-zone { background: var(--primary-lighter) !important; }
        body.dark-mode .upload-zone.has-files { background: var(--bg) !important; border-color: var(--border) !important; }
        body.dark-mode .cv-box.has-file { background: var(--bg) !important; border-color: var(--border) !important; }
        body.dark-mode .uploaded-file { background: var(--secondary-light) !important; border-color: var(--secondary-dark) !important; }
        body.dark-mode .photo-preview-box { background: var(--bg) !important; }
        body.dark-mode .form-input, body.dark-mode .form-textarea, body.dark-mode textarea, body.dark-mode select { background: var(--bg) !important; color: var(--text) !important; border-color: var(--border) !important; }
        body.dark-mode .form-input:focus, body.dark-mode .form-textarea:focus, body.dark-mode textarea:focus { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important; }
        body.dark-mode .tab-btn { background: var(--bg) !important; color: var(--text-light) !important; }
        body.dark-mode .tab-btn.active { background: var(--primary) !important; color: white !important; }
        body.dark-mode [style*="background: white"], body.dark-mode [style*="background:white"] { background: var(--bg-white) !important; }
        body.dark-mode [style*="background:#ecfdf5"] { background: #064E3B !important; color: #6EE7B7 !important; }
        body.dark-mode [style*="background:#fef2f2"], body.dark-mode [style*="background: #fef2f2"] { background: #450A0A !important; color: #FCA5A5 !important; }
        body.dark-mode .chat-message-assistant { background: var(--bg) !important; }
        body.dark-mode .chat-message-user { background: var(--primary) !important; }
        body.dark-mode .pricing-modal-content { background: var(--bg-white) !important; color: var(--text) !important; }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            color: var(--text);
            background: var(--bg);
            line-height: 1.6;
            min-height: 100vh;
        }

        /* ========== APP LAYOUT ========== */
        .app-layout {
            display: flex;
            min-height: 100vh;
        }

        /* ========== SIDEBAR ========== */
        .sidebar {
            width: 280px;
            background: var(--bg-white);
            border-right: 1px solid var(--border);
            padding: 24px 0;
            display: flex;
            flex-direction: column;
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            z-index: 50;
            transition: width 0.25s ease, transform 0.3s;
            overflow: hidden;
        }

        /* Collapsed state */
        .sidebar.collapsed {
            width: 68px;
        }
        .sidebar.collapsed .sidebar-logo-text,
        .sidebar.collapsed .sidebar-nav-label,
        .sidebar.collapsed .sidebar-credits,
        .sidebar.collapsed .sidebar-upgrade,
        .sidebar.collapsed .sidebar-logout {
            opacity: 0;
            pointer-events: none;
            width: 0;
            height: 0;
            overflow: hidden;
            white-space: nowrap;
            margin: 0;
            padding: 0;
        }
        .sidebar.collapsed .sidebar-logo {
            padding: 0 16px;
            justify-content: center;
        }
        .sidebar.collapsed .sidebar-nav a {
            padding: 12px 0;
            justify-content: center;
            border-left: 3px solid transparent;
        }
        .sidebar.collapsed .sidebar-nav-icon svg {
            width: 22px;
            height: 22px;
        }
        .sidebar.collapsed .sidebar-toggle-btn {
            margin: 0 auto;
        }

        /* Toggle button */
        .sidebar-toggle-btn {
            width: 36px;
            height: 36px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-white);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            color: var(--text-light);
            transition: all 0.2s;
            flex-shrink: 0;
            position: relative;
            z-index: 10;
        }
        .sidebar-toggle-btn:hover {
            background: var(--bg);
            color: var(--primary);
            border-color: var(--primary);
        }
        /* Pin indicator when pinned */
        .sidebar-toggle-btn.pinned {
            color: var(--primary);
            border-color: var(--primary);
            background: var(--primary-lighter);
        }

        .sidebar-logo-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 16px 0 24px;
            margin-bottom: 32px;
            gap: 8px;
        }
        .sidebar.collapsed .sidebar-logo-row {
            padding: 0;
            justify-content: center;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .sidebar-logo {
            display: flex;
            align-items: center;
            gap: 10px;
            text-decoration: none;
            color: var(--primary);
            font-weight: 800;
            font-size: 17px;
            white-space: nowrap;
            overflow: hidden;
            min-width: 0;
        }

        .sidebar-logo-icon {
            width: 36px;
            height: 36px;
            background: var(--primary);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 16px;
        }

        .sidebar-nav {
            flex: 1;
            list-style: none;
        }

        .sidebar-nav li { margin-bottom: 2px; }

        .sidebar-nav a {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 24px;
            color: var(--text-light);
            text-decoration: none;
            font-weight: 500;
            font-size: 15px;
            transition: all 0.2s;
            border-left: 3px solid transparent;
        }

        .sidebar-nav a:hover {
            background: var(--bg);
            color: var(--text);
        }

        .sidebar-nav a.active {
            background: var(--primary-lighter);
            color: var(--primary);
            border-left-color: var(--primary);
            font-weight: 600;
        }

        .sidebar-nav-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
        .sidebar-nav-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
        .sidebar-nav-label { transition: opacity 0.2s; white-space: nowrap; }
        .sidebar-logo-text { transition: opacity 0.2s; white-space: nowrap; }

        .sidebar-credits {
            padding: 20px 24px;
            margin: 0 16px;
            background: var(--primary-lighter);
            border-radius: var(--radius);
        }

        .sidebar-credits-label {
            font-size: 13px;
            color: var(--text-light);
            margin-bottom: 8px;
        }

        .sidebar-credits-bar {
            height: 8px;
            background: var(--primary-light);
            border-radius: 4px;
            overflow: hidden;
            margin-bottom: 8px;
        }

        .sidebar-credits-fill {
            height: 100%;
            background: var(--primary);
            border-radius: 4px;
            transition: width 0.5s;
        }

        .sidebar-credits-text {
            font-size: 13px;
            font-weight: 600;
            color: var(--primary);
        }

        .sidebar-upgrade {
            display: block;
            margin: 16px 16px 0;
            padding: 12px;
            background: var(--primary);
            color: white;
            text-align: center;
            border-radius: var(--radius);
            text-decoration: none;
            font-weight: 600;
            font-size: 14px;
            transition: background 0.2s;
        }

        .sidebar-upgrade:hover { background: var(--primary-dark); }

        .sidebar-logout {
            display: block;
            margin: 8px 16px 0;
            padding: 10px 12px;
            background: transparent;
            color: var(--text-light);
            text-align: center;
            border-radius: var(--radius);
            text-decoration: none;
            font-weight: 500;
            font-size: 13px;
            border: 1px solid var(--border);
            transition: background 0.2s;
        }
        .sidebar-logout:hover { background: var(--border-light); }

        .sidebar-plan-badge {
            display: inline-block;
            font-size: 10px;
            font-weight: 700;
            padding: 2px 8px;
            border-radius: var(--radius-full);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .sidebar-plan-badge-free {
            background: var(--border-light);
            color: var(--text-light);
        }

        .sidebar-plan-badge-basic {
            background: var(--primary-light);
            color: var(--primary);
        }

        .sidebar-plan-badge-pro {
            background: #FDE68A;
            color: #92400E;
        }

        /* ===== PRICING MODAL ===== */
        .modal-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            backdrop-filter: blur(4px);
        }

        .pricing-modal {
            background: var(--bg-white);
            border-radius: 20px;
            padding: 40px;
            max-width: 900px;
            width: 95%;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
            box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
        }

        .pricing-modal-close {
            position: absolute;
            top: 16px; right: 20px;
            background: none;
            border: none;
            font-size: 28px;
            color: var(--text-light);
            cursor: pointer;
            width: 40px; height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.2s;
        }

        .pricing-modal-close:hover {
            background: var(--border-light);
            color: var(--text);
        }

        .pricing-modal-title {
            text-align: center;
            font-size: 28px;
            font-weight: 800;
            margin-bottom: 8px;
        }

        .pricing-modal-subtitle {
            text-align: center;
            color: var(--text-light);
            font-size: 16px;
            margin-bottom: 32px;
        }

        .pricing-cards {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
        }

        .pricing-card {
            border: 2px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 28px 24px;
            display: flex;
            flex-direction: column;
            position: relative;
            transition: all 0.3s;
        }

        .pricing-card:hover {
            border-color: var(--primary);
            box-shadow: var(--shadow-lg);
            transform: translateY(-4px);
        }

        .pricing-card-highlight {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px rgba(37,99,235,0.1), var(--shadow-lg);
        }

        .pricing-card-current {
            border-color: var(--secondary);
            background: #F0FDF4;
        }

        .pricing-card-badge-top {
            position: absolute;
            top: -12px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--primary);
            color: white;
            font-size: 12px;
            font-weight: 700;
            padding: 4px 16px;
            border-radius: var(--radius-full);
        }

        .pricing-card-header {
            text-align: center;
            margin-bottom: 24px;
            padding-bottom: 20px;
            border-bottom: 1px solid var(--border-light);
        }

        .pricing-plan-name {
            display: block;
            font-size: 20px;
            font-weight: 700;
            margin-bottom: 8px;
        }

        .pricing-price-row {
            display: flex;
            align-items: baseline;
            justify-content: center;
            gap: 4px;
        }

        .pricing-price {
            font-size: 36px;
            font-weight: 800;
            color: var(--text);
        }

        .pricing-period {
            font-size: 14px;
            color: var(--text-light);
            white-space: nowrap;
        }

        .pricing-features {
            list-style: none;
            flex: 1;
            margin-bottom: 24px;
        }

        .pricing-features li {
            padding: 8px 0;
            font-size: 14px;
            color: var(--text);
        }

        .pricing-feature-disabled {
            color: var(--text-lighter) !important;
            text-decoration: line-through;
        }

        .pricing-btn {
            width: 100%;
            padding: 14px;
            font-size: 15px;
            font-weight: 600;
            border-radius: var(--radius);
            cursor: pointer;
            border: 2px solid var(--primary);
            background: var(--primary-light);
            color: var(--primary);
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            text-decoration: none;
        }

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

        .pricing-card-highlight .pricing-btn {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        .pricing-card-highlight .pricing-btn:hover {
            background: var(--primary-dark);
            border-color: var(--primary-dark);
            color: white;
        }

        .pricing-btn-current {
            border-color: var(--secondary);
            background: var(--secondary-light);
            color: var(--secondary);
            cursor: default;
        }

        .pricing-btn-current:hover {
            background: var(--secondary-light);
            color: var(--secondary);
        }

        @media (max-width: 768px) {
            .pricing-cards {
                grid-template-columns: 1fr;
                gap: 16px;
            }
        }

        /* ========== MAIN CONTENT ========== */
        .main {
            margin-left: 280px;
            flex: 1;
            display: flex;
            justify-content: center;
            padding: 32px 40px;
            transition: margin-left 0.25s ease;
        }
        .sidebar.collapsed ~ .main {
            margin-left: 68px;
        }

        .app-page {
            width: 100%;
            max-width: 900px;
        }

        .main-header {
            margin-bottom: 40px;
            text-align: center;
        }

        .main-header h1 {
            font-size: 28px;
            font-weight: 800;
            margin-bottom: 8px;
        }

        .main-header p {
            color: var(--text-light);
            font-size: 16px;
        }

        /* ========== PROGRESS STEPS ========== */
        .progress-bar {
            display: flex;
            align-items: center;
            margin-bottom: 48px;
            gap: 0;
        }

        .progress-step {
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            position: relative;
        }

        .progress-step-circle {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 15px;
            border: 2px solid var(--border);
            background: var(--bg-white);
            color: var(--text-lighter);
            transition: all 0.3s;
            flex-shrink: 0;
        }

        .progress-step.active .progress-step-circle {
            border-color: var(--primary);
            background: var(--primary);
            color: white;
        }

        .progress-step.completed .progress-step-circle {
            border-color: var(--secondary);
            background: var(--secondary);
            color: white;
        }

        .progress-step-label {
            font-size: 14px;
            font-weight: 500;
            color: var(--text-lighter);
            white-space: nowrap;
        }

        .progress-step.active .progress-step-label { color: var(--primary); font-weight: 600; }
        .progress-step.completed .progress-step-label { color: var(--secondary); }
        .progress-step:not(.active):not(.completed) { cursor: default; opacity: 0.5; }
        .progress-step.completed, .progress-step.active { cursor: pointer; }
        .progress-step.completed:hover .progress-step-circle,
        .progress-step.active:hover .progress-step-circle {
            transform: scale(1.1);
            box-shadow: 0 0 0 4px rgba(37,99,235,0.15);
        }
        .progress-step-circle { transition: transform 0.2s, box-shadow 0.2s; }

        .progress-line {
            flex: 1;
            height: 2px;
            background: var(--border);
            margin: 0 16px;
            position: relative;
        }

        .progress-line.completed { background: var(--secondary); }

        /* ========== FORM STEPS ========== */
        .step-content {
            display: none;
            animation: fadeIn 0.4s ease;
        }

        .step-content.active { display: block; }

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

        /* ========== UPLOAD AREA ========== */
        .upload-zone {
            border: 2px dashed var(--border);
            border-radius: var(--radius-lg);
            padding: 48px 32px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
            background: var(--primary-lighter);
            position: relative;
        }

        .upload-zone:hover,
        .upload-zone.dragover {
            border-color: var(--primary);
            background: var(--primary-lighter);
        }

        .upload-zone-icon {
            font-size: 48px;
            margin-bottom: 16px;
            opacity: 0.6;
        }

        .upload-zone-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .upload-zone-subtitle {
            font-size: 14px;
            color: var(--text-light);
            margin-bottom: 20px;
        }

        .upload-zone-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 24px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius-full);
            font-weight: 600;
            font-size: 14px;
            cursor: pointer;
            transition: background 0.2s;
        }

        .upload-zone-btn:hover { background: var(--primary-dark); }

        .upload-zone input[type="file"] {
            position: absolute;
            inset: 0;
            opacity: 0;
            cursor: pointer;
        }
        .upload-zone .upload-zone-btn {
            position: relative;
            z-index: 1;
        }

        .upload-zone-placeholder {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .upload-zone.has-files {
            padding: 16px;
            text-align: left;
            cursor: default;
            border-color: var(--border);
            background: var(--bg);
        }
        .upload-zone.has-files .upload-zone-placeholder { display: none; }
        .upload-zone.has-files .uploaded-file:first-child { margin-top: 0; }
        .upload-zone.has-files input[type="file"] { position: static; opacity: 0; height: 0; width: 0; }

        .docs-add-more-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            width: 100%;
            padding: 10px 16px;
            background: var(--primary-light);
            color: var(--primary);
            border: 1px dashed var(--primary);
            border-radius: var(--radius);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            position: relative;
            transition: background 0.2s;
            white-space: nowrap;
            margin-top: auto;
        }
        .docs-add-more-btn:hover { background: var(--primary-lighter); }
        .docs-add-more-btn input[type="file"] {
            position: absolute;
            inset: 0;
            opacity: 0;
            cursor: pointer;
        }

        /* 3-column grid for document upload cards, immer gleiche Hoehe */
        .docs-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 14px;
            align-items: stretch;
        }
        .docs-grid .form-group {
            margin-bottom: 0;
            display: flex;
            flex-direction: column;
        }
        .docs-grid .form-group > .form-label { flex-shrink: 0; }
        .docs-grid .form-group > .upload-zone {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .docs-grid .upload-zone { padding: 18px 12px; min-height: 140px; }
        .docs-grid .upload-zone-placeholder { text-align: center; }
        .docs-grid .upload-zone-icon { font-size: 22px !important; }
        .docs-grid .upload-zone-title { font-size: 13px !important; }
        .docs-grid .upload-zone-subtitle { font-size: 11px !important; }
        .docs-grid .upload-formats { font-size: 10px !important; margin-top: 8px; }
        .docs-grid .uploaded-file { padding: 10px 12px; gap: 8px; margin-top: 0; }
        .docs-grid .uploaded-file-name {
            font-size: 11px;
        }
        .docs-grid .uploaded-file-icon { width: 22px; height: 22px; }
        .docs-grid .uploaded-file-meta { font-size: 11px; }
        .docs-grid .docs-file-display { display: flex; flex-direction: column; flex: 1; gap: 8px; }
        .docs-grid .docs-file-display .uploaded-file { margin-top: 0; margin-bottom: 0; flex: 1; }
        .docs-grid .upload-zone.has-files { justify-content: flex-start; align-items: stretch; padding: 8px; gap: 0; }
        @media (max-width: 800px) {
            .docs-grid { grid-template-columns: 1fr 1fr; }
        }
        @media (max-width: 500px) {
            .docs-grid { grid-template-columns: 1fr; }
        }

        .upload-formats {
            margin-top: 16px;
            font-size: 12px;
            color: var(--text-lighter);
        }

        /* Top row: Foto + Lebenslauf nebeneinander, immer gleiche Hoehe */
        .top-upload-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            align-items: stretch;
        }
        .top-upload-grid > .form-group {
            margin-bottom: 0;
            display: flex;
            flex-direction: column;
        }
        .top-upload-grid > .form-group > .form-label { flex-shrink: 0; }
        .top-upload-grid > .form-group > .upload-zone,
        .top-upload-grid > .form-group > .cv-box,
        .top-upload-grid > .form-group > #photoPreviewContainer {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        .top-upload-grid > .form-group > .cv-box {
            align-items: stretch;
        }
        .top-upload-grid .upload-zone {
            min-height: 160px;
            padding: 16px 16px;
        }
        .top-upload-grid .upload-zone-icon { font-size: 28px !important; margin-bottom: 6px !important; }
        .top-upload-grid .upload-zone-title { font-size: 14px !important; margin-bottom: 3px !important; }
        .top-upload-grid .upload-zone-subtitle { font-size: 12px !important; margin-bottom: 8px !important; }
        .top-upload-grid .upload-zone-btn { padding: 8px 20px !important; font-size: 13px !important; }
        .top-upload-grid .upload-formats { margin-top: 6px !important; font-size: 10px !important; }
        @media (max-width: 700px) {
            .top-upload-grid { grid-template-columns: 1fr; }
        }

        /* Photo upload: silhouette placeholder */
        .photo-upload-zone { position: relative; overflow: hidden; }
        .photo-silhouette {
            position: absolute;
            top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            width: 60px; height: 75px;
            opacity: 0.08;
            pointer-events: none;
            color: var(--text);
        }
        .photo-upload-zone:hover .photo-silhouette { opacity: 0.12; }

        /* Photo preview (after upload): matches upload zone appearance */
        .photo-preview-box {
            position: relative;
            text-align: center;
            border: 2px dashed var(--border);
            border-radius: var(--radius-lg);
            background: var(--bg);
            padding: 24px 20px;
        }

        /* Generic close button — top-right corner, subtle */
        .close-btn {
            position: absolute;
            top: 8px;
            right: 8px;
            background: none;
            border: none;
            color: var(--text-lighter);
            cursor: pointer;
            font-size: 18px;
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.2s;
            line-height: 1;
            z-index: 2;
        }
        .close-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }

        /* CV Upload Box: dashed border container with toggle inside */
        .cv-box {
            border: 2px dashed var(--border);
            border-radius: var(--radius-lg);
            padding: 16px 20px;
            background: var(--primary-lighter);
            transition: all 0.3s;
            cursor: default;
            display: flex;
            flex-direction: column;
        }
        .cv-box:hover { border-color: var(--primary); background: var(--primary-lighter); }
        .cv-box.has-file { background: var(--bg); border-color: var(--border); padding: 8px; }
        .top-upload-grid > .form-group > .cv-box.has-file { justify-content: flex-start; }
        .cv-box.has-file:hover { background: var(--bg); border-color: var(--border); }
        .cv-box.has-file #cvFileDisplay { justify-content: flex-start; flex: 1; }
        .cv-box.has-file .uploaded-file { margin-top: 0; flex: 1; }
        .cv-box input[type="file"] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
        .cv-box-content { text-align: center; padding: 6px 0 2px; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
        #cvFileDisplay { flex: 1; display: flex; flex-direction: column; justify-content: center; }
        #cvManualMode { flex: 1; display: flex; flex-direction: column; }
        .cv-box-content .upload-zone-icon { font-size: 28px; margin-bottom: 4px; opacity: 0.6; }

        /* CV Mode Toggle — Buttons bis zum Rand der gestrichelten Box */
        .cv-mode-toggle {
            display: flex;
            gap: 8px;
            margin: 0 -4px 8px -4px;
            padding: 0;
        }
        .cv-mode-btn {
            flex: 1;
            padding: 10px 16px;
            border: 2px solid var(--border);
            border-radius: var(--radius);
            background: var(--bg-white);
            color: var(--text-light);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
            white-space: nowrap;
        }
        .cv-mode-btn:hover { border-color: var(--primary); color: var(--primary); }
        .cv-mode-btn.active {
            border-color: var(--primary);
            background: var(--primary-lighter);
            color: var(--primary);
        }

        /* CV Manual Textarea (inside .cv-box, no own border) */
        .cv-manual-textarea {
            width: 100%;
            min-height: 160px;
            flex: 1;
            padding: 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            font-family: inherit;
            font-size: 13px;
            line-height: 1.6;
            color: var(--text);
            background: var(--bg-white);
            resize: vertical;
            transition: border-color 0.2s;
        }
        .cv-manual-textarea:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }
        .cv-manual-textarea::placeholder { color: var(--text-lighter); font-size: 13px; }
        .cv-manual-hint {
            margin-top: 8px;
            font-size: 12px;
            color: var(--text-lighter);
            font-style: italic;
        }

        /* File uploaded state */
        .uploaded-file {
            position: relative;
            display: flex;
            align-items: flex-start;
            gap: 16px;
            padding: 16px 20px;
            background: var(--secondary-light);
            border: 1px solid var(--secondary);
            border-radius: var(--radius);
            margin-top: 16px;
        }

        .uploaded-file-icon { flex-shrink: 0; width: 28px; height: 28px; }
        .uploaded-file-icon svg { width: 100%; height: 100%; }

        .uploaded-file-info { flex: 1; min-width: 0; padding-right: 24px; }

        .uploaded-file-name {
            font-weight: 600;
            font-size: 12px;
            line-height: 1.2;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .uploaded-file-meta {
            font-size: 12px;
            line-height: 1.2;
            display: flex;
            flex-direction: column;
            gap: 0;
            margin-top: 2px;
        }
        .uploaded-file-meta .meta-sections {
            color: var(--primary);
            font-weight: 500;
        }
        .uploaded-file-meta .meta-sections:empty { display: none; }
        .uploaded-file-meta .meta-chars {
            color: var(--secondary);
            font-weight: 500;
        }
        .uploaded-file-meta .meta-size {
            color: var(--text-lighter);
        }
        .uploaded-file-meta .meta-status {
            font-size: 12px;
        }

        .uploaded-file-remove {
            position: absolute;
            top: 6px;
            right: 6px;
            background: none;
            border: none;
            color: var(--text-lighter);
            cursor: pointer;
            font-size: 18px;
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.2s;
            line-height: 1;
        }

        .uploaded-file-remove:hover { background: rgba(255,255,255,0.1); color: var(--text); }

        /* ========== JOB INPUT ========== */
        .input-tabs {
            display: flex;
            gap: 0;
            margin-bottom: 24px;
            border-bottom: 2px solid var(--border);
        }

        .input-tab {
            padding: 12px 24px;
            font-size: 15px;
            font-weight: 500;
            color: var(--text-light);
            background: none;
            border: none;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            margin-bottom: -2px;
            transition: all 0.2s;
        }

        .input-tab.active {
            color: var(--primary);
            border-bottom-color: var(--primary);
            font-weight: 600;
        }

        .input-tab:hover { color: var(--text); }

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

        .form-group { margin-bottom: 24px; }

        .form-label {
            display: block;
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 8px;
            color: var(--text);
        }
        .form-label-row {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            margin-bottom: 8px;
            gap: 0;
        }
        .form-label-row .form-label { margin-bottom: 0; }
        .docs-picker-trigger {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 11px;
            color: var(--primary);
            background: var(--primary-lighter);
            border: 1px solid var(--primary-light);
            border-radius: var(--radius-full);
            padding: 3px 10px;
            cursor: pointer;
            white-space: nowrap;
            user-select: none;
            font-weight: 500;
            transition: all 0.2s;
            margin-top: 4px;
        }
        .docs-picker-trigger:hover { background: var(--primary-light); }
        .docs-picker-dropdown {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            margin-top: 4px;
            min-width: 240px;
            max-height: 240px;
            overflow-y: auto;
            background: var(--bg-white);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            box-shadow: 0 8px 24px rgba(0,0,0,0.12);
            z-index: 100;
            padding: 4px;
        }
        .docs-picker-dropdown.open { display: block; }
        .docs-picker-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            border-radius: var(--radius);
            cursor: pointer;
            font-size: 13px;
            font-weight: 400;
            color: var(--text);
            text-decoration: none;
        }
        .docs-picker-item:hover { background: var(--primary-lighter); }
        .docs-picker-item .doc-meta {
            font-size: 11px;
            color: var(--text-lighter);
            margin-left: auto;
            white-space: nowrap;
        }
        .docs-picker-empty {
            padding: 12px;
            text-align: center;
            font-size: 12px;
            color: var(--text-lighter);
            font-weight: 400;
        }

        .form-input {
            width: 100%;
            padding: 14px 16px;
            border: 2px solid var(--border);
            border-radius: var(--radius);
            font-size: 15px;
            font-family: inherit;
            color: var(--text);
            transition: border-color 0.2s;
            background: var(--bg-white);
        }

        .form-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .form-input::placeholder { color: var(--text-lighter); }

        textarea.form-input {
            min-height: 200px;
            resize: vertical;
            line-height: 1.6;
        }

        .form-hint {
            font-size: 13px;
            color: var(--text-lighter);
            margin-top: 6px;
        }

        /* ========== DETAIL LEVEL CONTROL ========== */
        .detail-level-control {
            display: flex;
            gap: 10px;
        }

        .detail-btn {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            padding: 14px 10px;
            border: 2px solid var(--border);
            border-radius: var(--radius);
            background: var(--card-bg);
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
        }

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

        .detail-btn.active {
            border-color: var(--primary);
            background: color-mix(in srgb, var(--primary) 10%, var(--card-bg));
            box-shadow: 0 0 0 1px var(--primary);
        }

        .detail-icon {
            font-size: 22px;
            line-height: 1;
        }

        .detail-label {
            font-size: 14px;
            font-weight: 700;
            color: var(--text);
        }

        .detail-desc {
            font-size: 11px;
            color: var(--text-lighter);
            line-height: 1.3;
        }

        /* ========== MEINE DOKUMENTE ========== */
        .docs-action-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
            flex-wrap: wrap;
            gap: 12px;
        }
        .docs-actions-left { display: flex; gap: 8px; }
        .btn-sm { padding: 8px 16px; font-size: 13px; }

        .docs-storage-info {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            color: var(--text-lighter);
        }
        .docs-storage-bar {
            width: 80px;
            height: 6px;
            background: var(--border);
            border-radius: 3px;
            overflow: hidden;
        }
        .docs-storage-fill {
            display: block;
            height: 100%;
            background: var(--primary);
            border-radius: 3px;
            transition: width 0.3s;
            width: 0%;
        }

        .docs-folder-tabs {
            display: flex;
            gap: 6px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }
        .docs-folder-tab {
            padding: 6px 14px;
            border: 1px solid var(--border);
            border-radius: 20px;
            background: var(--card-bg);
            cursor: pointer;
            font-size: 13px;
            color: var(--text-light);
            transition: all 0.2s;
            white-space: nowrap;
        }
        .docs-folder-tab:hover { border-color: var(--primary); color: var(--primary); }
        .docs-folder-tab.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        .docs-folder-tab .folder-delete {
            margin-left: 6px;
            opacity: 0.6;
            cursor: pointer;
        }
        .docs-folder-tab .folder-delete:hover { opacity: 1; }

        .docs-dropzone {
            border: 2px dashed var(--primary);
            border-radius: var(--radius);
            padding: 40px;
            text-align: center;
            margin-bottom: 16px;
            background: color-mix(in srgb, var(--primary) 5%, var(--card-bg));
        }

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

        .doc-card {
            background: var(--bg-white);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 16px;
            display: flex;
            align-items: flex-start;
            gap: 12px;
            transition: border-color 0.2s, box-shadow 0.2s;
            position: relative;
        }
        .doc-card:hover {
            border-color: var(--primary);
            box-shadow: 0 2px 8px rgba(0,0,0,0.06);
        }
        .doc-card-icon { font-size: 32px; flex-shrink: 0; line-height: 1; }
        .doc-card-info { flex: 1; min-width: 0; }
        .doc-card-name {
            font-size: 14px;
            font-weight: 600;
            color: var(--text);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .doc-card-meta {
            font-size: 12px;
            color: var(--text-lighter);
            margin-top: 4px;
        }
        .doc-card-source {
            display: inline-block;
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 4px;
            background: color-mix(in srgb, var(--primary) 12%, var(--card-bg));
            color: var(--primary);
            margin-top: 6px;
        }
        .doc-card-actions {
            display: flex;
            gap: 4px;
            flex-shrink: 0;
        }
        .doc-card-actions button {
            width: 28px;
            height: 28px;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--card-bg);
            cursor: pointer;
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s;
        }
        .doc-card-actions button:hover {
            border-color: var(--primary);
            background: color-mix(in srgb, var(--primary) 8%, var(--card-bg));
        }
        .doc-card-actions button.doc-delete:hover {
            border-color: #e53e3e;
            background: #fff5f5;
            color: #e53e3e;
        }

        .docs-modal-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.4);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .docs-modal {
            background: var(--bg-white);
            border-radius: 16px;
            padding: 24px;
            width: 90%;
            max-width: 400px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.15);
        }
        .docs-modal-folder-btn {
            display: block;
            width: 100%;
            padding: 10px 14px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            background: var(--card-bg);
            cursor: pointer;
            text-align: left;
            font-size: 14px;
            transition: all 0.15s;
        }
        .docs-modal-folder-btn:hover {
            border-color: var(--primary);
            background: color-mix(in srgb, var(--primary) 8%, var(--card-bg));
        }

        /* ===== Universal In-Page Dialog ===== */
        .bp-dialog-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.4);
            z-index: 2000;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(4px);
            animation: bpDialogFadeIn 0.15s ease;
        }
        @keyframes bpDialogFadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        .bp-dialog {
            background: var(--bg-white);
            border-radius: 16px;
            padding: 28px;
            width: 90%;
            max-width: 440px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.18);
            animation: bpDialogSlideIn 0.2s ease;
        }
        @keyframes bpDialogSlideIn {
            from { transform: translateY(-12px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        .bp-dialog-icon {
            font-size: 36px;
            margin-bottom: 12px;
            text-align: center;
        }
        .bp-dialog-title {
            font-size: 17px;
            font-weight: 700;
            margin-bottom: 8px;
            text-align: center;
            color: var(--text);
        }
        .bp-dialog-message {
            font-size: 14px;
            color: var(--text-light);
            margin-bottom: 20px;
            text-align: center;
            line-height: 1.5;
        }
        .bp-dialog-input {
            width: 100%;
            padding: 12px 14px;
            border: 2px solid var(--border);
            border-radius: var(--radius);
            font-size: 14px;
            margin-bottom: 20px;
            box-sizing: border-box;
            transition: border-color 0.2s;
            background: var(--bg);
            color: var(--text);
        }
        .bp-dialog-input:focus {
            outline: none;
            border-color: var(--primary);
        }
        .bp-dialog-actions {
            display: flex;
            gap: 10px;
            justify-content: center;
        }
        .bp-dialog-actions .btn {
            flex: 1;
            max-width: 180px;
            justify-content: center;
            text-align: center;
        }
        .bp-dialog-btn-danger {
            background: #dc2626 !important;
            color: white !important;
            border: none !important;
        }
        .bp-dialog-btn-danger:hover {
            background: #b91c1c !important;
        }
        /* Document picker list inside dialog */
        .bp-dialog-list {
            max-height: 300px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-bottom: 16px;
        }
        .bp-dialog-list-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 14px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            background: var(--card-bg);
            cursor: pointer;
            text-align: left;
            font-size: 14px;
            transition: all 0.15s;
        }
        .bp-dialog-list-item:hover {
            border-color: var(--primary);
            background: color-mix(in srgb, var(--primary) 8%, var(--card-bg));
        }
        .bp-dialog-list-item-icon {
            font-size: 20px;
            flex-shrink: 0;
        }
        .bp-dialog-list-item-info {
            flex: 1;
            min-width: 0;
        }
        .bp-dialog-list-item-name {
            font-weight: 600;
            font-size: 13px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .bp-dialog-list-item-meta {
            font-size: 12px;
            color: var(--text-lighter);
        }
        /* Folder context menu (inline options) */
        .bp-dialog-option-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            width: 100%;
            padding: 12px 16px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            background: var(--card-bg);
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.15s;
            color: var(--text);
        }
        .bp-dialog-option-btn:hover {
            border-color: var(--primary);
            background: color-mix(in srgb, var(--primary) 6%, var(--card-bg));
        }
        .bp-dialog-option-btn.danger {
            color: #dc2626;
        }
        .bp-dialog-option-btn.danger:hover {
            border-color: #dc2626;
            background: #fef2f2;
        }

        .spinner-sm {
            width: 18px; height: 18px;
            border: 2px solid var(--border);
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* ========== PREFERENCES ========== */
        .pref-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
        }

        .pref-card-group {
            margin-bottom: 32px;
        }

        .pref-card-group-title {
            font-size: 16px;
            font-weight: 700;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .pref-options {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
        }

        .pref-option {
            position: relative;
        }

        .pref-option input {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }

        .pref-option label {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            padding: 20px 16px;
            border: 2px solid var(--border);
            border-radius: var(--radius);
            cursor: pointer;
            text-align: center;
            transition: all 0.2s;
            background: var(--bg-white);
        }

        .pref-option label:hover {
            border-color: var(--primary-light);
            background: var(--primary-lighter);
        }

        .pref-option input:checked + label {
            border-color: var(--primary);
            background: var(--primary-lighter);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .pref-option-icon { font-size: 28px; }

        .pref-option-label {
            font-weight: 600;
            font-size: 14px;
        }

        .pref-option-desc {
            font-size: 12px;
            color: var(--text-light);
        }

        .select-wrapper {
            position: relative;
        }

        .form-select {
            width: 100%;
            padding: 14px 16px;
            border: 2px solid var(--border);
            border-radius: var(--radius);
            font-size: 15px;
            font-family: inherit;
            color: var(--text);
            background: var(--bg-white);
            cursor: pointer;
            appearance: none;
            transition: border-color 0.2s;
        }

        .form-select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .select-arrow {
            position: absolute;
            right: 16px;
            top: 50%;
            transform: translateY(-50%);
            pointer-events: none;
            color: var(--text-light);
        }

        /* ========== GENERATION SCREEN ========== */
        .generation-screen {
            text-align: center;
            padding: 64px 32px;
            background: var(--bg-white);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border);
        }

        .generation-icon {
            font-size: 64px;
            margin-bottom: 24px;
            animation: bounce 1s infinite;
        }

        @keyframes bounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
        }

        .generation-title {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 12px;
        }

        .generation-subtitle {
            font-size: 16px;
            color: var(--text-light);
            margin-bottom: 40px;
        }

        .generation-progress {
            max-width: 400px;
            margin: 0 auto 32px;
        }

        .generation-progress-bar {
            height: 12px;
            background: var(--border-light);
            border-radius: 6px;
            overflow: hidden;
            margin-bottom: 12px;
        }

        .generation-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            border-radius: 6px;
            transition: width 0.3s ease;
            width: 0%;
            position: relative;
            overflow: hidden;
        }

        .generation-progress-fill::after {
            content: '';
            position: absolute;
            top: 0; left: -100%; width: 200%; height: 100%;
            background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
            animation: shimmer 2s infinite linear;
        }

        @keyframes shimmer {
            0% { left: -100%; }
            100% { left: 100%; }
        }

        .generation-progress-text {
            font-size: 14px;
            color: var(--text-light);
        }

        .generation-steps {
            text-align: left;
            max-width: 320px;
            margin: 0 auto;
        }

        .generation-step {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 0;
            font-size: 15px;
            color: var(--text-lighter);
        }

        .generation-step.done {
            color: var(--secondary);
        }

        .generation-step.active {
            color: var(--primary);
            font-weight: 600;
            animation: pulse-step 1.5s ease-in-out infinite;
        }

        @keyframes pulse-step {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.6; }
        }

        .generation-step-icon { font-size: 18px; width: 24px; text-align: center; }

        /* ========== RESULTS SCREEN ========== */
        .results-header {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin-bottom: 20px;
            padding: 12px 20px;
            background: var(--secondary-light);
            border-radius: var(--radius-lg);
            border: 1px solid var(--secondary);
        }

        .results-header-icon {
            font-size: 22px;
            line-height: 1;
        }

        .results-header h2 {
            font-size: 17px;
            font-weight: 700;
            margin: 0;
            color: #065F46;
        }

        .results-header p {
            color: #065F46;
            font-size: 14px;
            margin: 0;
            opacity: 0.8;
        }

        .results-header .results-separator {
            width: 1px;
            height: 18px;
            background: rgba(6, 95, 70, 0.25);
        }

        .results-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
            margin-bottom: 32px;
        }

        .result-card {
            background: var(--bg-white);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            overflow: hidden;
            transition: all 0.3s;
        }

        .result-card:hover {
            box-shadow: var(--shadow-lg);
            transform: translateY(-2px);
        }

        .result-card-header {
            padding: 20px 24px;
            background: var(--bg);
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .result-card-title {
            font-weight: 700;
            font-size: 16px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .result-card-badge {
            font-size: 11px;
            font-weight: 600;
            padding: 4px 10px;
            border-radius: var(--radius-full);
            background: var(--secondary-light);
            color: var(--secondary);
        }

        .result-card-actions {
            padding: 16px 24px;
            display: flex;
            gap: 12px;
        }

        .btn-sm {
            padding: 10px 20px;
            font-size: 14px;
            border-radius: var(--radius);
            font-weight: 600;
            cursor: pointer;
            border: none;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

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

        .btn-sm-primary:hover:not(:disabled) { background: var(--primary-dark); }

        /* Download button loading state */
        .btn-download { position: relative; min-width: 72px; transition: all 0.2s; }
        .btn-download:disabled { opacity: 0.85; cursor: wait; }
        .btn-download .btn-download-spinner {
            display: inline-block; width: 14px; height: 14px;
            border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
            border-radius: 50%; animation: dlSpin 0.7s linear infinite;
        }
        @keyframes dlSpin { to { transform: rotate(360deg); } }

        .btn-sm-outline {
            background: var(--bg-white);
            color: var(--text);
            border: 1px solid var(--border);
        }

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

        /* Danger outline button (for delete actions) */
        .btn-danger-outline {
            color: #dc2626 !important;
            border-color: #fecaca !important;
        }
        .btn-danger-outline:hover {
            background: #fef2f2 !important;
            border-color: #dc2626 !important;
            color: #dc2626 !important;
        }

        /* Application list toolbar */
        .app-list-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background: var(--bg-white);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            margin-bottom: 12px;
            gap: 12px;
            flex-wrap: wrap;
        }
        .toolbar-left {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .toolbar-right {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .toolbar-checkbox-label {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            color: var(--text);
            user-select: none;
        }
        .toolbar-checkbox-label input[type="checkbox"] {
            width: 18px;
            height: 18px;
            accent-color: var(--primary);
            cursor: pointer;
        }
        .toolbar-count {
            font-size: 13px;
            color: var(--text-lighter);
            font-weight: 500;
        }

        /* Checkbox in application cards */
        .app-card-checkbox {
            width: 18px;
            height: 18px;
            accent-color: var(--primary);
            cursor: pointer;
            flex-shrink: 0;
        }
        .app-history-card.selected {
            border-color: var(--primary) !important;
            background: var(--primary-lighter) !important;
        }

        /* Match Score */
        .match-score {
            background: var(--bg-white);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 16px 18px;
            margin-bottom: 16px;
        }

        .match-score-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 10px;
        }

        .match-score-title {
            font-weight: 700;
            font-size: 14px;
        }

        .match-score-value {
            font-size: 26px;
            font-weight: 800;
            color: var(--secondary);
        }

        .match-score-bar {
            height: 6px;
            background: var(--border-light);
            border-radius: 3px;
            overflow: hidden;
            margin-bottom: 10px;
        }

        .match-score-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--secondary), #34D399);
            border-radius: 3px;
        }

        .match-tips {
            list-style: none;
            display: flex;
            flex-wrap: wrap;
            gap: 4px 12px;
        }

        .match-tip {
            display: flex;
            align-items: flex-start;
            gap: 6px;
            padding: 3px 0;
            font-size: 13px;
            color: var(--text-light);
        }

        .match-tip-icon { font-size: 14px; margin-top: 1px; }

        /* Chat Panel for refinement */
        .chat-panel {
            background: var(--bg-white);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg, 16px);
            overflow: hidden;
            margin-top: 24px;
            margin-bottom: 24px;
        }
        .chat-panel-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .chat-panel-title {
            font-size: 16px;
            font-weight: 700;
            color: var(--text);
        }
        .chat-tabs { display: flex; gap: 8px; }
        .chat-tab {
            padding: 6px 16px;
            border-radius: var(--radius-full, 20px);
            border: 1px solid var(--border);
            background: var(--bg-white);
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-light);
            transition: all 0.2s;
        }
        .chat-tab.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        .chat-tab:hover:not(.active) {
            border-color: var(--primary);
            color: var(--primary);
        }
        .chat-messages {
            max-height: 600px;
            min-height: 200px;
            overflow-y: auto;
            padding: 16px 20px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .chat-welcome {
            text-align: center;
            color: var(--text-light);
            font-size: 14px;
            padding: 24px 16px;
            line-height: 1.6;
        }
        .chat-message {
            padding: 10px 14px;
            border-radius: 12px;
            font-size: 14px;
            line-height: 1.5;
            max-width: 85%;
            word-wrap: break-word;
        }
        .chat-message-user {
            background: linear-gradient(135deg, var(--primary), var(--primary-dark, #0f766e));
            color: white;
            align-self: flex-end;
            border-bottom-right-radius: 4px;
        }
        .chat-message-assistant {
            background: var(--bg-light, #f1f5f9);
            color: var(--text);
            align-self: flex-start;
            border-bottom-left-radius: 4px;
        }
        .chat-message-error {
            background: #fef2f2;
            color: #dc2626;
            align-self: flex-start;
            border-bottom-left-radius: 4px;
        }

        /* Error Toast Notification */
        .error-toast-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.4);
            z-index: 10000;
            display: flex;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.2s ease;
            padding: 20px;
        }
        .error-toast {
            background: var(--bg-white);
            border-radius: 20px;
            padding: 32px;
            max-width: 440px;
            width: 100%;
            text-align: center;
            box-shadow: 0 25px 50px rgba(0,0,0,0.2);
            animation: slideUp 0.3s ease;
        }
        .error-toast-icon {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background: #fef2f2;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 16px;
            font-size: 28px;
        }
        .error-toast-title {
            font-size: 18px;
            font-weight: 700;
            color: var(--text);
            margin-bottom: 8px;
        }
        .error-toast-message {
            font-size: 14px;
            color: var(--text-light);
            line-height: 1.6;
            margin-bottom: 20px;
        }
        .error-toast-support {
            background: var(--bg);
            border-radius: 12px;
            padding: 14px 16px;
            font-size: 13px;
            color: var(--text-light);
            margin-bottom: 20px;
            line-height: 1.5;
        }
        .error-toast-support a {
            color: var(--primary);
            text-decoration: none;
            font-weight: 600;
            cursor: pointer;
        }
        .error-toast-support a:hover {
            text-decoration: underline;
        }
        .error-toast-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 10px 24px;
            border-radius: 10px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            transition: all 0.15s ease;
        }
        .error-toast-btn-primary {
            background: var(--primary);
            color: white;
        }
        .error-toast-btn-primary:hover {
            background: var(--primary-dark);
        }
        @keyframes slideUp {
            from { transform: translateY(20px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        .chat-input-area {
            display: flex;
            gap: 8px;
            padding: 12px 20px;
            border-top: 1px solid var(--border);
            background: var(--bg-light, #f8fafc);
        }
        .chat-input-area input {
            flex: 1;
            padding: 10px 16px;
            border: 1px solid var(--border);
            border-radius: var(--radius-full, 20px);
            font-size: 14px;
            outline: none;
            transition: border-color 0.2s;
        }
        .chat-input-area input:focus {
            border-color: var(--primary);
        }
        .chat-input-area button {
            padding: 10px 20px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: var(--radius-full, 20px);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .chat-input-area button:hover:not(:disabled) {
            background: var(--primary-dark, #0f766e);
        }
        .chat-input-area button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .chat-loading {
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--text-light);
            font-size: 13px;
            padding: 8px 14px;
            align-self: flex-start;
        }
        .chat-loading-dots {
            display: flex;
            gap: 4px;
        }
        .chat-loading-dots span {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--primary);
            animation: chatDotPulse 1.4s infinite ease-in-out;
        }
        .chat-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
        .chat-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
        @keyframes chatDotPulse {
            0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
            40% { transform: scale(1); opacity: 1; }
        }

        /* Actions bar at bottom */
        .results-actions {
            display: flex;
            justify-content: center;
            gap: 16px;
        }

        .btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 14px 28px;
            border-radius: var(--radius-full);
            font-size: 15px;
            font-weight: 600;
            text-decoration: none;
            cursor: pointer;
            border: none;
            transition: all 0.2s;
        }

        .btn-primary { background: var(--primary); color: white; }
        .btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }

        .btn-secondary {
            background: var(--bg-white);
            color: var(--text);
            border: 2px solid var(--border);
        }
        .btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

        /* ========== DESIGN TYPE SELECTION ========== */
        .design-type-options {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
            margin-bottom: 8px;
        }

        .design-type-card {
            border: 2px solid var(--border);
            border-radius: var(--radius);
            padding: 20px;
            cursor: pointer;
            transition: all 0.2s;
            background: var(--bg-white);
            text-align: center;
        }

        .design-type-card:hover {
            border-color: var(--primary-light);
            background: var(--primary-lighter);
        }

        .design-type-card.selected {
            border-color: var(--primary);
            background: var(--primary-lighter);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .design-type-preview {
            display: flex;
            gap: 2px;
            height: 48px;
            border-radius: 6px;
            overflow: hidden;
            margin-bottom: 12px;
            border: 1px solid var(--border-light);
        }

        .design-type-preview-sidebar {
            width: 30%;
            border-radius: 4px 0 0 4px;
        }

        .design-type-preview-main {
            flex: 1;
            background: var(--bg-white);
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 4px 6px;
            gap: 3px;
        }

        .design-type-preview-line {
            height: 3px;
            border-radius: 2px;
            background: #E5E7EB;
        }

        .design-type-preview-line:first-child {
            width: 60%;
        }

        .design-type-preview-line:nth-child(2) {
            width: 80%;
        }

        .design-type-preview-line:nth-child(3) {
            width: 45%;
        }

        .design-type-name {
            font-weight: 600;
            font-size: 14px;
            margin-bottom: 4px;
        }

        .design-type-desc {
            font-size: 12px;
            color: var(--text-light);
        }

        /* ========== COLOR OPTIONS ========== */
        .color-options-grid {
            display: flex;
            gap: 16px;
            flex-wrap: wrap;
        }

        .color-option-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            transition: all 0.2s;
            padding: 8px;
            border-radius: var(--radius);
            border: 2px solid transparent;
            min-width: 80px;
        }

        .color-option-item:hover {
            background: var(--bg);
        }

        .color-option-item.selected {
            border-color: var(--primary);
            background: var(--primary-lighter);
        }

        .color-option-swatch {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            position: relative;
            overflow: hidden;
            border: 2px solid rgba(0,0,0,0.08);
            transition: transform 0.2s;
        }

        .color-option-item:hover .color-option-swatch {
            transform: scale(1.1);
        }

        .color-option-swatch-half-left {
            position: absolute;
            left: 0;
            top: 0;
            width: 50%;
            height: 100%;
        }

        .color-option-swatch-half-right {
            position: absolute;
            right: 0;
            top: 0;
            width: 50%;
            height: 100%;
        }

        .color-option-label {
            font-size: 12px;
            font-weight: 500;
            color: var(--text-light);
        }

        .color-option-item.selected .color-option-label {
            color: var(--primary);
            font-weight: 600;
        }

        /* -- Compact color picker for results page (Step 4) -- */
        .color-picker-inline {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 12px 16px;
            background: var(--card-bg);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            margin-bottom: 16px;
        }
        .color-picker-inline-label {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-light);
            white-space: nowrap;
        }
        .color-picker-inline-options {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }
        .color-dot {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            cursor: pointer;
            border: 2px solid rgba(0,0,0,0.08);
            transition: all 0.2s;
            position: relative;
        }
        .color-dot:hover {
            transform: scale(1.15);
            border-color: rgba(0,0,0,0.2);
        }
        .color-dot.selected {
            border-color: var(--primary);
            box-shadow: 0 0 0 2px var(--primary-lighter);
        }
        .color-dot.selected::after {
            content: '\2713';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: #fff;
            font-size: 13px;
            font-weight: 700;
            text-shadow: 0 1px 2px rgba(0,0,0,0.4);
        }
        .color-picker-inline-name {
            font-size: 12px;
            color: var(--text-light);
            min-width: 65px;
        }

        @media (max-width: 768px) {
            .design-type-options { grid-template-columns: 1fr; }
        }

        /* ========== STEP NAVIGATION ========== */
        .step-nav {
            display: flex;
            justify-content: space-between;
            margin-top: 40px;
            padding-top: 24px;
            border-top: 1px solid var(--border);
        }

        .step-nav .btn { min-width: 160px; justify-content: center; }

        /* ========== MOBILE ========== */
        .mobile-header {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 64px;
            background: var(--bg-white);
            border-bottom: 1px solid var(--border);
            z-index: 60;
            align-items: center;
            padding: 0 16px;
            justify-content: space-between;
        }

        .mobile-menu-btn {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            padding: 8px;
        }

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

        @media (max-width: 768px) {
            .mobile-header { display: flex; }
            .sidebar { transform: translateX(-100%); z-index: 50; }
            .sidebar.open { transform: translateX(0); }
            .sidebar-overlay.open { display: block; }
            .main { margin-left: 0; padding: 80px 16px 32px; }
            .results-grid { grid-template-columns: 1fr; }
            .pref-options { grid-template-columns: 1fr 1fr; }
            .pref-grid { grid-template-columns: 1fr; }
            .detail-level-control { flex-direction: column; }
            .detail-btn { flex-direction: row; gap: 10px; padding: 10px 14px; }
            .detail-desc { text-align: left; }
            .progress-step-label { display: none; }
            .progress-bar { gap: 0; }
        }
