/* ================================================
   Joblynk CV Builder – Jobseeker-Style Theme
   ================================================ */

/* ── Design Tokens ── */
:root {
    --bg: #F8F8FA;
    --bg-white: #FFFFFF;
    --topbar: #1B1340;
    --accent: #3B4BA6;
    --accent-light: #E8EAF6;
    --accent-dark: #2C3A8C;
    --red: #E74C54;
    --text: #222222;
    --text-secondary: #555555;
    --text-muted: #999999;
    --border: #E0E0E0;
    --border-focus: #3B4BA6;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .1);
    --shadow-paper: 0 8px 30px rgba(0, 0, 0, .15);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --radius: 6px;
}

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

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
}

/* ======================================
   TOP BAR
   ====================================== */
.topbar {
    height: 56px;
    background: var(--topbar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    position: relative;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: border-color .2s;
}

.topbar-title:focus {
    border-color: rgba(255, 255, 255, .3);
}

.topbar-cloud {
    color: rgba(255, 255, 255, .4);
    font-size: .85rem;
}

.topbar-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, .7);
    font-size: .9rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all .15s;
    font-family: var(--font);
    text-decoration: none;
}

.topbar-btn:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.topbar-btn-download {
    background: var(--red);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all .15s;
    font-family: var(--font);
}

.topbar-btn-download:hover {
    background: #d03d45;
    transform: translateY(-1px);
}

/* ======================================
   MAIN LAYOUT
   ====================================== */
.app-container {
    display: flex;
    height: calc(100vh - 56px);
}

/* ── Editor Pane ── */
.editor-pane {
    width: 50%;
    max-width: 560px;
    background: linear-gradient(180deg, #F0F0F5 0%, #F8F8FA 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 28px 24px 80px;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.editor-scroll::-webkit-scrollbar {
    width: 6px;
}

.editor-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.editor-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.editor-scroll::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ── Form Sections ── */
.form-section {
    background: var(--bg-white);
    border: 1px solid #E8E8EE;
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
    transition: box-shadow .2s;
}

.form-section:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, .07);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    cursor: pointer;
    user-select: none;
}

.section-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.01em;
}

.section-controls {
    display: flex;
    gap: 4px;
}

.section-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.section-btn:hover {
    background: #f0f0f0;
    color: var(--text);
}

.section-toggle i {
    transition: transform .2s;
}

.form-section.collapsed .section-toggle i {
    transform: rotate(180deg);
}

.section-body {
    padding: 0 20px 20px;
}

.form-section.collapsed .section-body {
    display: none;
}

.section-hint {
    font-size: .85rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

/* ── Form Rows & Inputs ── */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
}

.form-row-photo {
    align-items: flex-end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.input-group.full-width {
    flex: 1 1 100%;
}

.input-group label {
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: none;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #DCDCE5;
    border-radius: var(--radius);
    font-size: .9rem;
    font-family: var(--font);
    color: var(--text);
    background: #FAFAFD;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 75, 166, .1);
}

.input-group textarea {
    resize: vertical;
}

/* Photo Upload Box */
.photo-group {
    flex: 0 0 80px;
}

.photo-upload-box {
    width: 72px;
    height: 72px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.4rem;
    color: var(--text-muted);
    transition: all .2s;
    overflow: hidden;
    background: #fafafa;
}

.photo-upload-box:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.photo-upload-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Optional Field Chips ── */
.optional-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chip {
    background: none;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: .8rem;
    font-family: var(--font);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all .15s;
}

.chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.chip.active {
    display: none;
}

#optionalFieldsContainer {
    margin-top: 12px;
}

.optional-field-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 10px;
}

.optional-field-row .input-group {
    flex: 1;
}

.optional-field-row .btn-remove-field {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: .9rem;
    padding: 10px 4px;
    transition: color .15s;
}

.optional-field-row .btn-remove-field:hover {
    color: var(--red);
}

/* ── Dynamic List Items (Accordion) ── */
.dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.list-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    overflow: hidden;
}

.list-card-header {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #FAFAFA;
    transition: background .15s;
}

.list-card-header:hover {
    background: #f2f2f2;
}

.list-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.list-card-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
}

.list-card-subtitle {
    font-size: .8rem;
    color: var(--text-muted);
}

.list-card-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.list-card-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: .85rem;
    transition: all .15s;
}

.list-card-actions button:hover {
    color: var(--red);
    background: #fef2f2;
}

.list-card-body {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: none;
}

.list-card-body.open {
    display: block;
}

