/* ============================================================
   CV BUILDER — PAGE-LEVEL OVERRIDES
   (These override the global style.css rules only on this page)
   ============================================================ */

/* On the builder page the html/body must not scroll — each panel
   scrolls independently. Overrides the global overflow-y:scroll. */
/* REMOVED overflow: hidden and height: 100% on html/body to allow page scrolling to footer */

body:has(.cv-builder) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================
   CV BUILDER — LAYOUT
   ============================================================ */
.cv-builder {
    display: flex;
    height: calc(100vh - 101px);
    overflow: hidden;
}

/* ---- Left: Preview Panel ---- */
.cv-preview-panel {
    flex: 0 0 56%;
    display: flex;
    flex-direction: column;
    background: #d9dde0;
    overflow: hidden;
    padding: 14px;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    /* critical: prevents unbounded growth so scroll child gets a fixed height */
}

.cv-template-switcher {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border-radius: 10px;
    padding: 10px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
}

/* CL template switcher — sits between CV and CL pages in the scroll area */
.cl-template-switcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 8px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    margin-bottom: 8px;
    /* Width matches the A4 page so it aligns with the CV/CL content */
    width: 100%;
    box-sizing: border-box;
}

.btn-arrow {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid #ccc;
    background: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #444;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.btn-arrow:hover {
    background: #333;
    color: white;
    border-color: #333;
}

.template-info {
    text-align: center;
}

.template-name {
    display: block;
    font-weight: 700;
    font-size: 0.88rem;
    color: #333;
    margin-bottom: 6px;
}

.template-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
}

.template-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    transition: background 0.25s, transform 0.25s;
}

.template-dot.active {
    background: #333;
    transform: scale(1.3);
}

.cv-preview-scroll {
    flex: 1;
    overflow-x: hidden;
    overflow-y: scroll;
    /* always visible — gutter always reserved */
    border-radius: 8px;
    padding: 8px 0 4px 0;
    min-height: 0;
    display: block;
    /* no flex center here to avoid scroll truncation */
}

#cv-scale-container {
    margin: 0 auto;
    /* safe centering without scroll truncation */
}

#cv-preview-wrapper {
    width: 794px;
    transform-origin: top left;
}

/* ---- Preview Bottom Bar (Zoom + Download) ---- */
.preview-bottom-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 6px 0 4px;
    position: relative;
}

/* ---- Zoom Pill ---- */
.zoom-pill {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 999px;
    padding: 5px 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    user-select: none;
}

/* ---- Download Button ---- */
.download-wrap {
    position: relative;
}

.btn-download {
    display: flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #1a73e8 0%, #0d5bba 100%);
    color: white;
    border: none;
    border-radius: 999px;
    padding: 7px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(26, 115, 232, 0.38);
    transition: transform 0.15s, box-shadow 0.15s;
    user-select: none;
}

.btn-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 115, 232, 0.48);
}

.btn-download:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.btn-download .chevron {
    transition: transform 0.22s ease;
}

.btn-download.open .chevron {
    transform: rotate(180deg);
}

/* ---- Download Dropdown Menu ---- */
.download-menu {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(0, 0, 0, 0.09);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 8px;
    min-width: 240px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 200;
}

.download-menu.open {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

.download-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: none;
    border: none;
    border-radius: 9px;
    padding: 10px 12px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    color: #1a1a1a;
}

.download-item:hover {
    background: #f0f4ff;
}

.dl-icon {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Pro', sans-serif;
    font-size: 1.2rem;
    width: 28px;
    text-align: center;
    opacity: 0.75;
}

