html {
    height: 100%;
}

body {
    height: 100%;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
}

.builder-navbar,
.builder-layout,
.editor-panel,
.preview-panel {
    box-sizing: border-box;
}


/* =========================
   NAVBAR
========================= */

.builder-navbar {
    height: 76px;

    padding: 0 28px;

    border-bottom: 1px solid var(--border);

    background: var(--surface);

    display: flex;

    align-items: center;

    justify-content: space-between;

    position: relative;

    z-index: 100;
    flex-shrink: 0;
}


.builder-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}


.toolbar-button {
    border: 1px solid var(--border);

    background: var(--surface);

    color: var(--text);

    cursor: pointer;

    font-family: inherit;

    padding: 10px 14px;

    min-width: 86px;

    border-radius: 8px;

    font-size: 13px;

    font-weight: 600;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.toolbar-button:hover {
    transform: translateY(-1px);
}


.primary-toolbar-button {
    background: var(--text);

    color: white;

    border-color: var(--text);
}


/* =========================
   MAIN BUILDER
========================= */

.builder-layout {
    height: calc(100vh - 76px);
    min-height: 0;
    max-height: calc(100vh - 76px);
    overflow: hidden;

    display: grid;
    grid-template-columns: 450px minmax(0, 1fr);
}


/* =========================
   EDITOR
========================= */

.editor-panel {
    min-height: 0;
    padding: 32px;

    border-right: 1px solid var(--border);

    background: var(--background);

    overflow-y: auto;
}


.panel-heading {
    margin-bottom: 30px;
}


.panel-heading h1 {
    font-size: 32px;

    letter-spacing: -1.5px;

    margin-bottom: 8px;
}


.panel-heading > p:last-child {
    color: var(--muted);

    font-size: 14px;
}


/* =========================
   TEMPLATE SELECTOR
========================= */

.template-card .section-description {
    margin-top: -10px;
    margin-bottom: 18px;
}

.template-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.template-option {
    min-width: 0;
    border: 1px solid var(--border);
    background: var(--background);
    color: var(--text);
    border-radius: 10px;
    padding: 9px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.template-option:hover {
    transform: translateY(-1px);
}

.template-option.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent);
}

.template-option-copy {
    display: block;
    padding: 8px 2px 2px;
}

.template-option-copy strong {
    display: block;
    font-size: 12px;
    margin-bottom: 3px;
}

.template-option-copy small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
}

.template-thumb {
    height: 92px;
    position: relative;
    overflow: hidden;
    display: block;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
}

.template-thumb span {
    display: block;
    background: #d5d5d5;
    border-radius: 2px;
}

.template-thumb .thumb-name {
    width: 58%;
    height: 7px;
    background: #222;
    margin-bottom: 5px;
}

.template-thumb .thumb-line {
    width: 42%;
    height: 3px;
    margin-bottom: 10px;
}

.template-thumb .thumb-heading {
    width: 34%;
    height: 4px;
    background: #222;
    margin: 8px 0 5px;
}

.template-thumb .thumb-lines {
    width: 90%;
    height: 14px;
    background: repeating-linear-gradient(to bottom, #ddd 0 2px, transparent 2px 5px);
}

.template-thumb-modern {
    padding-left: 26px;
}

.template-thumb-modern .thumb-sidebar {
    position: absolute;
    inset: 0 auto 0 0;
    width: 18px;
    background: #222;
    border-radius: 0;
}

.template-thumb-modern .thumb-name {
    width: 68%;
}

.template-thumb-minimal {
    padding: 15px 12px;
}

.template-thumb-minimal .thumb-name {
    width: 48%;
    height: 6px;
    margin: 0 auto 5px;
}

.template-thumb-minimal .thumb-line {
    margin-left: auto;
    margin-right: auto;
    width: 28%;
}

.template-thumb-minimal .thumb-heading {
    width: 25%;
    height: 3px;
    margin-top: 11px;
}


/* =========================
   CARDS
========================= */

.builder-card {
    padding: 24px;

    margin-bottom: 16px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 12px;
}


.section-header {
    display: flex;

    justify-content: space-between;

    margin-bottom: 22px;
}


.section-number {
    color: var(--muted);

    font-size: 11px;

    font-weight: 700;

    letter-spacing: 1px;

    margin-bottom: 3px;
}




.section-order-controls {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: auto;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--background);
    flex-shrink: 0;
}

