/* ==========================================================================
   boneCV — Document (paper) styles: CV templates, contract, letter, print.
   Rendered on an A4 sheet (210mm). Always light, independent of UI theme.
   ========================================================================== */

#paper {
    width: 210mm;
    min-height: 297mm;
    background: #fff;
    color: #1b1b1f;
    padding: 18mm 17mm;
    box-shadow: var(--paper-shadow);
    font-family: var(--font);
    font-size: 12px;
    line-height: 1.55;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-scheme: light;
}
#paper * { box-sizing: border-box; }
#paper .pi { display: inline-block; width: 11px; height: 11px; vertical-align: -1.5px; margin-right: 5px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- CV: shared ---------- */
.cv-header { display: flex; align-items: center; gap: 20px; }
.cv-photo { display: none; object-fit: cover; flex-shrink: 0; }
#paper.has-photo .cv-photo { display: block; }
.cv-name { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; color: #0b0b0d; margin: 0; }
.cv-role { font-size: 13.5px; font-weight: 500; margin-top: 4px; color: #4b4b55; }
.cv-contacts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 11px; color: #55555e; margin-top: 10px; }
.cv-sect { margin-top: 20px; }
.cv-sect-title { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--cv-accent, #1f3a8a); margin: 0 0 9px; display: flex; align-items: center; gap: 10px; }
.cv-sect-title::after { content: ''; flex: 1; height: 1px; background: #e4e4e8; }
.cv-body { color: #33333a; font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.cv-item { margin-bottom: 11px; break-inside: avoid; page-break-inside: avoid; }
.cv-item:last-child { margin-bottom: 0; }
.cv-item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; font-size: 12.5px; }
.cv-item-head .title { font-weight: 650; color: #111114; }
.cv-item-head .sub { color: #55555e; }
.cv-item-head .date { font-size: 11px; color: #75757f; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cv-item-desc { font-size: 11.75px; color: #44444c; margin-top: 3px; line-height: 1.55; white-space: pre-wrap; }
.skill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; }
.skill-row { display: flex; align-items: center; gap: 10px; font-size: 11.75px; }
.skill-row .name { flex: 1; min-width: 0; color: #22222a; }
.skill-bar { width: 42%; height: 4px; background: #ececf0; border-radius: 2px; overflow: hidden; }
.skill-bar .fill { height: 100%; background: var(--cv-accent, #1f3a8a); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; font-size: 11px; padding: 3px 9px; border-radius: 4px; border: 1px solid #e2e2e7; color: #33333a; }

/* ---------- CV: Modern ---------- */
.cv-modern .cv-header { padding-bottom: 16px; border-bottom: 2px solid var(--cv-accent, #1f3a8a); }
.cv-modern .cv-photo { width: 86px; height: 86px; border-radius: 50%; }
.cv-modern .cv-role { color: var(--cv-accent, #1f3a8a); font-weight: 600; }

/* ---------- CV: Classic (serif, centered) ---------- */
.cv-classic { font-family: var(--font-serif) !important; }
.cv-classic .cv-header { flex-direction: column; text-align: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid #1b1b1f; }
.cv-classic .cv-photo { width: 80px; height: 80px; border-radius: 50%; }
.cv-classic .cv-name { font-size: 30px; font-weight: 600; letter-spacing: .02em; }
.cv-classic .cv-role { font-style: italic; font-size: 14px; color: #4b4b55; }
.cv-classic .cv-contacts { justify-content: center; font-family: var(--font); }
.cv-classic .cv-sect-title { font-family: var(--font-serif); font-size: 12.5px; font-weight: 600; letter-spacing: .18em; color: #1b1b1f; justify-content: center; }
.cv-classic .cv-sect-title::before { content: ''; flex: 1; height: 1px; background: #e4e4e8; }
.cv-classic .cv-body, .cv-classic .cv-item-desc { font-size: 12.5px; }
.cv-classic .skill-bar .fill { background: #1b1b1f; }

/* ---------- CV: Minimal (label column, monochrome) ---------- */
.cv-minimal .cv-photo { display: none !important; }
.cv-minimal .cv-header { padding-bottom: 14px; border-bottom: 1px solid #d9d9de; }
.cv-minimal .cv-name { font-size: 25px; font-weight: 650; }
.cv-minimal .cv-role { color: #55555e; }
.cv-minimal .cv-sect { display: grid; grid-template-columns: 34mm minmax(0, 1fr); gap: 0 6mm; margin-top: 16px; }
.cv-minimal .cv-sect-title { color: #111114; font-size: 10px; letter-spacing: .12em; margin: 2px 0 0; display: block; }
.cv-minimal .cv-sect-title::after { display: none; }
.cv-minimal .skill-bar .fill { background: #111114; }
.cv-minimal .skill-grid { grid-template-columns: 1fr; }

/* ---------- Contract (serif, formal) ---------- */
.doc-contract { font-family: var(--font-serif) !important; font-size: 12.5px; line-height: 1.65; color: #1b1b1f; padding: 20mm 20mm !important; }
.k-title { text-align: center; font-size: 17px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.k-subtitle { text-align: center; font-size: 12px; font-style: italic; color: #55555e; margin-top: 4px; }
.k-rule { height: 1px; background: #1b1b1f; margin: 16px 0 14px; }
.k-meta { display: flex; justify-content: space-between; font-size: 12px; color: #33333a; margin-bottom: 16px; }
.k-parties { margin: 0 0 16px; }
.k-parties p { margin: 0 0 6px; }
.k-label { font-family: var(--font); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #75757f; margin: 10px 0 4px; }
.k-intro { margin-bottom: 16px; text-align: justify; }
.k-article { margin-bottom: 12px; break-inside: avoid; page-break-inside: avoid; }
.k-article h3 { font-size: 12.5px; font-weight: 700; margin: 0 0 3px; }
.k-article p { margin: 0; text-align: justify; white-space: pre-wrap; }
.k-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 18mm; margin-top: 30px; font-size: 12px; break-inside: avoid; page-break-inside: avoid; }
.k-sign .role { font-weight: 700; }
.k-sign .line { border-top: 1px solid #1b1b1f; margin-top: 34px; padding-top: 6px; color: #55555e; font-size: 11px; }

/* ---------- Letter / official request ---------- */
.doc-letter { font-family: var(--font-serif) !important; font-size: 12.5px; line-height: 1.7; color: #1b1b1f; padding: 22mm 22mm !important; }
.l-from { white-space: pre-wrap; color: #33333a; line-height: 1.5; }
.l-from b { color: #111114; }
.l-place-date { text-align: right; margin: 22px 0 18px; color: #33333a; }
.l-to { white-space: pre-wrap; line-height: 1.5; }
.l-to b { display: block; color: #111114; }
.l-subject { margin: 26px 0 18px; font-weight: 700; }
.l-subject span { font-weight: 400; color: #55555e; }
.l-greet { margin-bottom: 12px; }
.l-body { white-space: pre-wrap; text-align: justify; }
.l-close { margin-top: 26px; }
.l-sign { margin-top: 8px; }
.l-sign .name { font-weight: 700; }
.l-sign .line { border-top: 1px solid #1b1b1f; width: 60mm; margin-top: 34px; padding-top: 5px; font-size: 11px; color: #55555e; }

/* ---------- Print ---------- */
@media print {
    @page { size: A4; margin: 16mm 0; }
    html, body { background: #fff !important; }
    .editor-shell, .panes { display: block !important; height: auto !important; min-height: 0 !important; }
    .preview-pane { display: block !important; padding: 0 !important; overflow: visible !important; background: #fff !important; }
    .paper-frame { width: auto !important; height: auto !important; }
    .paper-frame > #paper { position: static !important; transform: none !important; }
    #paper { box-shadow: none !important; width: 210mm !important; min-height: 0 !important; padding-top: 0 !important; padding-bottom: 0 !important; }
}