.dl-label {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.dl-label strong {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1a1a1a;
}

.dl-label small {
    font-size: 0.73rem;
    color: #777;
}

.dl-divider {
    height: 1px;
    background: #eee;
    margin: 6px 0;
}

.download-item-both {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
}

.download-item-both:hover {
    background: linear-gradient(135deg, #e3eaff 0%, #d6e4ff 100%);
}

/* Loading state */
.btn-download.loading {
    opacity: 0.75;
    pointer-events: none;
}

.btn-download.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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


.zoom-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #444;
    transition: background 0.15s, color 0.15s, opacity 0.2s;
    padding: 0;
}

.zoom-btn:hover:not(:disabled) {
    background: #eee;
    color: #111;
}

.zoom-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.zoom-pct {
    font-size: 0.78rem;
    font-weight: 600;
    color: #555;
    min-width: 38px;
    text-align: center;
    letter-spacing: 0.03em;
}

/* ---- Right: Input wrapper (tab bar + panels) ---- */
.cv-input-right {
    flex: 0 0 44%;
    display: flex;
    flex-direction: column;
    border-left: 2px solid #dee2e6;
    background: #d9dde0;
    overflow-x: hidden;
    overflow-y: hidden;
    padding: 14px;
    gap: 12px;
    box-sizing: border-box;
}

.cv-input-panel-wrapper {
    flex: 1;
    overflow-y: scroll;
    overflow-x: hidden;
    min-height: 0;
}

/* Custom slim scrollbar for the right panel */
.cv-input-panel-wrapper::-webkit-scrollbar {
    width: 6px;
}

.cv-input-panel-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.cv-input-panel-wrapper::-webkit-scrollbar-thumb {
    background: #aab0b5;
    border-radius: 4px;
}

.cv-input-panel-wrapper::-webkit-scrollbar-thumb:hover {
    background: #8a9095;
}

/* ---- Right: scrollable form panels ---- */
.cv-input-panel {
    background: white;
    border-radius: 8px;
    height: auto;
    margin-right: 42px;
    /* Gap between white box and scrollbar (3x = 42px) */
}

/* ---- Tab bar (Modern Segmented Control) ---- */
.input-panel-header {
    flex-shrink: 0;
    background: white;
    border-radius: 10px;
    padding: 10px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    margin-right: 42px;
    /* Same gap as input panel (3x = 42px) */
}

.panel-tabs {
    display: flex;
    background: #e1e4e8;
    border-radius: 12px;
    padding: 6px;
    gap: 6px;
    margin-bottom: 0px;
}

.panel-tab {
    flex: 1;
    padding: 10px 10px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #6c757d;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.25s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
}

.panel-tab:hover {
    color: #495057;
    background: rgba(255, 255, 255, 0.4);
}

.panel-tab.active {
    color: #212529;
    background: #ffffff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.inp-section {
    padding: 14px 18px;
    border-bottom: 1px solid #e2e6ea;
}

.inp-section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 10px;
}

.inp-section-title .btn-add {
    margin-left: auto;
}

.inp-photo-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.inp-photo-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.inp-photo-box img {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #dee2e6;
}

.btn-photo {
    font-size: 0.7rem;
    padding: 4px 10px;
    background: #f1f3f5;
    border: 1px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
    color: #555;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.btn-photo:hover {
    background: #333;
    color: white;
    border-color: #333;
}

#inp-photo {
    display: none;
}

.inp-photo-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.cv-inp {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.84rem;
    font-family: inherit;
    background: white;
    color: #333;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: block;
    margin-bottom: 7px;
}

.cv-inp:last-child {
    margin-bottom: 0;
}

.cv-inp:focus {
    outline: none;
    border-color: #6c757d;
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.15);
}

textarea.cv-inp {
    resize: vertical;
    line-height: 1.5;
}

.inp-hint {
    margin: 3px 0 0;
    font-size: 0.72rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-add {
    font-size: 0.72rem;
    padding: 4px 10px;
    background: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
    color: #444;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-add:hover {
    background: #495057;
    color: white;
    border-color: #495057;
}

/* Social Media Rows */
.social-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
}

.social-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hide native checkbox, use the icon label as the toggle */
.social-cb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    background: white;
    position: relative;
    transition: background 0.2s, border-color 0.2s;
}

.social-cb:checked {
    background: #2d3436;
    border-color: #2d3436;
}

.social-cb:checked::after {
    content: '';
    display: block;
    width: 4px;
    height: 8px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    position: absolute;
    top: 1px;
    left: 4px;
}

.social-icon-label {
    width: 22px;
    text-align: center;
    font-size: 1rem;
    color: #aaa;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s;
    line-height: 1;
}

/* Colour icon when checked */
.social-cb:checked+.social-icon-label {
    color: #2d3436;
}

.social-inp {
    flex: 1;
    margin-bottom: 0 !important;
}

/* Dim the input when the social is unchecked */
.social-row:has(.social-cb:not(:checked)) .social-inp {
    opacity: 0.45;
    pointer-events: none;
}

/* Entry Cards (experience, education, language) */
.entry-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.entry-card:last-child {
    margin-bottom: 0;
}

.entry-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.entry-card-head span {
    font-size: 0.75rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.btn-remove {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: none;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    color: #aaa;
    transition: background 0.2s, color 0.2s;
}

.btn-remove:hover {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

/* ============================================================
   TEMPLATE 1 — KLASSISCH WARM (Olivia Thompson style)
   ============================================================ */
.cv-t1 {
    display: flex;
    width: 794px;
    min-height: 1123px;
    font-family: Georgia, 'Times New Roman', serif;
    background: white;
}

.cv-t1-sidebar {
    width: 30%;
    background: #dbbfa3;
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.cv-t1-photo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 18px;
}

.cv-t1-section {
    width: 100%;
    margin-bottom: 18px;
}

.cv-t1-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #3d2010;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.cv-t1-rule {
    width: 100%;
    height: 1.5px;
    background: #3d2010;
    margin-bottom: 8px;
    opacity: 0.4;
}

.cv-t1-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 0.74rem;
    color: #3d2010;
    margin-bottom: 5px;
    overflow-wrap: break-word;
    word-break: normal;
}