.section-move-button {
    width: 32px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease,
        opacity 0.18s ease;
}

.section-move-button:hover:not(:disabled) {
    background: var(--surface);
    color: var(--accent);
}

.section-move-button:active:not(:disabled) {
    transform: scale(0.94);
}

.section-move-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.section-move-button:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.section-header h2 {
    font-size: 18px;

    letter-spacing: -0.3px;
}


.section-description {
    color: var(--muted);

    font-size: 13px;

    margin-top: -10px;

    margin-bottom: 18px;
}



/* =========================
   RESUME CUSTOMIZATION
========================= */

.customization-group {
    margin-top: 20px;
}

.customization-group > label,
.customization-label-row > label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.customization-label-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 8px;
}

.customization-hint {
    color: var(--muted);
    font-size: 10px;
}

.accent-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.accent-swatch {
    width: 32px;
    height: 32px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.accent-swatch span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.accent-swatch:hover {
    transform: translateY(-1px);
}

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

.accent-swatch:focus-visible,
.custom-color-control:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.custom-color-control {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 9px 4px 5px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
}

.custom-color-control input {
    width: 23px;
    height: 23px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.customization-select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 11px 12px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.customization-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

/* =========================
   FORMS
========================= */

.form-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 15px;
}


.form-group {
    display: flex;

    flex-direction: column;

    gap: 7px;
}


.form-group.full {
    grid-column: 1 / -1;
}


.form-group label {
    font-size: 12px;

    font-weight: 600;
}


.form-group input,
.form-group textarea {
    width: 100%;

    border: 1px solid var(--border);

    background: var(--surface);

    color: var(--text);

    border-radius: 7px;

    padding: 11px 12px;

    font-family: inherit;

    font-size: 13px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


.form-group textarea {
    resize: vertical;

    line-height: 1.5;
}


.form-group input:focus,
.form-group textarea:focus {
    border-color: #888;

    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.04);
}


.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #aaa;
}


/* =========================
   DYNAMIC ITEMS
========================= */

.dynamic-item {
    padding: 18px;

    margin-bottom: 12px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: var(--background);
}


.dynamic-item-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 15px;
}


.dynamic-item-title {
    font-size: 12px;

    font-weight: 700;

    color: var(--muted);

    text-transform: uppercase;

    letter-spacing: 0.5px;
}


.remove-button {
    border: none;

    background: transparent;

    color: #999;

    cursor: pointer;

    font-family: inherit;

    font-size: 12px;

    padding: 4px;
}


.remove-button:hover {
    color: #d33;
}


.dynamic-item .form-grid {
    gap: 12px;
}


/* =========================
   ADD BUTTON
========================= */

.add-button {
    width: 100%;

    padding: 12px;

    border: 1px dashed #bbb;

    background: transparent;

    color: var(--text);

    border-radius: 8px;

    cursor: pointer;

    font-family: inherit;

    font-size: 13px;

    font-weight: 600;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}


.add-button:hover {
    background: var(--background);

    border-color: #888;
}


.editor-bottom-space {
    height: 40px;
}


/* =========================
   PREVIEW
========================= */

.preview-panel {
    min-height: 0;
    background: #e9e9e7;

    display: flex;

    flex-direction: column;

    min-width: 0;
    min-height: 0;
    overflow: hidden;
}


.preview-toolbar {
    height: 55px;

    padding: 0 24px;

    background: var(--surface);

    border-bottom: 1px solid var(--border);

    display: flex;

    justify-content: space-between;

    align-items: center;

    font-size: 13px;

    font-weight: 600;

    flex-shrink: 0;
}


.preview-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.view-controls {
    display: inline-flex !important;
    align-items: center;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--background);
    flex: 0 0 auto;
    position: relative;
    z-index: 110;
}

