:root {
    --ok-text: #166534;
    --ok-soft: rgba(34, 197, 94, 0.12);
    --ok-border: rgba(22, 163, 74, 0.45);
    --draft-bg: #fffbeb;
    --draft-border: rgba(217, 119, 6, 0.45);
    --draft-text: #92400e;
}

html[data-theme="dark"] {
    --ok-text: #86efac;
    --ok-soft: rgba(34, 197, 94, 0.14);
    --ok-border: rgba(74, 222, 128, 0.40);
    --draft-bg: rgba(245, 158, 11, 0.10);
    --draft-border: rgba(245, 158, 11, 0.40);
    --draft-text: #fcd34d;
}

.cv-page {
    max-width: 980px;
}

.cv-page .title-block {
    max-width: none;
}

.cv-page .name {
    margin: 0 0 6px;
}

.cv-title {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 600;
    color: var(--accent-text);
}

.cv-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 0;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-soft);
}

.cv-meta-item {
    padding-right: 12px;
    margin-right: 12px;
    border-right: 1px solid var(--border-subtle);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    background: var(--ok-soft);
    border: 1px solid var(--ok-border);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ok-text);
}

.back-link {
    display: inline-flex;
    align-items: center;
    height: calc(var(--tap) + 2px);
    padding: 0 12px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-chip);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-soft);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

    .back-link:hover {
        border-color: var(--accent);
        background: var(--accent-soft);
        color: var(--accent-text);
    }

    .back-link:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

.cv-section {
    margin: 0 0 28px;
}

    .cv-section:last-of-type {
        margin-bottom: 0;
    }

.cv-about-text {
    margin: 0;
    max-width: 86ch;
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-main);
}

.highlights-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.highlight {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    border-top: 2px solid var(--accent);
    background: var(--bg-elevated);
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-main);
}

.highlight-where {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-text);
}

.cv-job {
    display: grid;
    grid-template-columns: 212px minmax(0, 1fr);
    gap: 8px 28px;
    padding: 18px 20px;
    position: static;
}

.cv-job-head {
    min-width: 0;
}

    .cv-job-head p {
        margin: 0;
    }

    .cv-job-head .exp-company {
        margin-top: 3px;
        font-size: 13.5px;
    }

        .cv-job-head .exp-company strong {
            font-weight: 600;
            color: var(--text-main);
        }

    .cv-job-head .exp-period {
        margin-top: 6px;
        font-size: 12.5px;
        font-weight: 500;
        white-space: normal;
        color: var(--accent-text);
    }

.cv-job-context {
    margin-top: 8px !important;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-soft);
}

.cv-job-body {
    min-width: 0;
}

.cv-job .exp-list {
    color: var(--text-main);
}

    .cv-job .exp-list li + li {
        margin-top: 5px;
    }

    .cv-job .exp-list li::marker {
        color: var(--accent);
    }

.cv-project-note {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-soft);
}

.cv-stack {
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-soft);
}

    .cv-stack strong {
        font-weight: 600;
        color: var(--text-main);
    }

.exp-team + .exp-team {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-subtle);
}

.exp-team-title {
    font-size: 13px;
    line-height: 1.45;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 6px;
}

.cv-skills {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    padding: 6px 20px;
}

.cv-skill-row {
    display: grid;
    grid-template-columns: 212px minmax(0, 1fr);
    gap: 8px 28px;
    align-items: start;
    padding: 12px 0;
}

    .cv-skill-row + .cv-skill-row {
        border-top: 1px solid var(--border-subtle);
    }

.cv-skill-title {
    margin: 0;
    padding-top: 5px;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--text-main);
}

.cv-skills .skills-chips {
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 6px;
}

.cv-skills .skills-chip {
    background: var(--bg-card);
    padding: 5px 10px;
}

.cv-page .footer-note {
    margin-top: 20px;
}

.draft-note {
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--draft-border);
    background: var(--draft-bg);
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-soft);
}

.draft-note-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.draft-note-label {
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--draft-border);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--draft-text);
}

.draft-note-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.draft-note a {
    color: var(--accent-text);
}

.draft-note details {
    margin-top: 6px;
}

.draft-note summary {
    padding: 4px 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--draft-text);
}

    .draft-note summary:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

.draft-note-sub {
    margin: 14px 0 6px;
    font-weight: 600;
    color: var(--text-main);
}

.draft-note ul,
.draft-note ol {
    margin: 0;
    padding-left: 20px;
}

.draft-note li + li {
    margin-top: 4px;
}

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

    .cv-job,
    .cv-skill-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .cv-job {
        gap: 12px;
    }

    .cv-skill-title {
        padding-top: 0;
    }
}

@media (max-width: 600px) {
    .cv-title {
        font-size: 16px;
    }

    .cv-meta-item {
        padding-right: 0;
        margin-right: 14px;
        border-right: none;
    }

    .cv-about-text {
        font-size: 14px;
    }

    .highlight {
        padding: 12px 14px;
    }

    .cv-job {
        padding: 14px;
    }

    .cv-skills {
        padding: 4px 14px;
    }

    .draft-note {
        padding: 12px 14px;
    }
}

