.section-helper {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.94rem;
}

.template-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.template-filter {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 12px;
    background: #ffffff;
    color: var(--muted);
    font-size: 0.9rem;
}

.template-filter:hover,
.template-filter.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.template-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.template-card {
    display: grid;
    justify-items: stretch;
    min-height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
    color: var(--text);
    text-align: left;
    box-shadow: none;
}

.template-card:hover,
.template-card.is-selected {
    border-color: var(--accent);
    background: #fbfefe;
}

.template-card.is-selected {
    box-shadow: inset 0 0 0 2px rgba(15, 111, 104, 0.16);
}

.template-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 8px;
}

.template-card-badge,
.template-card-photo {
    border-radius: 999px;
    padding: 3px 7px;
    font-size: 0.72rem;
    font-weight: 760;
}

.template-card-badge {
    background: #eef2f7;
    color: #334155;
}

.template-card-photo {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.template-card-title {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 0.98rem;
}

.template-card-best,
.template-card-description {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.template-card-best {
    margin-bottom: 4px;
    font-weight: 720;
}

.template-thumb {
    display: grid;
    gap: 7px;
    min-height: 82px;
    border: 1px solid #d8e0e4;
    border-radius: 6px;
    padding: 8px;
    background: #ffffff;
}

.template-thumb-bar {
    display: block;
    width: 58%;
    height: 8px;
    border-radius: 999px;
    background: #172126;
}

.template-thumb-body {
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 7px;
}

.template-thumb-side,
.template-thumb-main {
    display: grid;
    gap: 5px;
    align-content: start;
}

.template-thumb-dot {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #d8e0e4;
}

.template-thumb-mini,
.template-thumb-line {
    display: block;
    height: 5px;
    border-radius: 999px;
    background: #cbd5e1;
}

.template-thumb-line:nth-child(2),
.template-thumb-line:nth-child(4) {
    width: 74%;
}

.template-thumb-ats-simple,
.template-thumb-ats-compact,
.template-thumb-ats-classic,
.template-thumb-minimal-pro {
    background: #ffffff;
}

.template-thumb-ats-compact .template-thumb-line {
    height: 4px;
}

.template-thumb-ats-classic {
    border-top: 5px solid #27313a;
}

.template-thumb-modern-sidebar .template-thumb-body,
.template-thumb-modern-split .template-thumb-body,
.template-thumb-tech-project .template-thumb-body,
.template-thumb-corporate-blue .template-thumb-body,
.template-thumb-customer-friendly .template-thumb-body {
    grid-template-columns: 34px 1fr;
}

.template-thumb-modern-sidebar .template-thumb-side,
.template-thumb-corporate-blue .template-thumb-side {
    border-radius: 4px;
    padding: 4px;
    background: #0f6f68;
}

.template-thumb-modern-header .template-thumb-bar,
.template-thumb-corporate-blue .template-thumb-bar {
    width: 100%;
    height: 16px;
    background: #1d4f8f;
}

.template-thumb-creative-marketing .template-thumb-bar,
.template-thumb-customer-friendly .template-thumb-bar {
    background: #b65d4b;
}

.template-thumb-tech-project {
    background: #f6fbfa;
}

.template-thumb-tech-project .template-thumb-bar {
    background: #153b3a;
}

.cv-preview {
    width: min(100%, 794px);
    min-height: 1122px;
    margin: 0 auto;
    border: 1px solid #d8e0e4;
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(23, 33, 38, 0.12);
    overflow: hidden;
}

.cv-page-inner {
    display: flex;
    min-height: 1122px;
    flex-direction: column;
    padding: 46px;
}

.cv-preview,
.cv-preview * {
    letter-spacing: 0;
    overflow-wrap: anywhere;
    word-break: normal;
}

.cv-preview-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
    margin-bottom: 24px;
    padding-bottom: 18px;
}

.cv-preview-header.has-photo {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.cv-profile-photo {
    width: 96px;
    height: 96px;
    margin: 0;
    overflow: hidden;
    border: 1px solid #d8e0e4;
    border-radius: 10px;
    background: #f8fafc;
    flex: 0 0 auto;
}

.cv-profile-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center;
}

.cv-identity h2 {
    margin: 0 0 7px;
    color: #121820;
    font-size: 2.08rem;
    line-height: 1.12;
}

.cv-title-line {
    margin: 0 0 5px;
    color: #334155;
    font-size: 1.08rem;
    font-weight: 760;
}

.cv-target-line {
    margin: 0;
    color: #64748b;
}

.cv-template-marker {
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 4px 9px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 760;
    white-space: nowrap;
}

.cv-template-body {
    display: grid;
    gap: 18px;
}

.cv-template-body-columns {
    grid-template-columns: minmax(180px, 0.72fr) minmax(0, 1.6fr);
    align-items: start;
}

.cv-template-body-columns.is-single-column {
    grid-template-columns: 1fr !important;
}

.cv-sidebar-column,
.cv-main-column {
    display: grid;
    gap: 18px;
    align-content: start;
}

.cv-section {
    break-inside: avoid;
    page-break-inside: avoid;
}

.cv-section-title {
    margin: 0 0 9px;
    color: #0f6f68;
    font-size: 1rem;
    line-height: 1.32;
}

.cv-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 14px;
}

