/* CV Builder. The editor uses Public Tools' --pt-* variables (so it follows light and dark mode);
   the paper is a document preview and is always printed black on white, in the visitor's chosen accent. */

/* ============ Editor ============ */
.cvb { --cvb-r: var(--pt-radius, .75rem); --cvb-surface: var(--color-surface, #fff); display: grid; gap: 1rem; margin: 0 0 2.5rem; }
.cvb [hidden] { display: none !important; }
.cvb-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; }
.cvb-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.cvb-actions .pt-btn { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.5rem; }
.cvb .pt-btn > svg, .cvb-ico { display: block; width: 1rem; height: 1rem; flex: none; }
.cvb-status { margin: 0; font-size: .85rem; color: var(--pt-muted); }
.cvb-status.is-warn { color: var(--pt-error, #b91c1c); font-weight: 600; }
.cvb-more { position: relative; }
.cvb-more > summary { list-style: none; cursor: pointer; }
.cvb-more > summary::-webkit-details-marker { display: none; }
.cvb-menu { position: absolute; z-index: 20; top: calc(100% + .35rem); left: 0; min-width: 15rem; display: grid; gap: .15rem; padding: .4rem; border: 1px solid var(--pt-line); border-radius: var(--cvb-r); background: var(--cvb-surface); box-shadow: 0 10px 30px rgb(0 0 0 / .14); }
.cvb-menu .pt-btn { justify-content: flex-start; width: 100%; }
.cvb .is-confirm { color: var(--pt-error, #b91c1c) !important; }
.cvb-view { display: none; justify-self: start; }

.cvb-panes { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 62rem) { .cvb-panes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .cvb-preview { position: sticky; top: 5rem; } }
@media (max-width: 61.99rem) {
  .cvb-view { display: inline-flex; }
  .cvb[data-view="preview"] .cvb-edit, .cvb:not([data-view="preview"]) .cvb-preview { display: none; }
}
.cvb-edit, .cvb-sections { display: grid; gap: .75rem; min-width: 0; }

/* Design panel */
.cvb-design { display: grid; gap: .9rem; padding: 1rem 1.1rem; border: 1px solid var(--pt-line); border-radius: var(--cvb-r); background: var(--cvb-surface); }
.cvb-design__title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--pt-ink); }
.cvb-label { margin: 0 0 .4rem; font-size: .875rem; font-weight: 600; color: var(--pt-ink); }
.cvb-templates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; border: 0; padding: 0; margin: 0; min-width: 0; }
@media (max-width: 30rem) { .cvb-templates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cvb-tpl { position: relative; display: grid; gap: .35rem; padding: .5rem; border: 1px solid var(--pt-line); border-radius: .6rem; cursor: pointer; background: var(--cvb-surface); text-align: center; font-size: .8rem; font-weight: 600; color: var(--pt-text); }
.cvb-tpl input { position: absolute; opacity: 0; pointer-events: none; }
.cvb-tpl:has(input:checked) { border-color: var(--pt-accent); box-shadow: 0 0 0 2px var(--pt-accent); color: var(--pt-ink); }
.cvb-tpl:has(input:focus-visible) { outline: 2px solid var(--pt-accent); outline-offset: 2px; }
.cvb-tpl__pic { display: block; aspect-ratio: 210 / 150; border-radius: .3rem; background: var(--pt-soft, #f1f5f9); position: relative; overflow: hidden; }
.cvb-tpl__pic::before, .cvb-tpl__pic::after { content: ""; position: absolute; background: var(--pt-muted); opacity: .45; border-radius: 2px; }
.cvb-tpl__pic--classic::before { left: 30%; right: 30%; top: 12%; height: 9%; }
.cvb-tpl__pic--classic::after { left: 12%; right: 12%; top: 32%; height: 52%; opacity: .18; }
.cvb-tpl__pic--modern::before { left: 8%; width: 26%; top: 12%; bottom: 12%; background: var(--pt-accent); opacity: .35; }
.cvb-tpl__pic--modern::after { left: 40%; right: 8%; top: 12%; bottom: 12%; opacity: .18; }
.cvb-tpl__pic--minimal::before { left: 10%; width: 40%; top: 12%; height: 9%; }
.cvb-tpl__pic--minimal::after { left: 10%; right: 25%; top: 34%; height: 46%; opacity: .14; }
.cvb-tpl__pic--compact::before { left: 0; right: 0; top: 0; height: 22%; background: var(--pt-accent); opacity: .35; border-radius: 0; }
.cvb-tpl__pic--compact::after { left: 8%; right: 8%; top: 30%; height: 60%; opacity: .2; }
.cvb-swatches { display: flex; flex-wrap: wrap; gap: .45rem; border: 0; padding: 0; margin: 0; }
.cvb-swatch { position: relative; width: 2.25rem; height: 2.25rem; border-radius: 999px; cursor: pointer; display: grid; place-items: center; }
.cvb-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.cvb-swatch span { width: 1.6rem; height: 1.6rem; border-radius: 999px; background: var(--sw); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.cvb-swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--pt-ink); }
.cvb-swatch:has(input:focus-visible) { outline: 2px solid var(--pt-accent); outline-offset: 2px; }
.cvb-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.cvb .pt-input, .cvb .pt-select, .cvb .pt-textarea { width: 100%; max-width: 100%; box-sizing: border-box; min-height: 2.75rem; }
.cvb .pt-textarea { min-height: 5.5rem; resize: vertical; line-height: 1.45; }
.cvb .pt-field { margin: 0; min-width: 0; }
.cvb .pt-input:disabled { opacity: .55; }

/* Sections */
.cvb-sec { border: 1px solid var(--pt-line); border-radius: var(--cvb-r); background: var(--cvb-surface); }
.cvb-sec__head { display: flex; align-items: center; gap: .6rem; padding: .85rem 1.1rem; min-height: 3rem; cursor: pointer; font-weight: 700; color: var(--pt-ink); list-style: none; }
.cvb-sec__head::-webkit-details-marker { display: none; }
.cvb-sec__head::after { content: ""; margin-left: auto; width: .55rem; height: .55rem; border-right: 2px solid var(--pt-muted); border-bottom: 2px solid var(--pt-muted); transform: rotate(45deg); transition: transform .15s; }
.cvb-sec[open] > .cvb-sec__head::after { transform: rotate(225deg); }
.cvb-sec__head:focus-visible { outline: 2px solid var(--pt-accent); outline-offset: -2px; border-radius: var(--cvb-r); }
.cvb-sec__count:not(:empty) { min-width: 1.4rem; padding: 0 .4rem; border-radius: 999px; background: var(--pt-soft, #f1f5f9); color: var(--pt-text); font-size: .75rem; font-weight: 600; text-align: center; line-height: 1.4rem; }
.cvb-sec__body { display: grid; gap: .9rem; padding: 0 1.1rem 1.1rem; }
.cvb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.cvb-grid > .cvb-wide { grid-column: 1 / -1; }
@media (max-width: 35rem) { .cvb-grid { grid-template-columns: minmax(0, 1fr); } }
.cvb-list { display: grid; gap: .75rem; }
.cvb-item { display: grid; gap: .75rem; padding: .85rem; border: 1px solid var(--pt-line); border-radius: calc(var(--cvb-r) - .2rem); background: var(--pt-soft, #f8fafc); }
.cvb-item__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.cvb-item__title { margin: 0; font-size: .95rem; font-weight: 700; color: var(--pt-ink); overflow-wrap: anywhere; }
.cvb-item__tools { display: inline-flex; gap: .15rem; flex: none; }
.cvb-ibtn { width: 2.5rem; height: 2.5rem; padding: 0 !important; justify-content: center; display: inline-flex; align-items: center; }
.cvb-add { justify-self: start; display: inline-flex; align-items: center; gap: .4rem; min-height: 2.5rem; }
.cvb-order { margin: 0; padding: 0; list-style: none; display: grid; gap: .35rem; counter-reset: o; }
.cvb-order__item { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .3rem .3rem .3rem .8rem; border: 1px solid var(--pt-line); border-radius: .55rem; color: var(--pt-text); font-weight: 600; font-size: .9rem; }
.cvb-photo { display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; }
.cvb-photo__img { width: 4.5rem; height: 4.5rem; border-radius: 999px; object-fit: cover; }
.cvb-photo__tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; flex: 1 1 14rem; }
.cvb-photo__tools .pt-help { flex-basis: 100%; margin: 0; }
.cvb-photo__tools label.pt-btn { cursor: pointer; }
.cvb-photo__tools:has(input:focus-visible) label.pt-btn { outline: 2px solid var(--pt-accent); outline-offset: 2px; }
.cvb-words { margin: .35rem 0 0; font-size: .85rem; color: var(--pt-muted); }
.cvb-words.is-warn { color: var(--pt-warn, #a16207); font-weight: 600; }
.cvb-inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Preview */
.cvb-preview { display: grid; gap: .6rem; min-width: 0; }
.cvb-preview__head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.cvb-preview__title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--pt-ink); }
.cvb-pages { margin: 0; font-size: .85rem; color: var(--pt-muted); }
.cvb-stage { position: relative; overflow: hidden; border-radius: .4rem; box-shadow: 0 1px 3px rgb(0 0 0 / .12), 0 8px 24px rgb(0 0 0 / .1); background: #fff; }
.cvb-sheet { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.cvb-break { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed rgb(14 116 144 / .55); pointer-events: none; }
.cvb-break::after { content: attr(data-label); position: absolute; right: 6px; top: 2px; font: 600 11px/1.2 system-ui, sans-serif; color: rgb(14 116 144); background: #fff; padding: 1px 4px; border-radius: 3px; }
.cvb-print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; visibility: hidden; }
.cvb-note { margin: 0; font-size: .85rem; color: var(--pt-muted); }

/* CV Checker */
.cvc { display: grid; gap: 1rem; margin: 0 0 2.5rem; }
.cvc .pt-textarea { width: 100%; box-sizing: border-box; min-height: 14rem; line-height: 1.45; }
.cvc-job .pt-textarea { min-height: 8rem; }
.cvc-out { display: grid; gap: 1rem; }
.cvc-score { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border: 1px solid var(--pt-line); border-radius: var(--pt-radius, .75rem); background: var(--color-surface, #fff); }
.cvc-score__ring { --c: var(--pt-ok, #15803d); flex: none; width: 5.25rem; height: 5.25rem; border-radius: 999px; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--color-surface, #fff) 78%, transparent 80%), conic-gradient(var(--c) calc(var(--p, 0) * 1%), var(--pt-line) 0); }
.cvc-score--warn .cvc-score__ring { --c: var(--pt-warn, #ca8a04); }
.cvc-score--bad .cvc-score__ring { --c: var(--pt-error, #b91c1c); }
.cvc-score__num { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--pt-ink); }
.cvc-score__of { font-size: .75rem; color: var(--pt-muted); }
.cvc-score__title { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--pt-ink); }
.cvc-score__sub { margin: .2rem 0 0; color: var(--pt-muted); font-size: .9rem; }
.cvc-list { margin: 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.cvc-item { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem .9rem; border: 1px solid var(--pt-line); border-radius: .65rem; background: var(--color-surface, #fff); }
.cvc-badge { flex: none; min-width: 4.2rem; padding: .15rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 700; text-align: center; background: var(--pt-soft, #f1f5f9); color: var(--pt-text); }
.cvc-item--ok .cvc-badge { background: var(--pt-ok-soft, #dcfce7); color: var(--pt-ok, #15803d); }
.cvc-item--warn .cvc-badge { background: var(--pt-warn-soft, #fef9c3); color: var(--pt-warn, #a16207); }
.cvc-item--bad .cvc-badge { background: var(--pt-error-soft, #fee2e2); color: var(--pt-error, #b91c1c); }
.cvc-item__title { margin: 0; font-weight: 700; color: var(--pt-ink); }
.cvc-item__text { margin: .2rem 0 0; color: var(--pt-text); font-size: .925rem; }
.cvc-ex { margin: .4rem 0 0; padding-left: 1.1rem; color: var(--pt-muted); font-size: .875rem; }
.cvc-match { display: grid; gap: .6rem; padding: 1rem 1.1rem; border: 1px solid var(--pt-line); border-radius: var(--pt-radius, .75rem); background: var(--color-surface, #fff); }
.cvc-match__title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--pt-ink); }
.cvc-match__label { margin: 0 0 .3rem; font-size: .8rem; font-weight: 600; color: var(--pt-muted); }
.cvc-tags { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; }
.cvc-tags li { padding: .2rem .55rem; border-radius: 999px; border: 1px dashed var(--pt-line-strong, var(--pt-line)); font-size: .85rem; color: var(--pt-text); }
.cvc-tags--ok li { border-style: solid; border-color: transparent; background: var(--pt-ok-soft, #dcfce7); color: var(--pt-ok, #15803d); }
.cvc-empty { margin: 0; padding: .75rem .9rem; border: 1px dashed var(--pt-line); border-radius: .6rem; color: var(--pt-text); }
.cvc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; }

/* ============ Paper ============ */
.cvp { --cvp-accent: #0369a1; --cvp-ink: #111827; --cvp-text: #1f2937; --cvp-muted: #4b5563; --cvp-line: #d1d5db;
  box-sizing: border-box; width: 210mm; min-height: 297mm; padding: 14mm 16mm; background: #fff; color: var(--cvp-text);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 10pt; line-height: 1.45; text-align: left;
  -webkit-print-color-adjust: exact; print-color-adjust: exact; overflow-wrap: anywhere; }
.cvp *, .cvp *::before, .cvp *::after { box-sizing: border-box; }
.cvp--paper-letter { width: 215.9mm; min-height: 279.4mm; }
.cvp--font-serif { font-family: Georgia, Cambria, "Times New Roman", Times, serif; }
.cvp--font-humanist { font-family: "Segoe UI", Calibri, Candara, "Trebuchet MS", "Helvetica Neue", sans-serif; }
.cvp h1, .cvp h2, .cvp h3, .cvp p, .cvp ul { margin: 0; padding: 0; font: inherit; color: inherit; letter-spacing: normal; text-transform: none; border: 0; }
.cvp ul { list-style: none; }
.cvp-head { display: flex; align-items: center; gap: 6mm; margin-bottom: 6mm; }
.cvp-id { flex: 1; min-width: 0; }
.cvp-photo { width: 26mm; height: 26mm; border-radius: 999px; object-fit: cover; flex: none; }
.cvp-name { font-size: 22pt !important; font-weight: 700 !important; line-height: 1.1 !important; color: var(--cvp-ink) !important; }
.cvp-title { margin-top: 1.5mm !important; font-size: 12pt !important; color: var(--cvp-accent) !important; font-weight: 600 !important; }
.cvp-contact { margin-top: 2.5mm !important; display: flex; flex-wrap: wrap; gap: 1mm 0; font-size: 9pt; color: var(--cvp-muted) !important; }
.cvp-contact .cvp-c + .cvp-c::before { content: "·"; margin: 0 2.2mm; color: var(--cvp-line); }
.cvp-sec { margin-top: 5mm; }
.cvp-h { font-size: 10pt !important; font-weight: 700 !important; text-transform: uppercase !important; letter-spacing: .12em !important; color: var(--cvp-accent) !important;
  padding-bottom: 1.2mm !important; border-bottom: .3mm solid var(--cvp-line) !important; margin-bottom: 2.5mm !important; break-after: avoid; page-break-after: avoid; }
.cvp-item { break-inside: avoid; page-break-inside: avoid; }
.cvp-item + .cvp-item { margin-top: 3.5mm; }
.cvp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 4mm; }
.cvp-item-title { font-weight: 700 !important; color: var(--cvp-ink) !important; font-size: 10.5pt !important; }
.cvp-dates { flex: none; font-size: 9pt; color: var(--cvp-muted); white-space: nowrap; }
.cvp-sub { color: var(--cvp-muted) !important; font-size: 9.5pt !important; margin-top: .4mm !important; }
.cvp-bullets { margin-top: 1.5mm !important; }
.cvp-bullets li { position: relative; padding-left: 4mm; margin-top: .8mm; }
.cvp-bullets li::before { content: ""; position: absolute; left: .6mm; top: .62em; width: 1.3mm; height: 1.3mm; border-radius: 999px; background: var(--cvp-accent); }
.cvp-p + .cvp-p { margin-top: 2mm !important; }
.cvp-tags { display: flex; flex-wrap: wrap; gap: 1.5mm; }
.cvp-tags li { padding: .6mm 2.4mm; border-radius: 999px; border: .3mm solid var(--cvp-line); font-size: 9pt; }
.cvp-list li + li { margin-top: 1mm; }
.cvp-list strong { color: var(--cvp-ink); }
.cvp-muted { color: var(--cvp-muted); }
.cvp-refs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3mm 6mm; }
.cvp-ref { display: grid; font-size: 9.5pt; }
.cvp-ref strong { color: var(--cvp-ink); }

/* Classic: centred heading */
.cvp--classic .cvp-head { flex-direction: row; text-align: center; border-bottom: .5mm solid var(--cvp-accent); padding-bottom: 5mm; }
.cvp--classic .cvp-contact { justify-content: center; }
.cvp--classic .cvp-photo + .cvp-id { text-align: left; }
.cvp--classic .cvp-photo + .cvp-id .cvp-contact { justify-content: flex-start; }
.cvp--classic .cvp-h { border-bottom: 0 !important; padding-bottom: 0 !important; display: flex; align-items: center; gap: 3mm; }
.cvp--classic .cvp-h::after { content: ""; flex: 1; height: .3mm; background: var(--cvp-line); }

/* Modern: side column */
.cvp--modern .cvp-head { padding-bottom: 5mm; border-bottom: .3mm solid var(--cvp-line); }
.cvp--modern .cvp-name { font-size: 24pt !important; }
.cvp-cols { display: grid; grid-template-columns: 52mm minmax(0, 1fr); gap: 8mm; }
.cvp--modern .cvp-aside { font-size: 9.5pt; }
.cvp--modern .cvp-aside .cvp-sec:first-child, .cvp--modern .cvp-main .cvp-sec:first-child { margin-top: 0; }
.cvp--modern .cvp-aside .cvp-h { border-bottom: 0 !important; padding-bottom: 0 !important; }
.cvp--modern .cvp-main { border-left: .3mm solid var(--cvp-line); padding-left: 8mm; }
.cvp--modern .cvp-tags { display: block; }
.cvp--modern .cvp-tags li { border: 0; padding: 0; border-radius: 0; font-size: 9.5pt; }
.cvp--modern .cvp-tags li + li { margin-top: 1mm; }
.cvp-contact-list li { overflow-wrap: anywhere; }
.cvp--modern .cvp-refs { grid-template-columns: minmax(0, 1fr); }

/* Minimal: quiet headings, generous space */
.cvp--minimal { padding: 18mm 20mm; }
.cvp--minimal .cvp-name { font-weight: 400 !important; font-size: 26pt !important; letter-spacing: -.01em; }
.cvp--minimal .cvp-title { color: var(--cvp-muted) !important; font-weight: 400 !important; }
.cvp--minimal .cvp-h { border-bottom: 0 !important; color: var(--cvp-ink) !important; letter-spacing: .12em !important; font-size: 8.5pt !important; overflow-wrap: normal; word-break: normal; hyphens: none; }
.cvp--minimal .cvp-sec { display: grid; grid-template-columns: 38mm minmax(0, 1fr); gap: 0 4mm; margin-top: 7mm; }
.cvp--minimal .cvp-sec > .cvp-h { grid-row: 1 / span 20; margin: .5mm 0 0 !important; }
.cvp--minimal .cvp-sec > :not(.cvp-h) { grid-column: 2; }
.cvp--minimal .cvp-bullets li::before { background: var(--cvp-muted); }
.cvp--minimal .cvp-item-title { color: var(--cvp-accent) !important; }

/* Compact: dense, single column, coloured band (good for screening software) */
.cvp--compact { font-size: 9.5pt; line-height: 1.38; padding-top: 0; }
.cvp--compact .cvp-head { margin: 0 -16mm 5mm; padding: 9mm 16mm 7mm; background: var(--cvp-accent); color: #fff; }
.cvp--compact .cvp-name, .cvp--compact .cvp-title { color: #fff !important; }
.cvp--compact .cvp-contact { color: rgb(255 255 255 / .9) !important; }
.cvp--compact .cvp-contact .cvp-c + .cvp-c::before { color: rgb(255 255 255 / .6); }
.cvp--compact .cvp-sec { margin-top: 3.5mm; }
.cvp--compact .cvp-h { border-bottom: 0 !important; padding: 0 0 0 2.5mm !important; border-left: 1mm solid var(--cvp-accent) !important; margin-bottom: 2mm !important; color: var(--cvp-ink) !important; }
.cvp--compact .cvp-item + .cvp-item { margin-top: 2.5mm; }

/* Cover letter */
.cvp--letter .cvp-head { margin-bottom: 9mm; }
.cvp--letter.cvp--classic .cvp-head { justify-content: center; }
.cvl-meta { display: grid; gap: 5mm; margin-bottom: 7mm; }
.cvl-to { display: grid; }
.cvl-subject { font-weight: 700 !important; color: var(--cvp-ink) !important; margin-bottom: 5mm !important; }
.cvl-p { margin-bottom: 4mm !important; text-align: left; }
.cvl-close { margin-top: 6mm !important; }
.cvl-sign { margin-top: 12mm !important; font-weight: 700 !important; color: var(--cvp-ink) !important; }
.cvp--minimal.cvp--letter .cvp-sec { display: block; }

/* Printing (inside the print frame) */
.cvp-print .cvp { width: auto !important; min-height: 0 !important; padding: 0 16mm !important; box-shadow: none !important; }
.cvp-print .cvp--minimal { padding: 0 20mm !important; }
@media print { .cvp-print .cvp { overflow: visible; } }
