/* ===================== Resume builder ===================== */
.rz-back { display: inline-block; font-size: .85rem; color: var(--pm-muted); text-decoration: none; margin-bottom: .35rem; }
.rz-back:hover { color: var(--pm-primary); }
.rz-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.min-w-0 { min-width: 0; }

/* Sections */
.rz-section { margin-bottom: 1rem; border: 1px solid var(--pm-line); border-radius: var(--pm-radius); box-shadow: var(--pm-shadow-sm); }
.rz-h { font-size: 1rem; font-weight: 700; margin-bottom: .9rem; display: flex; align-items: center; gap: .5rem; }
.rz-count { color: var(--pm-muted); font-weight: 500; font-size: .9rem; }
.rz-section .form-label { font-size: .82rem; font-weight: 600; color: var(--pm-ink-2); margin-bottom: .25rem; }
.rz-bullets { font-size: .92rem; line-height: 1.5; }
.rz-jd { background: linear-gradient(180deg, #fbfbff, #fff); }

/* Repeatable items */
.rz-list { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .75rem; }
.rz-list:empty { margin-bottom: 0; }
.rz-item { border: 1px solid var(--pm-line); border-radius: 12px; background: #fff; }
.rz-item[open] { box-shadow: var(--pm-shadow-sm); }
.rz-item-head { display: flex; align-items: center; gap: .5rem; padding: .6rem .7rem; cursor: pointer; list-style: none; min-height: 44px; }
.rz-item-head::-webkit-details-marker { display: none; }
.rz-chevron { width: .55rem; height: .55rem; border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8; transform: rotate(-45deg); transition: transform .15s; flex-shrink: 0; margin-right: .2rem; }
.rz-item[open] .rz-chevron { transform: rotate(45deg); }
.rz-item-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.rz-item-actions { display: flex; gap: .2rem; flex-shrink: 0; }
.rz-icon-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--pm-muted); font-size: .9rem; line-height: 1; }
.rz-icon-btn:hover:not(:disabled) { background: var(--bs-tertiary-bg); color: var(--pm-ink); }
.rz-icon-btn:disabled { opacity: .3; }
.rz-icon-btn.rz-danger:hover { background: #fef2f2; color: #dc2626; }
.rz-item-body { padding: 0 .8rem .85rem; }
.rz-add { border-style: dashed; }

/* Template radios inside the editor */
.rz-templates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-bottom: .5rem; }
.rz-template { position: relative; cursor: pointer; text-align: center; font-size: .8rem; font-weight: 600; color: var(--pm-ink-2); }
.rz-template input { position: absolute; opacity: 0; pointer-events: none; }
.rz-template img { display: block; width: 100%; height: auto; aspect-ratio: 595 / 842; object-fit: cover; object-position: top; border-radius: 8px; border: 2px solid var(--pm-line); background: #fff; margin-bottom: .3rem; transition: border-color .15s, box-shadow .15s; }
.rz-template:hover img { border-color: #c7cbf5; }
.rz-template input:checked + img { border-color: var(--pm-primary); box-shadow: 0 0 0 3px rgba(var(--pm-primary-rgb), .18); }
.rz-template input:focus-visible + img { outline: 2px solid var(--pm-primary); outline-offset: 2px; }
.rz-template input:checked ~ span { color: var(--pm-primary); }

/* Sticky save bar */
.rz-savebar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: .75rem; padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom)); margin-top: .5rem;
    background: linear-gradient(180deg, rgba(247,248,252,0), var(--pm-bg) 35%); }