.cv-contact-item {
    display: grid;
    gap: 2px;
}

.cv-contact-label {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 760;
}

.cv-contact-value {
    color: #1f2937;
}

.cv-summary-text {
    margin: 0;
    white-space: pre-line;
}

.cv-timeline,
.cv-simple-list {
    display: grid;
    gap: 12px;
}

.cv-item h4 {
    margin: 0 0 4px;
    color: #172126;
    font-size: 1rem;
    line-height: 1.32;
}

.cv-item-meta {
    margin: 0 0 7px;
    color: #64748b;
    font-size: 0.9rem;
}

.cv-bullets {
    display: grid;
    gap: 4px;
    margin: 7px 0 0;
    padding-left: 18px;
}

.cv-simple-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 7px;
}

.cv-simple-row span {
    color: #64748b;
}

.cv-skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.cv-skill {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 4px 9px;
    background: #f8fafc;
    color: #334155;
    font-weight: 720;
}

.cv-template-footer {
    margin-top: auto;
    padding-top: 28px;
    color: #9aa5ad;
    font-size: 0.68rem;
    text-align: center;
}

.cv-template-ats-simple .cv-page-inner {
    padding: 48px 52px;
}

.cv-template-ats-simple .cv-preview-header {
    border-bottom: 2px solid #111827;
}

.cv-template-ats-simple .cv-template-marker {
    display: none;
}

.cv-template-ats-simple .cv-section-title {
    border-bottom: 1px solid #111827;
    padding-bottom: 4px;
    color: #111827;
    font-size: 0.98rem;
}

.cv-template-ats-simple .cv-skill {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
}

.cv-template-ats-simple .cv-skill::after {
    content: ",";
}

.cv-template-ats-simple .cv-skill:last-child::after {
    content: "";
}

.cv-template-ats-compact {
    font-size: 0.9rem;
}

.cv-template-ats-compact .cv-page-inner {
    padding: 34px 42px;
}

.cv-template-ats-compact .cv-preview-header {
    grid-template-columns: 1fr;
    gap: 4px;
    border-bottom: 1px solid #1f2937;
    margin-bottom: 14px;
    padding-bottom: 10px;
}

.cv-template-ats-compact .cv-identity h2 {
    font-size: 1.72rem;
}

.cv-template-ats-compact .cv-template-marker {
    display: none;
}

.cv-template-ats-compact .cv-template-body {
    gap: 12px;
}

.cv-template-ats-compact .cv-section-title {
    margin-bottom: 5px;
    color: #111827;
    font-size: 0.88rem;
}

.cv-template-ats-compact .cv-contact-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.cv-template-ats-compact .cv-bullets {
    gap: 2px;
    margin-top: 4px;
}

.cv-template-ats-compact .cv-template-footer {
    padding-top: 14px;
}

.cv-template-ats-classic .cv-page-inner {
    padding: 44px 54px;
}

.cv-template-ats-classic .cv-preview-header {
    grid-template-columns: 1fr;
    justify-items: center;
    border-top: 3px double #374151;
    border-bottom: 3px double #374151;
    padding: 16px 0;
    text-align: center;
}

