/* The document editors (assets/yfj-docs.js): "Your CVs" (#cvs) and "Cover letters"
   (#letters) on the account page. `.cvs` is the CV sheet; `.cvs.ltr` the letter, which
   shares the CV's header so the two print as one application. */
/* The CV editor. The CV itself is content only (getJobsJSON cvs.js cleanDoc); the layout
   below is fixed: Vincent's own one-page CV layout (Quick Apply, 2026), with the extra
   spacing he asked for on 2026-09-27. Two copies of the CV are painted from the same
   content: .d-sheet, which is edited in place, and #print, the clean one that is measured
   for the one-page check and is the only thing printed. */
/* Same frame as the account page: "Account." header, the side menu, one section card. */
.cvl-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 12px; }
.cvl-top .sp { flex: 1; }
.cvl { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cvr { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.cvr:first-child { border-top: 0; }
.cvr .t { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 3px; color: inherit; }
.cvr .t b { font-weight: 600; font-size: 16px; }
.cvr .t:hover b { text-decoration: underline; }
.cvr .t .m { font-size: 13px; color: var(--slate); display: flex; gap: 6px; flex-wrap: wrap; }
.cvr .a { display: flex; gap: 6px; }
.btn.ghost.danger { color: var(--danger, #b42318); border-color: #f0c9c5; }

.cv-bar { position: sticky; top: var(--header-h, 64px); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 0; background: var(--bg, #fff); border-bottom: 1px solid var(--line); }
.cv-bar select, .cv-bar .input { height: 38px; font-size: 14.5px; }
.cv-bar select { max-width: 240px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: #fff; }
.cv-bar .ttl { width: 230px; max-width: 100%; }
.cv-bar .sp { flex: 1; }
.cv-state { font-size: 13px; color: var(--slate); min-width: 64px; }
.cv-state.err { color: #b42318; }
.fit { font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--tint); color: var(--forest); white-space: nowrap; }
.fit.over { background: #fdecea; color: #b42318; }
.cv-hint { font-size: 13px; color: var(--slate); margin: 10px 0 0; }
.cv-hint mark { background: #fff1b8; padding: 0 3px; border-radius: 3px; }

.desk { background: var(--mist); border-radius: 18px; padding: 24px 16px 32px; margin: 14px 0 0; }
.fitwrap { width: 210mm; margin: 0 auto; }
/* Phones: the sheet wraps at the screen's width instead of shrinking to a third of it.
   The PDF and the one-page check come from #print, which keeps the A4 width. */
.fitwrap.fluid { width: auto; }
.fitwrap.fluid .cvs { width: auto; min-height: 0; padding: 18px 12px 22px 40px; }
@media (max-width: 640px) { .desk { padding: 12px 6px 24px; border-radius: 16px; } .cv-bar { position: static; } }

.empty-cv { max-width: 640px; margin: 24px auto 8px; text-align: center; }
.empty-cv h3 { font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.empty-cv p { color: var(--slate); }
/* A centred row, not a two-column grid: while the assistant is off (CHAT_OPEN) only
   "Start from the layout" is shown, and one card alone belongs in the middle. */
.empty-cv .opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 22px; text-align: left; }
.empty-cv .opts > .opt { flex: 0 1 calc(50% - 7px); }
.empty-cv .opt { border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.empty-cv .opt b { font-size: 16px; }
.empty-cv .opt span { color: var(--slate); font-size: 14px; flex: 1; }
@media (max-width: 640px) { .empty-cv .opts > .opt { flex-basis: 100%; } .cv-bar .ttl { width: 100%; } }

/* ---------------------------------------------------------------- the sheet */
.cvs { width: 210mm; min-height: 297mm; box-sizing: border-box; overflow-wrap: anywhere; padding: 9mm 12mm 7mm; background: #fff; box-shadow: 0 10px 40px rgba(11,11,12,.10); position: relative;
  font-family: "Helvetica Neue", Arial, sans-serif; color: #111; font-size: 8.4pt; line-height: 1.25; }
.cvs a { color: #1a4fb0; text-decoration: none; }
.cvs .name { text-align: center; font-size: 17pt; font-weight: 600; margin: 0 0 3px; letter-spacing: .3px; font-family: inherit; line-height: 1.2; }
.cvs .contact { text-align: center; font-size: 9.8pt; color: #444; margin: 0 0 14px; }
.cvs .contact .csep { color: #888; }
.cvs h2 { font-size: 9.8pt; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; margin: 11px 0 3px; border-bottom: 1px solid #111; padding-bottom: 2px; font-family: inherit; line-height: 1.25; }
.cvs .crow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 7px; }
.cvs .crow .cl { font-weight: 700; }
.cvs .crow .cr, .cvs .csub .cr { font-size: 9.8pt; text-align: right; }
.cvs .csub { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 2px; font-style: italic; font-size: 9.8pt; }
.cvs ul { margin: 4px 0 5px; padding-left: 17px; }
.cvs li { margin: 2px 0; }
.cvs .label { font-weight: 700; }
.cvs .cpara { font-size: 9.6pt; margin: 5px 0; }
.cvs .profile { margin: 4px 0 0; font-size: 9.6pt; }
.cvs .lines { font-size: 9.6pt; margin-top: 4px; }

/* editing affordances: only on .d-sheet, never on the print copy */
.d-sheet [data-f] { outline: none; border-radius: 3px; min-width: 1ch; }
.d-sheet [data-f]:hover { background: rgba(13,145,99,.06); }
.d-sheet [data-f]:focus { background: rgba(13,145,99,.10); box-shadow: 0 0 0 2px rgba(13,145,99,.35); }
.d-sheet [data-f]:empty::before { content: attr(data-ph); color: #a3a8b0; font-style: italic; }
.d-sheet .ph { background: #fff1b8; border-radius: 2px; }
.d-sheet .blk { position: relative; }
/* The part being edited: an outline, which never moves anything. */
.d-sheet .sel { outline: 2px solid rgba(13,145,99,.45); outline-offset: 3px; border-radius: 4px; }
.d-sheet section.sel-s { outline: 1px dashed rgba(13,145,99,.4); outline-offset: 6px; border-radius: 6px; }
.d-sheet .adds { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.d-sheet .adds button { font: 600 12px/1 system-ui, sans-serif; color: var(--forest); background: #fff; border: 1px dashed #9fd8c1; border-radius: 999px; padding: 5px 10px; }
.d-sheet .adds button:hover { background: var(--tint); }

/* The toolbar for the part being edited: fixed in place above the page, so nothing
   appears under the pointer (Vincent, 2026-09-27: hover controls were too jumpy). */
.ctx { position: sticky; top: var(--header-h, 64px); z-index: 19; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; min-height: 48px; box-sizing: border-box; padding: 8px 12px; margin: 12px 0 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 16px rgba(11,11,12,.05); }
.ctx .cg { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ctx .cg + .cg { padding-left: 14px; border-left: 1px solid var(--line); }
.ctx .cn { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--slate); margin-right: 4px; }
.ctx .cn0 { font-size: 13.5px; color: var(--slate); }
.ctx .cb { height: 30px; min-width: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; color: var(--ink); }
.ctx .cb:hover:not(:disabled) { background: var(--mist); }
.ctx .cb:disabled { opacity: .35; cursor: default; }
.ctx .cb.danger { color: #b42318; }
.d-print { position: absolute; left: -10000px; top: 0; padding: 0; min-height: 0; box-shadow: none; }


/* ---- the cover letter: the CV's header, then a plain business letter at reading size ---- */
.cvs.ltr { font-size: 10.5pt; line-height: 1.45; padding: 16mm 20mm 14mm; }
.fitwrap.fluid .cvs.ltr { padding: 18px 12px 22px 40px; }
.ltr .contact { border-bottom: 1px solid #111; padding-bottom: 8px; margin-bottom: 0; }
.ltr .lt-date { margin: 22px 0 14px; }
.ltr .lt-to { margin: 0 0 18px; }
.ltr .lt-subj { font-weight: 700; margin: 0 0 14px; }
.ltr .lt-greet { margin: 0 0 12px; }
.ltr .lt-p { margin: 0 0 11px; }
.ltr .lt-close { margin: 18px 0 30px; }
.ltr .lt-sign { margin: 0; }
.ltr.d-sheet .blk + .blk { margin-top: 0; }