.view-controls-label {
    padding: 0 6px 0 7px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.view-button {
    border: 0;
    border-radius: 6px;
    padding: 7px 10px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.view-button:hover {
    color: var(--text);
    background: var(--surface);
}

.view-button.active {
    background: var(--text);
    color: var(--background);
}

.view-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}


.preview-status {
    color: var(--muted);

    font-weight: 500;
}


.resume-preview-wrapper {
    flex: 1 1 auto;
    min-height: 0;

    padding: 38px 42px 48px;

    overflow: auto;
    overscroll-behavior: contain;

    display: flex;

    justify-content: center;

    align-items: flex-start;
}


/* =========================
   RESUME PAPER
========================= */

.resume-preview {
    width: 794px;
    min-height: 1123px;
    padding: 0;
    background: white;
    color: #171717;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
    box-sizing: border-box;
}

.resume-document {
    width: 100%;
    min-height: 1123px;
    box-sizing: border-box;
    padding: 55px;
    background: #fff;
    color: #171717;
    font-family: var(--resume-font, Arial), Arial, sans-serif;
}

.resume-document,
.resume-document * {
    font-family: inherit;
}


/* =========================
   PREVIEW HEADER
========================= */

.resume-header {
    border-bottom: 2px solid var(--resume-accent);

    padding-bottom: 18px;

    margin-bottom: 25px;
}


.resume-name {
    font-size: 34px;

    line-height: 1.1;

    font-weight: 700;

    margin-bottom: 5px;
}


.resume-job-title {
    font-size: 15px;

    color: var(--resume-accent);

    font-weight: 600;

    margin-bottom: 12px;
}


.resume-contact {
    display: flex;

    flex-wrap: wrap;

    gap: 8px 15px;

    color: #555;

    font-size: 10px;
}


.resume-contact span {
    white-space: nowrap;
}


/* =========================
   RESUME SECTIONS
========================= */

.resume-section {
    margin-bottom: 22px;
}


.resume-section-title {
    font-size: 12px;

    text-transform: uppercase;

    letter-spacing: 1.3px;

    color: var(--resume-accent);

    border-bottom: 1px solid #ddd;

    padding-bottom: 5px;

    margin-bottom: 12px;
}


.resume-summary {
    font-size: 11px;

    line-height: 1.6;

    color: #333;
}


/* =========================
   EXPERIENCE / EDUCATION
========================= */

.resume-entry {
    margin-bottom: 15px;
}


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


.resume-entry-header {
    display: flex;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 3px;
}


.resume-entry-title {
    font-size: 12px;

    font-weight: 700;
}


.resume-entry-date {
    font-size: 10px;

    color: #666;

    white-space: nowrap;
}


.resume-entry-subtitle {
    font-size: 10px;

    color: #555;

    margin-bottom: 6px;
}


.resume-entry-description {
    font-size: 10px;

    line-height: 1.55;

    color: #333;

    white-space: pre-line;
}


/* =========================
   SKILLS
========================= */

.resume-skills {
    display: flex;

    flex-wrap: wrap;

    gap: 6px;
}


.resume-skill {
    font-size: 9px;

    padding: 4px 8px;

    border: 1px solid #ccc;

    border-radius: 3px;

    color: #333;
}


/* =========================
   PROJECTS
========================= */

.resume-project-link {
    color: var(--resume-accent);

    font-size: 9px;
}


/* =========================
   EMPTY PREVIEW
========================= */

.preview-empty {
    min-height: 1010px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    color: #777;
}


.preview-empty h2 {
    font-size: 25px;

    margin-bottom: 10px;
}


.preview-empty p {
    max-width: 350px;

    font-size: 13px;
}


/* =========================
   DARK MODE
========================= */

html.dark-mode {
    --background: #171717;

    --surface: #222222;

    --text: #f5f5f5;

    --muted: #999999;

    --border: #363636;
}


html.dark-mode .preview-panel {
    background: #111111;
}


html.dark-mode .resume-preview {
    background: white;

    color: #171717;
}


html.dark-mode .form-group input,
html.dark-mode .form-group textarea {
    background: #1c1c1c;

    color: white;
}


html.dark-mode .dynamic-item {
    background: #1b1b1b;
}


html.dark-mode .toolbar-button {
    background: #222222;

    color: white;
}


html.dark-mode .primary-toolbar-button {
    background: white;

    color: #111111;
}


/* =========================
   VIEW MODES
========================= */

.builder-layout.view-editor {
    grid-template-columns: minmax(0, 1fr);
}

.builder-layout.view-editor .preview-panel {
    display: none;
}

.builder-layout.view-preview {
    grid-template-columns: minmax(0, 1fr);
}

.builder-layout.view-preview .editor-panel {
    display: none;
}

@media (max-width: 900px) {
    .builder-layout.view-editor .editor-panel,
    .builder-layout.view-preview .preview-panel {
        display: flex;
    }
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1100px) {

    .builder-layout {
        grid-template-columns: 390px 1fr;
    }

    .editor-panel {
        padding: 25px;
    }

    .resume-preview-wrapper {
        padding: 30px;
    }

}


@media (max-width: 900px) {

    body {
        overflow: auto;
    }

    .builder-layout {
        height: auto;
        min-height: calc(100vh - 76px);
        max-height: none;
        overflow: visible;
        grid-template-columns: 1fr;
    }


    .editor-panel {
        border-right: none;

        border-bottom: 1px solid var(--border);
    }


    .preview-panel {
        min-height: 720px;
    }

}


@media (max-width: 600px) {

    .builder-navbar {
        padding: 0 15px;
    }


    .builder-actions {
        gap: 5px;
    }


    .builder-actions .toolbar-button {
        padding: 8px 9px;
        font-size: 11px;
    }

    .preview-toolbar {
        height: auto;
        min-height: 55px;
        padding: 10px 12px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .view-controls {
        margin-left: auto;
    }

    .view-controls-label {
        display: none;
    }


    .editor-panel {
        padding: 18px;
    }


    .form-grid {
        grid-template-columns: 1fr;
    }


    .form-group.full {
        grid-column: auto;
    }


    .resume-preview-wrapper {
        padding: 15px;
    }


    .resume-preview {
        width: 794px;
    }

    .resume-document {
        width: 794px;
    }

}

@media (max-width: 600px) {
    .section-order-controls {
        padding-left: 8px;
        gap: 4px;
    }

    .section-move-button {
        width: 28px;
        height: 28px;
    }
}


/* =========================
   RESUME TEMPLATES
========================= */

.resume-page.template-modern {
    padding: 46px 48px 54px 118px;
    position: relative;
}

.resume-page.template-modern::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 70px;
    background: var(--resume-accent);
}

.resume-page.template-modern::after {
    content: "";
    position: absolute;
    top: 0;
    left: 70px;
    width: 1px;
    height: 100%;
    background: #e7e7e7;
}

.resume-page.template-modern .resume-header {
    border-bottom: 0;
    padding-bottom: 24px;
    margin-bottom: 28px;
    position: relative;
}

.resume-page.template-modern .resume-header::after {
    content: "";
    display: block;
    width: 54px;
    height: 3px;
    margin-top: 16px;
    background: var(--resume-accent);
}

.resume-page.template-modern .resume-name {
    font-size: 31px;
    letter-spacing: -.7px;
}

.resume-page.template-modern .resume-job-title {
    font-size: 14px;
}

.resume-page.template-modern .resume-section-title {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 10px;
    letter-spacing: 1.6px;
    font-size: 11px;
}

.resume-page.template-modern .resume-section {
    margin-bottom: 24px;
}

.resume-page.template-modern .resume-entry {
    padding-left: 12px;
    border-left: 2px solid #ededed;
}

.resume-page.template-modern .resume-skill {
    border-radius: 999px;
    background: color-mix(in srgb, var(--resume-accent) 8%, white);
    border: 1px solid color-mix(in srgb, var(--resume-accent) 24%, #ddd);
    padding: 4px 9px;
}

.resume-page.template-minimal {
    padding: 54px 58px 60px;
}

.resume-page.template-minimal .resume-header {
    text-align: center;
    border-bottom: 1px solid #d8d8d8;
    padding-bottom: 26px;
    margin-bottom: 32px;
}

.resume-page.template-minimal .resume-name {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -.4px;
}

.resume-page.template-minimal .resume-job-title {
    font-weight: 500;
    margin-bottom: 11px;
}

.resume-page.template-minimal .resume-contact {
    justify-content: center;
}

.resume-page.template-minimal .resume-section {
    margin-bottom: 29px;
}

.resume-page.template-minimal .resume-section-title {
    border-bottom: 0;
    font-size: 10px;
    letter-spacing: 2.2px;
    padding-bottom: 0;
    margin-bottom: 11px;
}

.resume-page.template-minimal .resume-entry {
    margin-bottom: 18px;
}

.resume-page.template-minimal .resume-entry-title {
    font-weight: 600;
}


@media (max-width: 900px) {
    .template-options {
        grid-template-columns: 1fr;
    }

    .template-option {
        display: grid;
        grid-template-columns: 105px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
    }

    .template-option-copy {
        padding: 0;
    }
}


/* =========================
   PDF / PRINT
========================= */

@page {
    size: A4 portrait;
    margin: 0;
}

@media print {

    html,
    body {
        width: 210mm;
        height: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
        overflow: visible !important;
        background: #fff !important;
    }

    .builder-navbar,
    .editor-panel,
    .preview-toolbar {
        display: none !important;
    }

    .builder-layout,
    .builder-layout.view-editor,
    .builder-layout.view-preview {
        display: block !important;
        width: 210mm;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .preview-panel {
        display: block !important;
        width: 210mm;
        min-height: 0 !important;
        height: auto !important;
        overflow: visible !important;
        background: #fff !important;
    }

    .resume-preview-wrapper {
        display: block !important;
        width: 210mm;
        height: auto !important;
        min-height: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff !important;
    }

    .resume-preview {
        width: 210mm !important;
        min-height: 0 !important;
        height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
    }

    .resume-document {
        width: 210mm !important;
        min-height: 0 !important;
        height: auto !important;
        box-sizing: border-box;
        background: #fff !important;
        color: #171717 !important;
        font-family: var(--resume-font, Arial), Arial, sans-serif !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .resume-page {
        width: 210mm !important;
        height: 297mm !important;
        min-height: 297mm !important;
        max-height: 297mm !important;
        margin: 0 !important;
        padding: 48px 55px 50px;
        box-sizing: border-box;
        overflow: hidden !important;
        box-shadow: none !important;
        break-after: page;
        page-break-after: always;
    }

    .resume-page:last-child {
        break-after: auto;
        page-break-after: auto;
    }

    .resume-document * {
        font-family: inherit !important;
    }

    .resume-section,
    .resume-entry {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .resume-header,
    .resume-section-title {
        break-after: avoid;
        page-break-after: avoid;
    }
}

/* =========================
   TYPOGRAPHY CUSTOMIZATION
========================= */

.typography-group {
    padding-top: 4px;
}

.typography-control {
    margin-top: 16px;
}

.customization-value {
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    min-width: 36px;
    text-align: right;
}

.typography-control input[type="range"] {
    width: 100%;
    margin: 4px 0 0;
    padding: 0;

    accent-color: var(--accent);

    cursor: pointer;
}


/* =========================
   RESUME TYPOGRAPHY
========================= */

.resume-document .resume-name {
    font-size: var(--resume-title-size, 34px);
}

.resume-document .resume-section-title,
.resume-document .resume-entry-title {
    font-size: var(--resume-heading-size, 12px);
}

.resume-document .resume-contact,
.resume-document .resume-summary,
.resume-document .resume-entry-date,
.resume-document .resume-entry-subtitle,
.resume-document .resume-entry-description,
.resume-document .resume-skills,
.resume-document .resume-skill,
.resume-document .resume-project-link {
    font-size: var(--resume-body-size, 11px);
}

/* =========================================================
   CRAFTY CV POLISH / A4 PAGINATION
========================================================= */

.optional-label {
    color: var(--muted);
    font-weight: 500;
}

.builder-actions {
    gap: 8px;
}

/* Monochrome theme switch */
.theme-switch {
    width: 52px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.theme-switch-track {
    position: relative;
    display: block;
    width: 52px;
    height: 28px;
    border-radius: 999px;
    background: #eeeeee;
    border: 1px solid #cfcfcf;
    box-sizing: border-box;
    transition: background-color .25s ease, border-color .25s ease;
}

.theme-switch-knob {
    position: absolute;
    top: 2px;
    left: 27px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    color: #171717;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,.18);
    transition: left .25s ease, background-color .25s ease, color .25s ease;
}

.theme-switch-icon {
    display: block;
    transform: translateY(-.5px);
}

html.dark-mode .theme-switch-track {
    background: #292929;
    border-color: #444;
}

html.dark-mode .theme-switch-knob {
    left: 2px;
    background: #f1f1f1;
    color: #171717;
}

.theme-switch:hover,
.theme-switch:active {
    transform: none;
}

/* A4 resume pages */
.resume-preview {
    width: 794px;
    min-height: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.resume-document {
    width: 100%;
    min-height: 0;
    padding: 0;
    background: transparent;
}

.resume-page {
    width: 794px;
    height: 1123px;
    min-height: 1123px;
    box-sizing: border-box;
    padding: 48px 55px 50px;
    margin: 0 auto 24px;
    position: relative;
    overflow: hidden;
    background: #fff;
    color: #171717;
    font-family: var(--resume-font, Arial), Arial, sans-serif;
    box-shadow: 0 15px 40px rgba(0,0,0,.12);
}

.resume-page:last-child {
    margin-bottom: 0;
}

/* Classic gets a clean paper border, including the bottom edge. */
.resume-page.template-classic {
    border: 1px solid #d9d9d9;
}

/* Modern */
.resume-page.template-modern {
    padding: 42px 48px 48px 118px;
}

.resume-page.template-modern::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 70px;
    background: var(--resume-accent);
    z-index: 0;
}

.resume-page.template-modern::after {
    content: "";
    position: absolute;
    top: 0;
    left: 70px;
    width: 1px;
    height: 100%;
    background: #e7e7e7;
}

.resume-page.template-modern > * {
    position: relative;
    z-index: 1;
}

.resume-page.template-modern .resume-header {
    border-bottom: 0;
    padding-bottom: 18px;
    margin-bottom: 20px;
}

.resume-page.template-modern .resume-header::after {
    content: "";
    display: block;
    width: 54px;
    height: 3px;
    margin-top: 12px;
    background: var(--resume-accent);
}

.resume-page.template-modern .resume-name,
.resume-page.template-minimal .resume-name {
    font-size: var(--resume-title-size, 34px);
}

.resume-page.template-modern .resume-job-title,
.resume-page.template-minimal .resume-job-title {
    font-size: var(--resume-title-size, 34px);
}

.resume-page.template-modern .resume-section-title {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 8px;
    letter-spacing: 1.5px;
    font-size: var(--resume-heading-size, 12px);
}

.resume-page.template-modern .resume-section {
    margin-bottom: 17px;
}

.resume-page.template-modern .resume-entry {
    padding-left: 11px;
}

.resume-page.template-modern .resume-skill {
    border-radius: 999px;
    background: color-mix(in srgb, var(--resume-accent) 8%, white);
    border: 1px solid color-mix(in srgb, var(--resume-accent) 24%, #ddd);
}

/* Minimal */
.resume-page.template-minimal {
    padding: 50px 58px 54px;
}

.resume-page.template-minimal .resume-header {
    text-align: center;
    border-bottom: 1px solid #d8d8d8;
    padding-bottom: 22px;
    margin-bottom: 24px;
}

.resume-page.template-minimal .resume-job-title {
    font-weight: 500;
    margin-bottom: 9px;
}

.resume-page.template-minimal .resume-contact {
    justify-content: center;
}

.resume-page.template-minimal .resume-section {
    margin-bottom: 19px;
}

.resume-page.template-minimal .resume-section-title {
    border-bottom: 0;
    font-size: var(--resume-heading-size, 12px);
    letter-spacing: 2px;
    padding-bottom: 0;
    margin-bottom: 8px;
}

/* Global resume spacing: tighter, but still breathable. */
.resume-page .resume-header {
    margin-bottom: 19px;
    padding-bottom: 15px;
}

.resume-page .resume-name {
    font-size: var(--resume-title-size, 34px);
}

.resume-page .resume-job-title {
    font-size: var(--resume-title-size, 34px);
    line-height: 1.15;
    margin-bottom: 9px;
}

.resume-page .resume-section {
    margin-bottom: 17px;
}

.resume-page .resume-section-title,
.resume-page.template-modern .resume-section-title,
.resume-page.template-minimal .resume-section-title {
    font-size: var(--resume-heading-size, 12px);
    line-height: 1.2;
    margin-bottom: 8px;
}

.resume-page .resume-summary,
.resume-page .resume-entry-description {
    line-height: 1.45;
}

.resume-page .resume-entry {
    margin-bottom: 10px;
}

.resume-page .resume-entry-header {
    margin-bottom: 2px;
}

.resume-page .resume-entry-subtitle {
    margin-bottom: 4px;
}

.resume-page .resume-entry-description {
    margin-top: 0;
}

.resume-page .resume-skills {
    gap: 5px;
}

.resume-page .resume-skill {
    padding: 4px 8px;
}

/* Typography controls affect all templates consistently. */
.resume-page .resume-name,
.resume-page .resume-job-title {
    font-size: var(--resume-title-size, 34px);
}

.resume-page .resume-section-title,
.resume-page .resume-entry-title {
    font-size: var(--resume-heading-size, 12px);
}

.resume-page .resume-contact,
.resume-page .resume-summary,
.resume-page .resume-entry-date,
.resume-page .resume-entry-subtitle,
.resume-page .resume-entry-description,
.resume-page .resume-skills,
.resume-page .resume-skill,
.resume-page .resume-project-link {
    font-size: var(--resume-body-size, 11px);
}

.resume-page a {
    color: inherit;
    text-decoration: none;
}

.resume-page .resume-project-link a,
.resume-page .resume-contact a {
    color: inherit;
}

/* =========================================================
   PRINT / PDF FOR MULTIPLE A4 PAGES
========================================================= */
@media print {
    .resume-preview {
        width: 210mm !important;
        min-height: 0 !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    .resume-document {
        width: 210mm !important;
        min-height: 0 !important;
        background: #fff !important;
    }

    .resume-page {
        width: 210mm !important;
        height: 297mm !important;
        min-height: 297mm !important;
        margin: 0 !important;
        box-shadow: none !important;
        break-after: page;
        page-break-after: always;
        overflow: hidden !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .resume-page:last-child {
        break-after: auto;
        page-break-after: auto;
    }
}


/* =========================================================
   FINAL RESUME POLISH
========================================================= */

.resume-page .resume-name,
.resume-page .resume-job-title,
.resume-page .resume-section-title,
.resume-page .resume-entry-title,
.resume-page .resume-contact,
.resume-page .resume-summary,
.resume-page .resume-entry-date,
.resume-page .resume-entry-subtitle,
.resume-page .resume-entry-description,
.resume-page .resume-skills,
.resume-page .resume-skill,
.resume-page .resume-project-link {
    box-sizing: border-box;
}

/* Typography controls own these sizes across all templates. */
.resume-page .resume-name,
.resume-page .resume-job-title {
    font-size: var(--resume-title-size, 34px) !important;
}

.resume-page .resume-section-title,
.resume-page .resume-entry-title {
    font-size: var(--resume-heading-size, 12px) !important;
}

.resume-page .resume-contact,
.resume-page .resume-summary,
.resume-page .resume-entry-date,
.resume-page .resume-entry-subtitle,
.resume-page .resume-entry-description,
.resume-page .resume-skills,
.resume-page .resume-skill,
.resume-page .resume-project-link,
.resume-page .resume-bullets {
    font-size: var(--resume-body-size, 11px) !important;
}

/* Compact, professional vertical rhythm. */
.resume-page .resume-header {
    margin-bottom: 20px;
}

.resume-page .resume-section {
    margin-bottom: 17px;
}

.resume-page .resume-section-title {
    margin-bottom: 8px;
    padding-bottom: 4px;
}

.resume-page .resume-entry {
    margin-bottom: 10px;
}

.resume-page .resume-entry-header {
    margin-bottom: 2px;
}

.resume-page .resume-entry-subtitle {
    margin-bottom: 4px;
}

.resume-page .resume-entry-description {
    line-height: 1.42;
}

.resume-page .resume-summary {
    line-height: 1.45;
}

.resume-page .resume-bullets {
    margin: 3px 0 0;
    padding: 0;
    list-style: none;
    line-height: 1.42;
}

.resume-page .resume-bullets li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 3px;
}

.resume-page .resume-bullets li::before {
    content: var(--resume-bullet, "•");
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
}

/* Keep the Modern template compact without losing its visual identity. */
.resume-page.template-modern .resume-section {
    margin-bottom: 15px;
}

.resume-page.template-modern .resume-entry {
    margin-bottom: 9px;
}

.resume-page.template-modern .resume-header {
    margin-bottom: 17px;
    padding-bottom: 15px;
}

.resume-page.template-modern .resume-header::after {
    margin-top: 9px;
}

/* Minimal stays airy, but not wasteful. */
.resume-page.template-minimal .resume-section {
    margin-bottom: 20px;
}

.resume-page.template-minimal .resume-entry {
    margin-bottom: 11px;
}

/* Classic paper edge is visible on every side. */
.resume-page.template-classic {
    border: 1px solid #d4d4d4;
}

/* Bullet controls */
.setting-switch-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

.setting-switch-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.bullet-style-control {
    margin-top: 12px;
}

.bullet-style-control.disabled {
    opacity: .45;
}

.bullet-style-control.disabled select {
    pointer-events: none;
}

.field-hint {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

/* Home-page account greeting */
.welcome-message {
    display: inline-flex;
    align-items: center;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .welcome-message {
        display: none;
    }
}