.rz-danger-zone { padding: .25rem 0 5rem; font-size: .9rem; }
@media (max-width: 1199.98px) { .rz-savebar { padding-right: 9.5rem; } } /* room for the preview button */
@media (max-width: 575.98px) {
    .rz-savebar { padding-right: 0; padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
    .rz-savebar .btn { flex: 1; }
    .rz-savebar > div { width: 100%; }
    .rz-templates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ATS panel */
.ats-card { border-radius: var(--pm-radius); padding: 1rem; background: #fff; border: 1px solid var(--pm-line); box-shadow: var(--pm-shadow-sm); --ats: #16a34a; }
.ats-good { --ats: #2563eb; } .ats-mid { --ats: #d97706; } .ats-low { --ats: #dc2626; }
.ats-top { display: flex; align-items: center; gap: 1rem; }
.ats-ring { --p: 0; flex-shrink: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--ats) calc(var(--p) * 1%), #eef0f6 0); }
.ats-ring > span { width: 60px; height: 60px; border-radius: 50%; background: #fff; display: grid; place-items: center; align-content: center; line-height: 1; }
.ats-ring b { font-size: 1.35rem; font-weight: 800; color: var(--pm-ink); }
.ats-ring small { font-size: .62rem; color: var(--pm-muted); margin-top: 2px; }
.ats-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--pm-muted); margin-bottom: .15rem; }
.ats-label strong { color: var(--ats); }
.ats-summary p { font-size: .92rem; color: var(--pm-ink-2); }
.ats-kw-line { font-size: .85rem; margin-top: .2rem; color: var(--pm-ink-2); }
.ats-fix { list-style: none; margin: .85rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.ats-fix li { display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem; line-height: 1.4; padding: .5rem .6rem; border-radius: 10px; background: var(--bs-tertiary-bg); }
.ats-fix li strong { display: block; color: var(--pm-ink); font-weight: 600; }
.ats-fix li span:not(.ats-pts) { color: var(--pm-ink-2); }
.ats-pts { flex-shrink: 0; min-width: 2.4rem; text-align: center; font-weight: 700; font-size: .78rem; padding: .15rem .35rem; border-radius: 999px; background: #fff; color: var(--ats); border: 1px solid currentColor; }
.ats-more { margin-top: .6rem; font-size: .88rem; }
.ats-more > summary { cursor: pointer; color: var(--pm-muted); font-weight: 500; }
.ats-passed { list-style: none; padding: 0; margin: .5rem 0 0; columns: 2; column-gap: 1rem; color: #15803d; font-size: .84rem; }
.ats-passed li { break-inside: avoid; margin-bottom: .2rem; }
@media (max-width: 575.98px) { .ats-passed { columns: 1; } }
.ats-keywords { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .75rem; }
.kw { font-size: .78rem; padding: .2rem .55rem; border-radius: 999px; font-weight: 500; }
.kw-yes { background: #ecfdf5; color: #047857; }
.kw-no { background: #fff1f2; color: #be123c; border: 1px dashed #fda4af; }

/* List page */
.rz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 1rem; }
.rz-card { overflow: hidden; border: 1px solid var(--pm-line); border-radius: var(--pm-radius); box-shadow: var(--pm-shadow-sm); transition: box-shadow .2s, transform .2s var(--pm-ease); }
.rz-card:hover { box-shadow: var(--pm-shadow); }
.rz-card-thumb { position: relative; display: block; background: #eef0f6; padding: 14px 14px 0; height: 210px; overflow: hidden; }
.rz-card-thumb img { width: 100%; height: auto; display: block; border-radius: 4px 4px 0 0; box-shadow: 0 4px 16px rgba(15,23,42,.12); }
.rz-score { position: absolute; right: 10px; top: 10px; font-weight: 800; font-size: .95rem; padding: .25rem .55rem; border-radius: 999px; background: #fff; color: var(--ats, #16a34a); box-shadow: var(--pm-shadow-sm); --ats: #16a34a; }
.rz-score.ats-good { --ats: #2563eb; } .rz-score.ats-mid { --ats: #d97706; } .rz-score.ats-low { --ats: #dc2626; }
.rz-score small { font-size: .65rem; font-weight: 600; color: var(--pm-muted); }
.rz-card-new { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; min-height: 300px; border: 2px dashed #cfd4e6; background: transparent; box-shadow: none; color: var(--pm-muted); font-weight: 600; text-decoration: none; }
.rz-card-new span { font-size: 2rem; line-height: 1; color: var(--pm-primary); }
.rz-card-new:hover { border-color: var(--pm-primary); color: var(--pm-primary); }
.rz-empty .card-body { padding: 2.5rem 1.25rem; }
.rz-empty-art { display: flex; justify-content: center; gap: .75rem; }
.rz-empty-art img { width: 130px; height: auto; border-radius: 6px; box-shadow: var(--pm-shadow); }
.rz-empty-art img:last-child { transform: rotate(4deg) translateY(8px); }
.rz-empty-art img:first-child { transform: rotate(-4deg); }

/* Template picker (new resume) */
.rz-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 1rem; }
.rz-pick-card { position: relative; display: flex; flex-direction: column; cursor: pointer; border: 2px solid var(--pm-line); border-radius: var(--pm-radius); background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .2s var(--pm-ease); }
.rz-pick-card:hover { transform: translateY(-2px); box-shadow: var(--pm-shadow); }
.rz-pick-card input { position: absolute; opacity: 0; pointer-events: none; }
.rz-pick-card:has(input:checked) { border-color: var(--pm-primary); box-shadow: 0 0 0 4px rgba(var(--pm-primary-rgb), .15); }
.rz-pick-card:has(input:focus-visible) { outline: 2px solid var(--pm-primary); outline-offset: 3px; }
.rz-pick-img { display: block; background: #eef0f6; padding: 14px 14px 0; height: 260px; overflow: hidden; }
.rz-pick-img img { width: 100%; height: auto; display: block; box-shadow: 0 4px 16px rgba(15,23,42,.12); }
.rz-pick-body { padding: .8rem 1rem 1rem; display: flex; flex-direction: column; gap: .2rem; }
.rz-pick-body span { font-size: .86rem; color: var(--pm-muted); line-height: 1.45; }
.rz-pick-card:has(input:checked) .rz-pick-body strong::after { content: "  ✓ Selected"; color: var(--pm-primary); font-size: .8rem; }
.studio-editor .rz-card h2.h6 { font-size: 1rem; letter-spacing: -.01em; font-weight: 700; color: var(--pm-ink) !important; }
