.cv-wrap { max-width: 100%; margin: 0 auto; }

/* Scrollable form fields area - keeps Generate CV button always
   visible below it, regardless of how long the form is */
.cv-scroll-area {
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 6px;
    margin-bottom: 16px;
}
.cv-scroll-area::-webkit-scrollbar { width: 8px; }
.cv-scroll-area::-webkit-scrollbar-track { background: #f3f4f6; border-radius: 4px; }
.cv-scroll-area::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
.cv-scroll-area::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

.cv-generate-card {
    position: sticky;
    bottom: 0;
    z-index: 5;
}

@media (max-width: 700px) {
    .cv-scroll-area { max-height: 55vh; }
}

/* Photo preview - circular, matching typical CV profile photo style */
.cv-photo-preview-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
    padding: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}
.cv-photo-preview-wrap img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
}

/* Profile Photo section - full width, dropzone style matching Convert to PDF */
.cv-photo-section {
    margin-top: 16px;
}
.cv-photo-supported {
    font-size: 12px;
    color: #6b7280;
    margin: 4px 0 10px;
}
.cv-photo-dropzone {
    width: 100%;
    box-sizing: border-box;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    color: #6b7280;
    transition: border-color 0.15s, background 0.15s;
}
.cv-photo-dropzone:hover,
.cv-photo-dropzone.drag-over {
    border-color: #10b981;
    background: #f0fdf9;
    color: #10b981;
}
.cv-photo-dropzone-text {
    margin-top: 8px;
    font-size: 13.5px;
    font-weight: 500;
}

/* Crop Photo trigger button - centered, auto-width, with icon */
.cv-crop-trigger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    margin: 10px auto 0;
    font-size: 13px;
    padding: 10px 20px;
}
.cv-crop-trigger-btn svg { flex-shrink: 0; }
.cv-crop-trigger-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #fff;
    color: #9ca3af;
    border-color: #d1d5db;
}

/* Dynamic Experience / Education rows */
.cv-entry-row {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
    background: #f9fafb;
}
.cv-entry-row .inv-row:last-child { margin-bottom: 0; }
.cv-entry-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
}
.cv-entry-remove:hover { color: #b91c1c; }

.cv-entry-row textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    resize: vertical;
}
.cv-entry-row textarea:focus { outline: none; border-color: #10b981; }

.cv-current-role-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4b5563;
    margin-top: 4px;
    cursor: pointer;
}

/* =============================================
   SELF-CONTAINED SHARED STYLES — copied here so
   CV Generator no longer depends on pdf.css or
   invoice-generator.css for these classes.
   ============================================= */

.inv-card {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 18px 24px;
    margin-bottom: 14px;
}
.inv-card h2 {
    font-size: 16px;
    margin-bottom: 14px;
    color: #1e2a4a;
    border-bottom: 2px solid #10b981;
    padding-bottom: 8px;
}
.inv-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.inv-col { flex: 1; min-width: 220px; }
.inv-col label { display: block; font-size: 13px; margin-bottom: 4px; color: #4b5563; }
.inv-col input, .inv-col textarea, .inv-col select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
.inv-col input:focus, .inv-col textarea:focus { outline: none; border-color: #10b981; }
.inv-col input[readonly] { background: #f3f4f6; color: #6b7280; cursor: default; }
.inv-add-row {
    margin-top: 10px;
    background: #fff;
    border: 1px dashed #10b981;
    color: #10b981;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.inv-hint {
    display: block;
    font-size: 11.5px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
}
.inv-error {
    border-color: #dc2626 !important;
    background: #fff5f5 !important;
}
.inv-error-text {
    display: block;
    width: 100%;
    color: #dc2626;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
    line-height: 1.4;
}

.inv-actionbar {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
}
.inv-btn {
    background: #10b981;
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}
.inv-btn:hover { background: #0da271; }
.inv-disclaimer {
    font-size: 12px;
    color: #6b7280;
    margin-top: 16px;
    line-height: 1.5;
}
/* =============================================
   POST-GENERATE ACTIONS (Preview / Download / Edit)
   ============================================= */
.inv-post-actions {
    display: none;
}
.inv-post-actions.show { display: contents; }
.inv-btn-outline {
    background: #fff;
    color: #10b981;
    border: 1px solid #10b981;
}
.inv-btn-outline:hover { background: #f0fdf9; }
/* =============================================
   PREVIEW MODAL — large in-page popup
   ============================================= */
.inv-preview-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.inv-preview-overlay.open { display: flex; }
.inv-preview-modal {
    background: #fff;
    width: 100%;
    max-width: 950px;
    height: 92vh;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}
.inv-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #1e2a4a;
    color: #fff;
    flex-shrink: 0;
}
.inv-preview-header h3 { font-size: 15px; margin: 0; font-weight: 700; }
.inv-preview-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.inv-preview-close:hover { opacity: 0.7; }
.inv-preview-body { flex: 1; min-height: 0; }
.inv-preview-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
@media (max-width: 600px) {
    .inv-preview-overlay { padding: 0; }
    .inv-preview-modal { max-width: 100%; height: 100vh; border-radius: 0; }
}
.inv-preview-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.inv-inline-message {
    margin-top: 10px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #b91c1c;
    font-size: 13px;
}
/* =============================================
   LOGO/PHOTO REMOVE BUTTON — shared across all Pdf Tools
   Used by Invoice Generator's logo, CV Generator's profile
   photo, and any future tool with an uploaded image preview.
   ============================================= */
.inv-logo-remove {
    display: inline-block;
    align-self: center;
    flex-shrink: 0;
    width: auto;
    height: auto;
    background: none;
    border: 1px solid #dc2626;
    color: #dc2626;
    font-size: 12px;
    line-height: 1.4;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
}
.inv-logo-remove:hover { background: #fef2f2; }
/* =============================================
   LOGO/PHOTO CROP MODAL — shared across all Pdf Tools
   Used by Invoice Generator's logo crop, CV Generator's
   profile photo crop, and any future tool needing cropping.
   ============================================= */
.inv-crop-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.inv-crop-overlay.open { display: flex; }
.inv-crop-modal {
    background: #fff;
    width: 100%;
    max-width: 520px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}
.inv-crop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #1e2a4a;
    color: #fff;
    flex-shrink: 0;
}
.inv-crop-header h3 { font-size: 15px; margin: 0; font-weight: 700; }
.inv-crop-body {
    padding: 16px;
    background: #f3f4f6;
}
.inv-crop-body img {
    display: block;
    max-width: 100%;
    max-height: 60vh;
}
.inv-crop-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}
@media (max-width: 600px) {
    .inv-crop-overlay { padding: 0; }
    .inv-crop-modal { max-width: 100%; height: 100vh; border-radius: 0; }
    .inv-crop-body { flex: 1; }
}
/* =============================================
   PREVIEW MODAL — template tabs + hint
   Shared across all Pdf Tools with a template preview switcher
   (Invoice Generator, CV Generator, etc.)
   ============================================= */
.inv-preview-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    overflow-x: auto;
    white-space: nowrap;
}
.inv-preview-tab {
    flex-shrink: 0;
    padding: 7px 16px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.inv-preview-tab:hover { border-color: #10b981; color: #10b981; }
.inv-preview-tab.active {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}
.inv-preview-hint {
    padding: 8px 20px 0;
    font-size: 12.5px;
    color: #6b7280;
    background: #f8fafc;
    flex-shrink: 0;
}