@media print {
    @page { size: A4; margin: 10mm 11mm; }

    :root,
    html[data-theme="dark"] {
        --ok-text: #166534;
        --ok-soft: #fff;
        --ok-border: #bbf7d0;
    }

    .draft-note,
    .footer-note { display: none !important; }

    html, body { font-size: 8pt; }

    .cv-page { max-width: 100% !important; }

    .cv-page .header {
        padding-bottom: 5pt;
        margin-bottom: 6pt;
    }

    .cv-page .name { font-size: 17pt; margin: 0 0 1pt; }
    .cv-title { font-size: 10pt; margin: 0 0 3pt; color: #1d4ed8; }
    .cv-meta { font-size: 8pt; gap: 0; }
    .cv-meta-item { padding-right: 6pt; margin-right: 6pt; border-right: 1pt solid #d1d5db; }
    .status-badge { font-size: 8pt; padding: 0; border: none; background: none !important; }
    .status-badge .chip-dot { display: none; }
    .cv-page .contacts { margin-top: 3pt; }
    .cv-page .contact-btn .icon { display: none; }
    .cv-page .contact-btn .visually-hidden {
        position: static !important;
        width: auto;
        height: auto;
        margin: 0;
        clip: auto;
        overflow: visible;
        font-weight: 600;
    }

    .cv-section,
    .cv-page section { margin: 0 0 6pt; }

    .cv-page .section-title {
        font-size: 7.5pt;
        margin: 0 0 3pt;
        padding-bottom: 1.5pt;
        border-bottom: 0.75pt solid #d1d5db;
        color: #111827;
        break-after: avoid;
        page-break-after: avoid;
    }

        .cv-page .section-title::before { display: none; }

    .cv-about-text { max-width: none; font-size: 8pt; line-height: 1.4; color: #111827; }

    .highlights-list { display: block; padding-left: 11pt; list-style: disc; }

    .highlight {
        display: list-item;
        background: none !important;
        border: none;
        border-radius: 0;
        padding: 0;
        font-size: 8pt;
        line-height: 1.4;
    }

    .highlight-where {
        display: inline;
        margin: 0;
        font-size: 8pt;
        text-transform: none;
        letter-spacing: 0;
        color: #111827;
    }

        .highlight-where::after { content: ": "; }

    .cv-job {
        display: block;
        border: none !important;
        background: none !important;
        padding: 0 !important;
        break-inside: auto;
        page-break-inside: auto;
    }

    .cv-page .experience-item + .experience-item {
        margin-top: 5pt;
        padding-top: 4pt !important;
        border-top: 0.5pt solid #e5e7eb !important;
    }

    .cv-job-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 10pt;
        margin-bottom: 2pt;
        break-inside: avoid;
        page-break-inside: avoid;
        break-after: avoid;
        page-break-after: avoid;
    }

        .cv-job-head > * { grid-column: 1; }

        .cv-job-head .exp-position { font-size: 9pt; line-height: 1.3; }
        .cv-job-head .exp-company { margin-top: 0; font-size: 8.5pt; }

        .cv-job-head .exp-period {
            grid-column: 2;
            grid-row: 1;
            margin-top: 0;
            font-size: 8.5pt;
            font-weight: 600;
            white-space: nowrap;
            color: #111827;
        }

    .cv-job-head .cv-job-context { grid-column: 1 / -1; }

    .cv-job-context { margin-top: 0 !important; font-size: 7.5pt; line-height: 1.35; color: #4b5563; }

    .cv-job .exp-list { padding-left: 11pt; font-size: 8pt; line-height: 1.36; color: #111827; }
    .cv-job .exp-list li { break-inside: avoid; page-break-inside: avoid; }
    .cv-job .exp-list li + li { margin-top: 0.8pt; }
    .cv-job .exp-list li::marker { color: #111827; }

    .cv-project-note { margin: 0 0 1pt; font-size: 7.5pt; line-height: 1.35; color: #4b5563; }

    .cv-stack {
        margin: 2pt 0 0;
        padding-top: 0;
        border-top: none;
        font-size: 7.8pt;
        line-height: 1.35;
        color: #374151;
        break-before: avoid;
        page-break-before: avoid;
    }

    .exp-team + .exp-team { margin-top: 3pt; padding-top: 0; border-top: none; }
    .exp-team-title { font-size: 8pt; margin: 0 0 1pt; break-after: avoid; page-break-after: avoid; }

    .cv-skills { border: none; background: none !important; padding: 0; }

    .cv-skill-row {
        display: block;
        padding: 0;
        break-inside: avoid;
        page-break-inside: avoid;
    }

        .cv-skill-row + .cv-skill-row { border-top: none; margin-top: 1.5pt; }

    .cv-skill-title { display: inline; padding: 0; font-size: 8pt; }

        .cv-skill-title::after { content: ": "; }

    .cv-skills .skills-chips { display: inline; }

    .cv-skills .skills-chip {
        display: inline;
        padding: 0;
        border: none;
        background: none !important;
        font-size: 8pt;
        line-height: 1.4;
    }

        .cv-skills .skills-chip strong { font-weight: 400; }
        .cv-skills .skills-chip:not(:last-child)::after { content: ","; }

    .cv-page .education-card {
        border: none;
        background: none !important;
        padding: 0;
        font-size: 8pt;
        line-height: 1.4;
    }
}

.cv-meta-item:last-child {
    padding-right: 0;
    margin-right: 0;
    border-right: none;
}

.cv-skill-text {
    margin: 0;
    padding-top: 5px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-main);
}

@media (max-width: 900px) {
    .cv-skill-text {
        padding-top: 0;
    }
}

@media print {
    .cv-skill-text {
        display: inline;
        padding: 0;
        font-size: 8pt;
        line-height: 1.4;
        color: #111827;
    }
}

@media (max-width: 600px) {
    .draft-note-label {
        font-size: 12px;
    }
}
