body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(120deg, #e0f7fa 0%, #b2dfdb 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 1rem;
    min-height: 80vh;
    align-items: center;
    justify-content: center;
}

.form-section, .preview-section {
    background: #f0fbfa;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 2rem;
    flex: 1 1 350px;
    min-width: 320px;
}

.form-section h2, .preview-section h2 {
    margin-top: 0;
    color: #008080;
}

#cv-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#cv-form input, #cv-form textarea {
    padding: 0.75rem;
    border: 1px solid #80cbc4;
    border-radius: 6px;
    font-size: 1rem;
    background: #e0f2f1;
    transition: border 0.2s;
    color: #00695c;
    resize: none;
}

#cv-form input:focus, #cv-form textarea:focus {
    border-color: #008080;
    outline: none;
}

#export-btn {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: #008080;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

#export-btn:hover {
    background: #004d4d;
}

#cv-preview {
    /* Portrait A4 aspect ratio, always centered and fitting screen */
    background: #fff;
    border-radius: 12px;
    padding: 2vw 2vw;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    width: 100%;
    max-width: min(100vw, 595px); /* 595px = 210mm at 72dpi */
    aspect-ratio: 210/297;
    height: auto;
    min-height: unset;
    font-size: 1.08rem;
    box-sizing: border-box;
    overflow: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    border: 1.5px solid #b2dfdb;
    transition: box-shadow 0.2s;
}

.preview-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.cv-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
    gap: 0.2em;
}

.cv-header-main {
    flex: 2;
}

.cv-header-side {
    flex: 1;
    text-align: right;
    font-size: 0.98em;
    color: #008080;
    margin-top: 0.3em;
}

.cv-header h1 {
    margin: 0 0 0.2em 0;
    color: #008080;
    font-size: 2.2rem;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 0.1em;
}

.cv-header p {
    margin: 0.1em 0;
    color: #444;
    font-size: 1.05em;
    margin-bottom: 0.1em;
}

.cv-divider {
    border: none;
    border-top: 1px solid #b2dfdb;
    margin: 0.5em 0 1.2em 0;
}

.cv-body {
    display: flex;
    flex-direction: column;
    gap: 1.2em;
}

.cv-section {
    margin-bottom: 0.2em;
}

.cv-section h3 {
    margin: 0 0 0.2em 0;
    color: #008080;
    font-size: 1.13em;
    letter-spacing: 0.5px;
    border-left: 4px solid #008080;
    padding-left: 0.5em;
    font-weight: 600;
    background: linear-gradient(90deg, #b2dfdb 60%, transparent 100%);
    display: inline-block;
}

.cv-section p, .cv-section ul {
    margin: 0.1em 0 0 0;
    color: #222;
    font-size: 1em;
}

.cv-section ul {
    padding-left: 1.3em;
    list-style: disc;
}

.cv-section ul li {
    margin-bottom: 0.15em;
}

.cv-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2em;
    font-size: 1.01em;
    color: #008080;
    margin-bottom: 0.3em;
    margin-top: 0.1em;
    justify-content: flex-start;
    align-items: center;
    min-height: 1.5em;
}

.cv-contact span {
    display: inline-block;
    min-width: 0;
    word-break: break-all;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1em;
    color: #008080;
}

@media (max-width: 900px) {
    .container {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        justify-content: center;
    }
    #cv-preview {
        max-width: 98vw;
        padding: 1rem 0.5rem;
        aspect-ratio: 210/297;
    }
    .cv-header {
        flex-direction: column;
        gap: 0.5em;
        align-items: flex-start;
    }
    .cv-header-side {
        text-align: left;
        margin-top: 0;
    }
}

@media (max-width: 700px) {
    #cv-preview {
        max-width: 98vw;
        padding: 2vw 1vw;
        aspect-ratio: 210/297;
    }
    .container {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        justify-content: center;
    }
    .cv-header {
        margin-bottom: 0.3rem;
    }
    .cv-contact {
        margin-bottom: 0.5em;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2em;
    }
    .cv-contact span {
        white-space: normal;
    }
}