/* ── Add Button ── */
.btn-add {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font);
    transition: opacity .15s;
}

.btn-add:hover {
    opacity: .7;
}


/* ======================================
   PREVIEW PANE
   ====================================== */
.preview-pane {
    flex: 1;
    background: #E8E8EC;
    display: flex;
    flex-direction: column;
    overflow: visible;
    position: relative;
}

.preview-scroll {
    flex: 1;
    overflow: auto;
    padding: 32px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* ── A4 Paper ── */
.a4-paper {
    width: 210mm;
    min-height: 297mm;
    background: #fff;
    box-shadow: var(--shadow-paper);
    transform-origin: top center;
    transform: scale(0.62);
    transition: transform .2s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── CV Header Block (Blue/Navy) ── */
.cv-header-block {
    background: var(--accent);
    color: #fff;
    padding: 36px 40px 28px;
    position: relative;
}

.cv-header-label {
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .7;
    margin-bottom: 20px;
}

.cv-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cv-photo-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, .3);
    flex-shrink: 0;
}

.cv-photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cv-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.2;
}

.cv-jobtitle {
    font-size: 1.1rem;
    font-weight: 400;
    opacity: .85;
}

/* ── CV Content 2-Column ── */
.cv-content {
    display: flex;
    flex: 1;
    padding: 30px 40px 40px;
    gap: 30px;
}

.cv-col-left {
    width: 35%;
}

.cv-col-right {
    width: 65%;
}

.cv-sidebar-block {
    margin-bottom: 28px;
}

.cv-sidebar-heading {
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent);
}

.cv-detail-row {
    font-size: .85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.5;
}

.cv-skills-stacked {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cv-skill-entry {
    font-size: .85rem;
    color: var(--text-secondary);
}

.cv-skill-level {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 3px;
    overflow: hidden;
}

.cv-skill-level-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
}

.cv-text-sm {
    font-size: .85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.cv-main-block {
    margin-bottom: 28px;
}

.cv-main-heading {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--accent);
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent);
}

.cv-text-body {
    font-size: .9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    white-space: pre-wrap;
}

.cv-entries {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cv-entry-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text);
}

.cv-entry-subtitle {
    font-size: .85rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 2px;
}

.cv-entry-date {
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.cv-entry-desc {
    font-size: .85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ── Decorative Wave ── */
.cv-wave {
    height: 80px;
    background: var(--accent);
    clip-path: ellipse(55% 100% at 10% 100%);
    margin-top: auto;
}

/* ── Preview Toolbar ── */
.preview-toolbar {
    height: 48px;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: relative;
    overflow: visible;
    z-index: 500;
}

.toolbar-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

.toolbar-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 8px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font);
    transition: all .15s;
}

.toolbar-btn:hover {
    background: #f0f0f0;
    color: var(--text);
}

.toolbar-btn.active {
    color: var(--accent);
}

/* ── Toolbar Dropdown System ── */
.toolbar-dropdown-wrap {
    position: relative;
}

.toolbar-dropdown {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    padding: 8px 0;
    min-width: 160px;
    z-index: 400;
    margin-bottom: 8px;
}

.toolbar-dropdown.open {
    display: block;
}

.dropdown-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    padding: 6px 14px 4px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    font-size: .85rem;
    font-family: var(--font);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: background .1s;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item.active {
    color: var(--accent);
    font-weight: 600;
}

.tpl-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

/* Color grid */
.color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 8px 14px;
}

.color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all .15s;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    border-color: var(--text);
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text);
}

.color-custom-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid #f0f0f0;
    font-size: .8rem;
    color: var(--text-secondary);
}

.color-custom-row input[type="color"] {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    background: none;
}

/* ======================================
   TEMPLATE PANEL (Visual Picker)
   ====================================== */
.template-panel {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 16px 20px;
    display: none;
}

.template-panel.open {
    display: block;
}

.template-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
}

.template-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 4px;
    border-radius: 4px;
    transition: all .15s;
}

.template-panel-close:hover {
    background: #f0f0f0;
    color: var(--text);
}

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

.template-card {
    cursor: pointer;
    text-align: center;
    border-radius: 8px;
    border: 2px solid transparent;
    padding: 4px;
    transition: all .2s;
}

.template-card:hover {
    border-color: #ccc;
}