.cv-template-ats-classic .cv-template-marker {
    display: none;
}

.cv-template-ats-classic .cv-section-title {
    border-bottom: 1px solid #9ca3af;
    padding-bottom: 5px;
    color: #27313a;
}

.cv-template-ats-classic .cv-simple-row {
    border-bottom-style: dotted;
}

.cv-template-modern-sidebar .cv-page-inner {
    padding: 0;
}

.cv-template-modern-sidebar .cv-preview-header {
    margin: 0;
    padding: 38px 42px 30px;
    background: #123c3a;
    color: #ffffff;
}

.cv-template-modern-sidebar .cv-identity h2,
.cv-template-modern-sidebar .cv-title-line,
.cv-template-modern-sidebar .cv-target-line {
    color: #ffffff;
}

.cv-template-modern-sidebar .cv-template-marker {
    border-color: rgba(255, 255, 255, 0.3);
    color: #d8f1ec;
}

.cv-template-modern-sidebar .cv-profile-photo {
    width: 104px;
    height: 104px;
    border-color: rgba(255, 255, 255, 0.36);
    border-radius: 999px;
}

.cv-template-modern-sidebar .cv-template-body-columns {
    grid-template-columns: 238px minmax(0, 1fr);
    gap: 0;
}

.cv-template-modern-sidebar .cv-sidebar-column {
    min-height: 820px;
    padding: 34px 26px;
    background: #eaf4f2;
}

.cv-template-modern-sidebar .cv-main-column {
    padding: 34px 42px;
}

.cv-template-modern-sidebar .cv-sidebar-column .cv-contact-grid,
.cv-template-modern-sidebar .cv-sidebar-column .cv-simple-row {
    display: grid;
    grid-template-columns: 1fr;
}

.cv-template-modern-sidebar .cv-section-title {
    color: #123c3a;
}

.cv-template-modern-header .cv-page-inner {
    padding: 0;
    background: #f7fafb;
}

.cv-template-modern-header .cv-preview-header {
    margin: 0;
    padding: 44px 46px 38px;
    background: #172126;
}

.cv-template-modern-header .cv-identity h2,
.cv-template-modern-header .cv-title-line,
.cv-template-modern-header .cv-target-line {
    color: #ffffff;
}

.cv-template-modern-header .cv-template-marker {
    border-color: rgba(255, 255, 255, 0.28);
    color: #dbe5ea;
}

.cv-template-modern-header .cv-profile-photo {
    width: 112px;
    height: 112px;
    border-color: rgba(255, 255, 255, 0.32);
    border-radius: 14px;
}

.cv-template-modern-header .cv-template-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 28px 34px 0;
}

.cv-template-modern-header .cv-section {
    border: 1px solid #e1e8eb;
    border-radius: 8px;
    padding: 16px;
    background: #ffffff;
}

.cv-template-modern-header .cv-section--work_experience,
.cv-template-modern-header .cv-section--professional_summary {
    grid-column: 1 / -1;
}

.cv-template-modern-split .cv-page-inner {
    padding: 44px;
}

.cv-template-modern-split .cv-preview-header {
    border-left: 8px solid #0f6f68;
    padding: 0 0 20px 20px;
}

.cv-template-modern-split .cv-profile-photo {
    width: 92px;
    height: 92px;
    border-radius: 999px;
}

.cv-template-modern-split .cv-template-body-columns {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
    gap: 28px;
}

.cv-template-modern-split .cv-sidebar-column {
    border-right: 1px solid #d9e3e6;
    padding-right: 24px;
}

.cv-template-modern-split .cv-section-title {
    color: #172126;
}

.cv-template-modern-split .cv-main-column .cv-section-title {
    color: #0f6f68;
}

.cv-template-minimal-pro .cv-page-inner {
    padding: 58px 58px 42px;
}

.cv-template-minimal-pro .cv-preview-header {
    grid-template-columns: 1fr;
    border-bottom: 1px solid #d1d5db;
    margin-bottom: 34px;
    padding-bottom: 16px;
}

.cv-template-minimal-pro .cv-identity h2 {
    font-size: 2rem;
    font-weight: 650;
}

.cv-template-minimal-pro .cv-template-marker {
    display: none;
}