.cv-t1-contact-item i {
    width: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

.cv-t1-edu-item {
    margin-bottom: 12px;
}

.cv-t1-edu-item strong {
    font-size: 0.77rem;
    color: #3d2010;
    display: block;
}

.cv-t1-edu-item span {
    font-size: 0.72rem;
    color: #3d2010;
    display: block;
}

.cv-t1-edu-item em {
    font-size: 0.7rem;
    color: #5a3a20;
}

.cv-t1-skill-item {
    font-size: 0.74rem;
    color: #3d2010;
    margin-bottom: 4px;
}

.cv-t1-lang-item {
    font-size: 0.74rem;
    color: #3d2010;
    margin-bottom: 4px;
}

.cv-t1-lang-item em {
    color: #5a3a20;
}

.cv-t1-main {
    flex: 1;
    padding: 28px 24px;
    box-sizing: border-box;
}

.cv-t1-name {
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #1a0a00;
    margin: 0 0 4px;
    line-height: 1.15;
}

.cv-t1-profession {
    font-style: italic;
    color: #825a40;
    font-size: 1rem;
    margin-bottom: 10px;
}

.cv-t1-header-rule {
    width: 100%;
    height: 1.5px;
    background: #825a40;
    margin-bottom: 18px;
    opacity: 0.3;
}

.cv-t1-body-section {
    margin-bottom: 20px;
}

.cv-t1-body-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #1a0a00;
    margin: 0 0 3px;
    text-transform: uppercase;
}

.cv-t1-body-rule {
    width: 100%;
    height: 1.5px;
    background: #1a0a00;
    margin-bottom: 10px;
    opacity: 0.2;
}

.cv-t1-body-section p {
    font-size: 0.82rem;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

.cv-t1-exp-item {
    margin-bottom: 14px;
}

.cv-t1-exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.cv-t1-exp-header strong {
    color: #1a0a00;
}

.cv-t1-exp-header em {
    color: #555;
}

.cv-t1-exp-date {
    font-size: 0.75rem;
    color: #777;
}

.cv-t1-exp-item ul {
    margin: 4px 0 0 18px;
    padding: 0;
}

.cv-t1-exp-item ul li {
    font-size: 0.78rem;
    color: #333;
    line-height: 1.55;
    margin-bottom: 2px;
}

/* ============================================================
   TEMPLATE 2 — MODERN DUNKEL (Kennedy style)
   ============================================================ */
.cv-t2 {
    width: 794px;
    min-height: 1123px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: white;
}

.cv-t2-header {
    background: #3d3d3d;
    color: white;
    padding: 28px 30px;
    display: flex;
    align-items: center;
    gap: 26px;
}

.cv-t2-header-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #888;
    flex-shrink: 0;
    filter: grayscale(30%);
}

.cv-t2-header-info {
    flex: 1;
}

.cv-t2-first-name {
    display: block;
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    line-height: 1.1;
    color: white;
}

.cv-t2-last-name {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    line-height: 1.1;
    color: white;
}

.cv-t2-profession {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #ccc;
    margin-top: 6px;
}

.cv-t2-body {
    display: flex;
}

.cv-t2-sidebar {
    width: 32%;
    padding: 24px 18px;
    box-sizing: border-box;
    border-right: 1px solid #e0e0e0;
}

.cv-t2-section {
    margin-bottom: 20px;
}

.cv-t2-section-title {
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #333;
    margin: 0 0 5px;
}

.cv-t2-rule {
    width: 100%;
    height: 1.5px;
    background: #333;
    margin-bottom: 10px;
}

.cv-t2-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.73rem;
    color: #444;
    margin-bottom: 7px;
    overflow-wrap: break-word;
    word-break: normal;
    letter-spacing: 0.01em;
}

.cv-t2-contact-item i {
    width: 13px;
    flex-shrink: 0;
    margin-top: 1px;
    color: #666;
}

.cv-t2-edu-item {
    margin-bottom: 12px;
}

.cv-t2-edu-item .t2-degree {
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #222;
    display: block;
}

.cv-t2-edu-item .t2-inst {
    font-size: 0.72rem;
    color: #555;
    display: block;
}