.template-card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.template-card span {
    display: block;
    font-size: .75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* -- Thumbnail Previews -- */
.tpl-preview {
    width: 100%;
    aspect-ratio: 210 / 297;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    font-size: 0;
}

.tp-header {
    height: 22%;
}

.tp-body {
    display: flex;
    flex: 1;
    padding: 6%;
    gap: 6%;
}

.tp-sidebar {
    width: 30%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tp-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tp-wave {
    height: 10%;
    clip-path: ellipse(55% 100% at 10% 100%);
    margin-top: auto;
}

.tp-line {
    height: 3px;
    background: #ddd;
    border-radius: 1px;
}

.tp-line-white {
    height: 3px;
    background: rgba(255, 255, 255, .5);
    border-radius: 1px;
}

.tp-line-dark {
    height: 4px;
    background: #333;
    border-radius: 1px;
}

.tp-line-muted {
    height: 3px;
    background: #bbb;
    border-radius: 1px;
}

.w40 {
    width: 40%;
}

.w50 {
    width: 50%;
}

.w60 {
    width: 60%;
}

.w70 {
    width: 70%;
}

.w80 {
    width: 80%;
}

.w90 {
    width: 90%;
}

.w100 {
    width: 100%;
}

.centered {
    margin: 0 auto;
}

/* Modern thumbnail */
.tp-header-full {
    height: 30%;
    display: flex;
    align-items: center;
    gap: 6%;
    padding: 0 8%;
}

.tp-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .3);
    flex-shrink: 0;
}