.cv-template-minimal-pro .cv-template-body {
    gap: 24px;
}

.cv-template-minimal-pro .cv-section-title {
    color: #111827;
    font-size: 0.92rem;
}

.cv-template-minimal-pro .cv-skill {
    border-color: #e5e7eb;
    border-radius: 4px;
    background: transparent;
    color: #111827;
    font-weight: 620;
}

.cv-template-clean-executive .cv-page-inner {
    padding: 50px 56px 42px;
    background: #fdfdfb;
}

.cv-template-clean-executive .cv-preview-header {
    border-bottom: 1px solid #b9b09f;
    padding-bottom: 22px;
}

.cv-template-clean-executive .cv-identity h2 {
    color: #1f2933;
    font-size: 2.18rem;
}

.cv-template-clean-executive .cv-template-marker {
    border-color: #c8bfae;
    color: #726855;
}

.cv-template-clean-executive .cv-template-body {
    counter-reset: executive-section;
    gap: 22px;
}

.cv-template-clean-executive .cv-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2f3b45;
}

.cv-template-clean-executive .cv-section-title::before {
    counter-increment: executive-section;
    content: counter(executive-section, decimal-leading-zero);
    color: #9a8f7c;
    font-size: 0.76rem;
}

.cv-template-creative-marketing .cv-page-inner {
    padding: 0;
    background: #fffdfb;
}

.cv-template-creative-marketing .cv-preview-header {
    position: relative;
    margin: 0 0 26px;
    padding: 46px 46px 34px;
    background: #f7ebe7;
}

.cv-template-creative-marketing .cv-preview-header::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 12px;
    background: #b65d4b;
    content: "";
}

.cv-template-creative-marketing .cv-identity h2 {
    color: #2b2522;
}

.cv-template-creative-marketing .cv-profile-photo {
    width: 106px;
    height: 106px;
    border: 4px solid #fffaf7;
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(136, 67, 50, 0.15);
}

.cv-template-creative-marketing .cv-template-body {
    padding: 0 46px;
}

.cv-template-creative-marketing .cv-section-title {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 10px;
    background: #f7ebe7;
    color: #884332;
}

.cv-template-creative-marketing .cv-skill {
    border-color: #e8c6bd;
    background: #fff8f5;
    color: #884332;
}

.cv-template-tech-project .cv-page-inner {
    padding: 42px;
    background: #f6fbfa;
}

.cv-template-tech-project .cv-preview-header {
    border: 1px solid #b7d9d5;
    border-radius: 8px;
    padding: 24px;
    background: #ffffff;
}

.cv-template-tech-project .cv-identity h2 {
    color: #153b3a;
}

.cv-template-tech-project .cv-template-marker {
    border-color: #b7d9d5;
    color: #153b3a;
}

.cv-template-tech-project .cv-template-body-columns {
    grid-template-columns: minmax(190px, 0.82fr) minmax(0, 1.5fr);
    gap: 18px;
}

.cv-template-tech-project .cv-sidebar-column,
.cv-template-tech-project .cv-main-column .cv-section {
    border: 1px solid #d2e7e4;
    border-radius: 8px;
    padding: 16px;
    background: #ffffff;
}

.cv-template-tech-project .cv-sidebar-column {
    gap: 16px;
}

.cv-template-tech-project .cv-section-title {
    color: #153b3a;
}

.cv-template-tech-project .cv-skill {
    border-radius: 4px;
    border-color: #b7d9d5;
    background: #edf7f5;
    color: #153b3a;
}

.cv-template-customer-friendly .cv-page-inner {
    padding: 42px;
    background: #fffdf9;
}

.cv-template-customer-friendly .cv-preview-header {
    border-radius: 8px;
    padding: 26px;
    background: #eef7ef;
}

.cv-template-customer-friendly .cv-identity h2 {
    color: #294239;
}

.cv-template-customer-friendly .cv-template-marker {
    border-color: #cddfcf;
    color: #47695a;
}

.cv-template-customer-friendly .cv-profile-photo {
    width: 96px;
    height: 96px;
    border-color: #cddfcf;
    border-radius: 999px;
}

