/* Styles for PDF print area, exactly as in the example */
        #cv-preview-wrapper {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            width: 100%;
            max-width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0;
            padding: 20px 20px 60px 20px; /* Extra bottom padding to prevent content cutoff */
        }
        #cv-preview {
            width: 210mm;
            max-width: 210mm;
            min-height: auto; /* Auto height based on content */
            height: auto; /* Allow content to expand */
            box-shadow: 0 4px 6px rgba(0,0,0,0.3);
            font-size: 10pt;
            color: #333;
            background: white;
            margin: 0 auto;
            margin-bottom: 2rem;
            box-sizing: border-box;
            transform: scale(1.1); /* Increase by 10% for better visibility */
            transform-origin: top center;
            padding: var(--pdf-margin-vertical, 10mm) var(--pdf-margin-horizontal, 10mm); /* Use PDF margins as visual padding */
            overflow: visible; /* Allow all content to be visible */
            margin-bottom: 5rem;
            min-height: auto; /* Always show full A4 height for visual consistency */
        }

        /* Markdown formatting in CV preview */
        #cv-preview strong {
            font-weight: 900;
            color: #1f2937;
        }

        #cv-preview em {
            font-style: italic;
        }

        /* Inner container with padding */
        #cv-preview > div {
            padding: 0; /* Remove inner padding - using PDF margins instead */
            box-sizing: border-box; /* Include padding in height calculation */
            min-height: calc(297mm - var(--pdf-margin-vertical, 10mm) * 2); /* Account for padding in min-height */
        }

        /* Multi-page styles - only header should not break */
        #cv-preview header {
            page-break-inside: avoid !important;
            break-inside: avoid !important;
        }

        /* Each experience item should not break */
        #cv-preview .mb-3,
        #cv-preview .mb-4 {
            page-break-inside: avoid !important;
            break-inside: avoid !important;
        }

        /* Ensure links inside the preview use the same color as surrounding text */
        #cv-preview a,
        #cv-preview a:visited {
            color: inherit;
            text-decoration: underline;
            text-decoration-color: currentColor;
        }
        #cv-preview a:hover {
            color: inherit;
            text-decoration-color: currentColor;
            opacity: 0.95;
        }
        /* Tighter spacing for preview content: reduce line-height and paddings inside contact rows and lists */
        #cv-preview {
            line-height: 1.17;
        }
        /* Contact rows: reduce vertical padding */
        #cv-preview .flex.items-center.gap-2 {
            padding-top: 0.12rem;
            padding-bottom: 0.12rem;
        }
        /* Skill and other lists: use native browser bullets for better PDF export */
        #cv-preview ul.list-disc {
            margin-top: 0.1rem;
            margin-bottom: 0.1rem;
            padding-left: 1.2rem;
            list-style-type: disc;
            list-style-position: outside;
        }

        #cv-preview ul.list-disc li {
            margin-bottom: 0.12rem;
            padding-left: 0.2rem;
        }