.cv-t2-edu-item .t2-years {
    font-size: 0.7rem;
    color: #777;
    display: block;
    margin-top: 1px;
}

.cv-t2-skill-item {
    font-size: 0.73rem;
    color: #444;
    margin-bottom: 5px;
    letter-spacing: 0.03em;
}

.cv-t2-lang-item {
    font-size: 0.73rem;
    color: #444;
    margin-bottom: 4px;
}

.cv-t2-lang-item em {
    color: #777;
}

.cv-t2-main {
    flex: 1;
    padding: 24px 22px;
    box-sizing: border-box;
}

.cv-t2-body-section {
    margin-bottom: 20px;
}

.cv-t2-body-title {
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #333;
    margin: 0 0 5px;
}

.cv-t2-body-rule {
    width: 100%;
    height: 1.5px;
    background: #333;
    margin-bottom: 10px;
}

.cv-t2-body-section p {
    font-size: 0.8rem;
    line-height: 1.65;
    color: #333;
    margin: 0;
}

.cv-t2-exp-item {
    margin-bottom: 16px;
}

.cv-t2-exp-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #222;
    display: block;
    margin-bottom: 1px;
}

.cv-t2-exp-sub {
    font-size: 0.73rem;
    color: #777;
    display: block;
    margin-bottom: 7px;
}

.cv-t2-exp-item p {
    font-size: 0.78rem;
    color: #333;
    line-height: 1.6;
    margin: 0 0 4px;
}

.cv-t2-exp-item ul {
    margin: 4px 0 0 18px;
    padding: 0;
}

.cv-t2-exp-item ul li {
    font-size: 0.76rem;
    color: #333;
    line-height: 1.55;
    margin-bottom: 2px;
}

/* ============================================================
   COVER LETTER — A4 CARD (below CV in preview scroll)
   ============================================================ */
#cl-preview-content {
    margin-top: 24px;
}

.cl-page {
    width: 794px;
    min-height: 1123px;
    background: white;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.87rem;
    color: #222;
    padding: 60px 64px;
    box-sizing: border-box;
    line-height: 1.65;
}

/* Sender strip (top right) */
.cl-sender-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 32px;
}

.cl-sender-name {
    font-weight: 700;
    font-size: 1rem;
    color: #111;
}

.cl-sender-detail {
    font-size: 0.78rem;
    color: #555;
}

/* Recipient */
.cl-recipient {
    font-size: 0.85rem;
    line-height: 1.55;
    margin-bottom: 28px;
    color: #333;
}

/* Date */
.cl-date {
    text-align: right;
    font-size: 0.82rem;
    color: #555;
    margin-bottom: 24px;
}

/* Subject */
.cl-subject {
    font-weight: 700;
    font-size: 0.95rem;
    color: #111;
    margin-bottom: 22px;
    border-bottom: 1.5px solid #ccc;
    padding-bottom: 8px;
}

/* Body */
.cl-body p {
    margin: 0 0 14px;
    font-size: 0.87rem;
}

.cl-opening {
    margin-bottom: 16px !important;
}

.cl-closing-line {
    margin-top: 28px !important;
    margin-bottom: 4px !important;
}

.cl-sig {
    font-weight: 700;
    margin-bottom: 0 !important;
}

/* Fix html2canvas shifting */
.html2canvas-container {
    width: 794px !important;
    height: 1122px !important;
}

/* ============================================================
   MOBILE FULL-SCREEN TOGGLE (10x UX)
   ============================================================ */

/* The floating action button (hidden on desktop) */
.mobile-fab-toggle {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    background: #111827;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, background 0.2s;
}

.mobile-fab-toggle:active {
    transform: translateX(-50%) scale(0.95);
}

@media (max-width: 900px) {
    .cv-builder {
        flex-direction: column;
        height: calc(100vh - 70px);
        /* Adjust for mobile header height */
    }

    /* By default on mobile: Show form, hide preview */
    .cv-preview-panel {
        display: none;
        flex: 1 1 100%;
        width: 100%;
    }

    .cv-input-right {
        display: flex;
        flex: 1 1 100%;
        width: 100%;
        border-left: none;
        margin: 0;
        padding-bottom: 80px;
        /* Space for the FAB */
    }

    .cv-input-panel {
        margin-right: 0;
        /* Remove desktop scrollbar paddings */
    }

    .input-panel-header {
        margin-right: 0;
    }

    /* Show FAB on mobile */
    .mobile-fab-toggle {
        display: flex;
    }

    /* When body has .show-preview: Hide form, show preview */
    body.show-preview .cv-input-right {
        display: none;
    }

    body.show-preview .cv-preview-panel {
        display: flex;
        padding-bottom: 80px;
        /* Space for FAB */
    }
}