.cv-template-customer-friendly .cv-template-body-columns {
    grid-template-columns: 215px minmax(0, 1fr);
    gap: 22px;
}

.cv-template-customer-friendly .cv-sidebar-column {
    border-radius: 8px;
    padding: 18px;
    background: #fff4ef;
}

.cv-template-customer-friendly .cv-main-column .cv-section {
    border-bottom: 1px solid #e4ddd4;
    padding-bottom: 14px;
}

.cv-template-customer-friendly .cv-section-title {
    color: #47695a;
}

.cv-template-customer-friendly .cv-skill {
    border-color: #e8cfc4;
    background: #fff9f5;
    color: #7a4b3d;
}

.cv-template-corporate-blue .cv-page-inner {
    padding: 0;
}

.cv-template-corporate-blue .cv-preview-header {
    margin: 0;
    padding: 40px 46px 32px;
    background: #143d66;
}

.cv-template-corporate-blue .cv-identity h2,
.cv-template-corporate-blue .cv-title-line,
.cv-template-corporate-blue .cv-target-line {
    color: #ffffff;
}

.cv-template-corporate-blue .cv-template-marker {
    border-color: rgba(255, 255, 255, 0.28);
    color: #dce9f6;
}

.cv-template-corporate-blue .cv-profile-photo {
    width: 106px;
    height: 106px;
    border-color: rgba(255, 255, 255, 0.36);
    border-radius: 10px;
}

.cv-template-corporate-blue .cv-template-body-columns {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 0;
}

.cv-template-corporate-blue .cv-sidebar-column {
    min-height: 825px;
    padding: 32px 24px;
    background: #eef5fb;
}

.cv-template-corporate-blue .cv-main-column {
    padding: 32px 44px;
}

.cv-template-corporate-blue .cv-section-title {
    color: #143d66;
}

.cv-template-corporate-blue .cv-main-column .cv-section {
    border-bottom: 1px solid #d5e2ec;
    padding-bottom: 14px;
}

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

    .cv-preview {
        min-height: auto;
    }

    .cv-page-inner,
    .cv-template-ats-simple .cv-page-inner,
    .cv-template-ats-compact .cv-page-inner,
    .cv-template-ats-classic .cv-page-inner,
    .cv-template-modern-split .cv-page-inner,
    .cv-template-minimal-pro .cv-page-inner,
    .cv-template-clean-executive .cv-page-inner,
    .cv-template-tech-project .cv-page-inner,
    .cv-template-customer-friendly .cv-page-inner {
        min-height: 880px;
        padding: 28px;
    }

    .cv-template-modern-sidebar .cv-preview-header,
    .cv-template-modern-header .cv-preview-header,
    .cv-template-creative-marketing .cv-preview-header,
    .cv-template-corporate-blue .cv-preview-header {
        padding: 30px 28px;
    }

    .cv-template-modern-header .cv-template-body,
    .cv-template-creative-marketing .cv-template-body,
    .cv-template-modern-sidebar .cv-main-column,
    .cv-template-corporate-blue .cv-main-column {
        padding: 24px 28px;
    }

    .cv-template-body-columns,
    .cv-template-modern-sidebar .cv-template-body-columns,
    .cv-template-modern-split .cv-template-body-columns,
    .cv-template-tech-project .cv-template-body-columns,
    .cv-template-customer-friendly .cv-template-body-columns,
    .cv-template-corporate-blue .cv-template-body-columns,
    .cv-template-modern-header .cv-template-body {
        grid-template-columns: 1fr;
    }

    .cv-template-modern-sidebar .cv-sidebar-column,
    .cv-template-corporate-blue .cv-sidebar-column {
        min-height: auto;
    }

    .cv-template-modern-split .cv-sidebar-column {
        border-right: 0;
        border-bottom: 1px solid #d9e3e6;
        padding-right: 0;
        padding-bottom: 18px;
    }

    .cv-contact-grid,
    .cv-template-ats-compact .cv-contact-grid {
        grid-template-columns: 1fr;
    }

    .cv-preview-header {
        grid-template-columns: 1fr;
    }

    .cv-preview-header.has-photo {
        grid-template-columns: 1fr;
    }

    .cv-profile-photo {
        width: 88px;
        height: 88px;
    }
}