.tp-body-single {
    flex: 1;
    padding: 8%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Elegant thumbnail */
.tp-header-centered {
    padding: 10% 8% 4%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.tp-divider {
    height: 1px;
    background: #ddd;
    margin: 0 8%;
}

.tp-body-two {
    display: flex;
    flex: 1;
    padding: 4% 8%;
    gap: 6%;
}

.tp-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Minimal thumbnail */
.tp-header-minimal {
    padding: 8% 8% 4%;
    display: flex;
    flex-direction: column;
    gap: 3px;
}


/* ======================================
   TEMPLATE VARIANTS (Actual CV Layouts)
   ====================================== */

/* -- MODERN: Single column, full-width header with large photo -- */
.a4-paper.tpl-modern .cv-content {
    flex-direction: column;
}

.a4-paper.tpl-modern .cv-col-left {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.a4-paper.tpl-modern .cv-col-right {
    width: 100%;
}

.a4-paper.tpl-modern .cv-sidebar-block {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0;
}

.a4-paper.tpl-modern .cv-header-block {
    padding: 44px 40px 32px;
}

.a4-paper.tpl-modern .cv-photo-wrap {
    width: 90px;
    height: 90px;
}

.a4-paper.tpl-modern .cv-name {
    font-size: 2rem;
}

.a4-paper.tpl-modern .cv-wave {
    clip-path: polygon(0 40%, 100% 0, 100% 100%, 0% 100%);
}

/* -- ELEGANT: No colored header, centered text, serif accents -- */
.a4-paper.tpl-elegant .cv-header-block {
    background: transparent;
    color: var(--text);
    text-align: center;
    padding: 40px 40px 20px;
    border-bottom: 2px solid var(--accent, #7C3AED);
}

.a4-paper.tpl-elegant .cv-header-label {
    color: var(--text-muted);
}

.a4-paper.tpl-elegant .cv-name {
    color: var(--text);
    font-family: 'Playfair Display', serif;
}

.a4-paper.tpl-elegant .cv-jobtitle {
    color: var(--text-secondary);
}

.a4-paper.tpl-elegant .cv-header-content {
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.a4-paper.tpl-elegant .cv-photo-wrap {
    border-color: var(--accent, #7C3AED);
}

.a4-paper.tpl-elegant .cv-wave {
    display: none;
}

.a4-paper.tpl-elegant .cv-sidebar-heading,
.a4-paper.tpl-elegant .cv-main-heading {
    letter-spacing: .1em;
}

/* -- MINIMAL: No header block at all, name inline at top -- */
.a4-paper.tpl-minimal .cv-header-block {
    background: transparent;
    color: var(--text);
    padding: 30px 40px 16px;
}

.a4-paper.tpl-minimal .cv-header-label {
    display: none;
}

.a4-paper.tpl-minimal .cv-name {
    color: var(--text);
    font-size: 1.6rem;
    font-weight: 600;
}

.a4-paper.tpl-minimal .cv-jobtitle {
    color: var(--text-muted);
    font-weight: 400;
}

.a4-paper.tpl-minimal .cv-photo-wrap {
    display: none;
}

.a4-paper.tpl-minimal .cv-wave {
    display: none;
}

.a4-paper.tpl-minimal .cv-sidebar-heading,
.a4-paper.tpl-minimal .cv-main-heading {
    border-bottom-width: 1px;
    text-transform: none;
    letter-spacing: 0;
}

/* ── Font Size Variants ── */
.a4-paper.size-small .cv-name {
    font-size: 1.5rem;
}

.a4-paper.size-small .cv-jobtitle {
    font-size: .9rem;
}

.a4-paper.size-small .cv-text-body,
.a4-paper.size-small .cv-entry-desc,
.a4-paper.size-small .cv-detail-row,
.a4-paper.size-small .cv-skill-entry,
.a4-paper.size-small .cv-text-sm {
    font-size: .75rem;
}

.a4-paper.size-small .cv-entry-title {
    font-size: .85rem;
}

.a4-paper.size-small .cv-sidebar-heading,
.a4-paper.size-small .cv-main-heading {
    font-size: .8rem;
}

.a4-paper.size-large .cv-name {
    font-size: 2.2rem;
}

.a4-paper.size-large .cv-jobtitle {
    font-size: 1.3rem;
}

.a4-paper.size-large .cv-text-body,
.a4-paper.size-large .cv-entry-desc,
.a4-paper.size-large .cv-detail-row,
.a4-paper.size-large .cv-skill-entry,
.a4-paper.size-large .cv-text-sm {
    font-size: .95rem;
}

.a4-paper.size-large .cv-entry-title {
    font-size: 1.05rem;
}

.a4-paper.size-large .cv-sidebar-heading,
.a4-paper.size-large .cv-main-heading {
    font-size: 1.1rem;
}

/* ======================================
   MOBILE FAB
   ====================================== */
.mobile-fab {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-md);
    z-index: 300;
    cursor: pointer;
    font-size: 1.3rem;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.mobile-fab:hover {
    transform: scale(1.05);
}

/* ======================================
   RESPONSIVE
   ====================================== */
@media (max-width: 900px) {
    .topbar-btn span {
        display: none;
    }

    .editor-pane {
        width: 100%;
        max-width: none;
    }

    .preview-pane {
        position: fixed;
        top: 56px;
        left: 0;
        width: 100%;
        height: calc(100vh - 56px);
        z-index: 200;
        transform: translateX(100%);
        transition: transform .3s ease;
    }

    .preview-pane.open {
        transform: translateX(0);
    }

    .preview-scroll {
        padding: 16px 8px;
        /* Less margin on mobile */
    }

    .a4-paper {
        transform: scale(0.45);
        /* Scale to fit mobile width better, instead of huge JS fixed scale */
        transform-origin: top center;
    }

    .mobile-fab {
        display: flex;
    }
}

@media (max-width: 480px) {
    .a4-paper {
        transform: scale(0.42);
        /* Even smaller for very narrow screens */
    }
}

/* ======================================
   PRINT
   ====================================== */
@media print {

    .topbar,
    .editor-pane,
    .preview-toolbar,
    .mobile-fab {
        display: none !important;
    }

    .preview-pane {
        position: static;
        width: 100%;
        height: auto;
        background: none;
        overflow: visible;
        transform: none !important;
    }

    .preview-scroll {
        padding: 0;
        display: block;
        overflow: visible;
    }

    .a4-paper {
        transform: none !important;
        box-shadow: none !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .cv-header-block,
    .cv-wave {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ======================================
   COVER LETTER STYLES
   ====================================== */
.cl-preview-container {
    padding: 20px 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: #1F2937;
}

.cl-sender-info {
    text-align: center;
    margin-bottom: 24px;
}

.cl-name {
    font-size: 2.2rem;
    font-family: inherit;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.cl-contact-row {
    font-size: 0.85rem;
    color: #4B5563;
}

.cl-divider {
    border: none;
    height: 1px;
    background: #E5E7EB;
    margin-bottom: 30px;
}

.cl-date {
    font-size: 0.95rem;
    margin-bottom: 30px;
    color: #374151;
}

.cl-recipient-info {
    font-size: 0.95rem;
    margin-bottom: 40px;
    line-height: 1.5;
    color: #1F2937;
}

.cl-salutation {
    font-size: 1rem;
    margin-bottom: 20px;
    color: #1F2937;
}

.cl-body {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 40px;
    color: #374151;
}

.cl-body p {
    margin-bottom: 14px;
    text-indent: 0;
}

.cl-signoff {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1F2937;
}

.cl-signoff-name {
    margin-top: 30px;
    font-weight: 600;
}