/* ===== CV / cover-letter sheet (A4) ===== */
.sheet{--acc:#0f6e56;--acc-soft:#e6f2ee;--ink:#1d1a16;--muted:#5f5850;--rule:#e2dccf;
  position:relative;width:210mm;min-height:297mm;background:#fff;color:var(--ink);
  box-shadow:0 2px 6px rgba(0,0,0,.08),0 18px 40px rgba(0,0,0,.12);
  font-family:'Cairo','Noto Naskh Arabic',Tahoma,sans-serif;font-size:10pt;line-height:1.6;
  padding:12mm 15mm 14mm;transform-origin:top center;overflow-wrap:anywhere}
.sheet *{box-sizing:border-box}
.sheet[lang=en]{line-height:1.45}
.sheet bdi{unicode-bidi:isolate}
.sheet .ltr{direction:ltr;unicode-bidi:isolate}
.sheet h1,.sheet h2,.sheet h3,.sheet p{margin:0}
.cv-head{display:flex;gap:14px;align-items:center;margin-bottom:6mm}
.cv-photo{width:30mm;height:30mm;border-radius:50%;object-fit:cover;flex:none;border:2px solid var(--acc-soft)}
.cv-name{font-size:22pt;font-weight:800;line-height:1.2;color:var(--ink)}
.cv-title{font-size:12pt;font-weight:600;color:var(--acc);margin-top:1mm}
.cv-contacts{display:flex;flex-wrap:wrap;gap:2px 14px;margin-top:2mm;font-size:9pt;color:var(--muted)}
.cv-contacts span{white-space:nowrap}
.cv-contacts b{color:var(--acc);font-weight:700;margin-inline-end:4px}
.cv-sec{margin-bottom:4.2mm;break-inside:auto}
.cv-sec>h2{font-size:11.5pt;font-weight:800;color:var(--acc);border-bottom:1.5px solid var(--acc);padding-bottom:1mm;margin-bottom:2.5mm;break-after:avoid;letter-spacing:.2px}
.sheet[lang=en] .cv-sec>h2{text-transform:uppercase;letter-spacing:.8px;font-size:10.5pt}
.cv-item{margin-bottom:3mm;break-inside:avoid}
.cv-item-head{display:flex;justify-content:space-between;gap:10px;align-items:baseline}
.cv-item h3{font-size:10.5pt;font-weight:700}
.cv-item .org{color:var(--muted);font-weight:600;font-size:9.5pt}
.cv-item .when{font-size:8.5pt;color:var(--muted);white-space:nowrap;flex:none}
.cv-item .desc{margin-top:1mm;white-space:pre-line;font-size:9.5pt}
.cv-item ul{margin:1mm 0 0;padding-inline-start:5mm;font-size:9.5pt}
.cv-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.5mm 8mm;font-size:9pt}
.cv-facts div{display:flex;gap:6px;border-bottom:1px dotted var(--rule);padding-bottom:1mm}
.cv-facts dt,.cv-facts .k{color:var(--muted);font-weight:600;flex:none}
.cv-facts .v{font-weight:700}
.chips{display:flex;flex-wrap:wrap;gap:1.5mm}
.chips span{background:var(--acc-soft);color:var(--ink);border-radius:99px;padding:.6mm 3mm;font-size:8.8pt;font-weight:600}
.langs div{display:flex;justify-content:space-between;gap:8px;font-size:9.3pt;padding:.6mm 0;border-bottom:1px dotted var(--rule)}
.langs .lvl{color:var(--muted)}
.cv-summary{white-space:pre-line}
.cv-body{display:block}
.cv-extra{display:grid;grid-template-columns:1fr 1fr;gap:0 10mm}
.watermark{position:absolute;inset-inline:0;bottom:6mm;text-align:center;font-size:7.5pt;color:#9a9286;letter-spacing:.2px;font-family:'Cairo',sans-serif}
.watermark b{color:#7a7166}

/* ---------- Template: Classic (free) ---------- */
.tpl-classic .cv-head{border-bottom:3px solid var(--acc);padding-bottom:3.5mm;margin-bottom:5mm}
.tpl-classic .cv-facts-wrap{margin-bottom:5mm}

/* ---------- Template: Modern (Pro) — coloured side column ---------- */
.tpl-modern{padding:0;background:linear-gradient(to left,var(--acc) 0,var(--acc) 68mm,#fff 68mm)}
.tpl-modern[dir=ltr]{background:linear-gradient(to right,var(--acc) 0,var(--acc) 68mm,#fff 68mm)}
.tpl-modern .cv-grid{display:grid;grid-template-columns:68mm minmax(0,1fr);min-height:297mm}
.tpl-modern .cv-side{color:#fff;padding:14mm 8mm}
.tpl-modern .cv-side .cv-photo{display:block;margin:0 auto 5mm;width:36mm;height:36mm;border-color:rgba(255,255,255,.5)}
.tpl-modern .cv-side .cv-sec>h2{color:#fff;border-color:rgba(255,255,255,.55)}
.tpl-modern .cv-side .chips span{background:rgba(255,255,255,.16);color:#fff}
.tpl-modern .cv-side .langs div,.tpl-modern .cv-side .cv-facts div{border-color:rgba(255,255,255,.25)}
.tpl-modern .cv-side .langs .lvl,.tpl-modern .cv-side .cv-facts .k,.tpl-modern .cv-side .org,.tpl-modern .cv-side .when{color:rgba(255,255,255,.75)}
.tpl-modern .cv-side .cv-facts{grid-template-columns:1fr}
.tpl-modern .cv-side .cv-facts div{flex-direction:column;gap:0}
.tpl-modern .cv-side .cv-contacts{flex-direction:column;color:#fff;font-size:8.8pt}
.tpl-modern .cv-side .cv-contacts b{color:rgba(255,255,255,.7)}
.tpl-modern .cv-side .cv-contacts span{white-space:normal}
.tpl-modern .cv-main{padding:14mm 11mm 16mm}
.tpl-modern .cv-head{margin-bottom:7mm}
.tpl-modern .cv-name{font-size:24pt}

/* ---------- Template: Executive (Pro) — dark band, serif ---------- */
.tpl-executive{padding:0;font-family:'Noto Naskh Arabic','Cairo',Georgia,serif}
.tpl-executive .cv-band{background:#1f2a37;color:#fff;padding:12mm 15mm 9mm;display:flex;gap:14px;align-items:center}
.tpl-executive .cv-band .cv-name{color:#fff;font-size:24pt;font-weight:700}
.tpl-executive .cv-band .cv-title{color:#d9b56a}
.tpl-executive .cv-band .cv-contacts{color:#d6dbe1}
.tpl-executive .cv-band .cv-contacts b{color:#d9b56a}
.tpl-executive .cv-band .cv-photo{border-color:#d9b56a}
.tpl-executive .cv-cols{display:grid;grid-template-columns:minmax(0,1fr) 58mm;gap:9mm;padding:9mm 15mm 16mm}
.tpl-executive .cv-sec>h2{color:#1f2a37;border-bottom:1px solid #d9b56a;font-size:12.5pt}
.tpl-executive .cv-aside{border-inline-start:1px solid var(--rule);padding-inline-start:6mm}
.tpl-executive .cv-aside .cv-facts{grid-template-columns:1fr}
.tpl-executive .cv-aside .cv-facts div{flex-direction:column;gap:0}
.tpl-executive .chips span{background:#f3ede0}

/* ---------- Template: Kufi Timeline (Pro) ---------- */
.tpl-timeline{font-family:'Noto Kufi Arabic','Cairo',sans-serif;font-size:9.3pt}
.tpl-timeline .cv-head{border-inline-start:6px solid var(--acc);padding-inline-start:6mm;background:var(--acc-soft);padding-block:5mm;border-radius:2mm}
.tpl-timeline .cv-name{font-size:20pt}
.tpl-timeline .cv-sec>h2{border:0;display:flex;align-items:center;gap:3mm}
.tpl-timeline .cv-sec>h2::after{content:"";flex:1;height:1px;background:var(--rule)}
.tpl-timeline .tl .cv-item{position:relative;padding-inline-start:6mm;border-inline-start:2px solid var(--acc-soft);margin-inline-start:1.5mm;padding-bottom:1mm}
.tpl-timeline .tl .cv-item::before{content:"";position:absolute;inset-inline-start:-1.9mm;top:1.6mm;width:3mm;height:3mm;border-radius:50%;background:var(--acc)}
.tpl-timeline .cv-facts-wrap{margin-bottom:5mm}

/* ---------- Bilingual side-by-side (Pro) ---------- */
.bi .bi-head{display:grid;grid-template-columns:1fr auto 1fr;gap:8mm;align-items:center;border-bottom:3px solid var(--acc);padding-bottom:4mm;margin-bottom:5mm}
.bi .bi-head .en{text-align:left}
.bi .bi-contacts{display:flex;flex-wrap:wrap;justify-content:center;gap:2px 14px;font-size:8.8pt;color:var(--muted);margin:-2mm 0 5mm;direction:ltr}
.bi .bi-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 10mm;position:relative}
.bi .bi-row::after{content:"";position:absolute;inset-block:0;left:50%;border-left:1px solid var(--rule)}
.bi .bi-row>[lang=en]{font-family:'Cairo',sans-serif}
.bi .bi-title{margin-bottom:2.5mm;break-after:avoid}
.bi .bi-title h2{font-size:11pt;font-weight:800;color:var(--acc);border-bottom:1.5px solid var(--acc);padding-bottom:1mm}
.bi .bi-title [lang=en] h2{text-transform:uppercase;letter-spacing:.7px;font-size:10pt}
.bi .bi-sec{margin-bottom:4.5mm}
.bi .cv-facts{grid-template-columns:1fr}
.bi .bi-row.cv-item{margin-bottom:3mm}
.bi .cv-name{font-size:18pt}
.bi .cv-title{font-size:10.5pt}
.bi.tpl-executive .bi-head{background:#1f2a37;color:#fff;margin:-0mm 0 5mm;padding:10mm 15mm 7mm;border:0}
.bi.tpl-executive{padding-top:0}
.bi.tpl-executive .bi-head .cv-name{color:#fff;font-size:16pt}
.bi.tpl-executive .bi-head .cv-title{color:#d9b56a}
.bi.tpl-executive{padding-inline:0}.bi.tpl-executive .bi-body,.bi.tpl-executive .bi-contacts{padding-inline:15mm}
.bi.tpl-modern{background:#fff;padding:14mm 15mm 16mm}
.bi.tpl-modern .bi-head{background:var(--acc);color:#fff;border:0;border-radius:3mm;padding:6mm 8mm}
.bi.tpl-modern .bi-head .cv-name,.bi.tpl-modern .bi-head .cv-title{color:#fff}

/* ---------- Cover letter ---------- */
.letter .cl-head{border-bottom:3px solid var(--acc);padding-bottom:4mm;margin-bottom:8mm}
.letter .cl-meta{display:flex;justify-content:space-between;gap:10mm;margin-bottom:7mm;font-size:10pt}
.letter .cl-to{font-weight:600;white-space:pre-line}
.letter .cl-subject{font-weight:800;margin-bottom:5mm}
.letter .cl-body{white-space:pre-line;font-size:10.5pt;line-height:1.8;text-align:justify}
.letter .cl-sign{margin-top:10mm;font-weight:700}
.letter.tpl-executive{padding:0}.letter.tpl-executive .cl-inner{padding:0 18mm 16mm}
.letter.tpl-executive .cl-head{background:#1f2a37;color:#fff;border:0;padding:12mm 18mm 8mm}
.letter.tpl-executive .cl-head .cv-name{color:#fff}.letter.tpl-executive .cl-head .cv-title{color:#d9b56a}.letter.tpl-executive .cl-head .cv-contacts{color:#d6dbe1}
.letter.tpl-modern{background:#fff;padding:0}.letter.tpl-modern .cl-head{background:var(--acc);color:#fff;border:0;padding:12mm 18mm 8mm}
.letter.tpl-modern .cl-head .cv-name,.letter.tpl-modern .cl-head .cv-title,.letter.tpl-modern .cl-head .cv-contacts,.letter.tpl-modern .cl-head .cv-contacts b{color:#fff}
.letter.tpl-modern .cl-inner{padding:0 18mm 16mm}
.letter.tpl-timeline .cl-head{border:0;border-inline-start:6px solid var(--acc);background:var(--acc-soft);padding:5mm 6mm}

/* Bilingual cover letter */
.sheet.bi.letter{padding:12mm 15mm 14mm}
.sheet.bi.letter.tpl-executive{padding:0 0 14mm}
.sheet.bi.letter.tpl-modern .bi-head{background:var(--acc);color:#fff;border:0;border-radius:3mm;padding:6mm 8mm}
.sheet.bi.letter.tpl-modern .bi-head .cv-name,.sheet.bi.letter.tpl-modern .bi-head .cv-title{color:#fff}
.sheet.bi.letter.tpl-timeline .bi-head{border:0;border-inline-start:6px solid var(--acc);background:var(--acc-soft);padding:5mm 6mm}
.bi.letter .bi-head .cv-name{font-size:17pt}
.bi.letter .bi-row{margin-bottom:5mm}
.bi.letter .cl-meta-row>div{display:flex;justify-content:space-between;gap:6mm;font-size:9.5pt}
.bi.letter .cl-body{font-size:9.6pt;line-height:1.75;text-align:start}
.bi.letter [lang=ar] .cl-body{text-align:justify}
.bi.letter .cl-sign{margin-top:4mm}
.bi.letter .bi-contacts{margin:-1mm 0 7mm}

/* Buyer preview watermark: tiled two-line marks, ~27 % opacity (screen only — buyers can't print). */
.tile-wm{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:6}
.tile-wm .tile{position:absolute;transform:translate(-50%,-50%) rotate(-30deg);text-align:center;font-family:'Cairo',sans-serif;font-weight:800;color:#1c1915;opacity:.27;line-height:1.25;white-space:nowrap}
.tile-wm .tile>div:first-child{font-size:21pt}
.tile-wm .tile>div:last-child{font-size:17pt;letter-spacing:.5px}
html:not(.owner) .sheet{-webkit-user-select:none;user-select:none}

/* Pro lock overlay in preview */
.pro-overlay{position:absolute;top:4mm;inset-inline-end:4mm;pointer-events:none}
.pro-overlay .pill{display:inline-block;background:#1c1915;color:#fff;border-radius:99px;padding:1.5mm 4mm;font-weight:800;font-size:9pt;box-shadow:0 4px 12px rgba(0,0,0,.25);font-family:'Cairo',sans-serif}

/* ===== Print / PDF ===== */
@page{size:A4;margin:12mm 0 12mm 0}
@page :first{margin-top:0}
@media print{
  html,body{background:#fff !important}
  #preview{display:block !important}
  .sheet+.sheet{break-before:page}
  .sheet{box-shadow:none !important;transform:none !important;width:210mm;min-height:0;margin:0 !important}
  .tpl-modern .cv-grid{min-height:285mm}
  .bi.tpl-modern .cv-grid{min-height:0}
  .sheet .pro-overlay{display:none !important}
  .watermark,.tile-wm{display:none !important}
  .preview-scale{transform:none !important;height:auto !important;width:auto !important}
  *{-webkit-print-color-adjust:exact !important;print-color-adjust:exact !important}
}

/* ===== Print blocking for buyers =====
 * Without html.owner (set by JS only after the owner passcode), printing shows ONLY #printBlock.
 * This is the default state, so it also applies with JavaScript disabled. */
.print-block{display:none}
@media print{
  html:not(.owner) body>*:not(#printBlock){display:none !important}
  html:not(.owner) #printBlock{display:block !important;font-family:'Cairo',sans-serif;color:#1c1915;padding:20mm 18mm}
  html.owner #printBlock{display:none !important}
}
.print-block .pb-brand{font-size:20pt;font-weight:800;margin-bottom:8mm;text-align:center}
.print-block section{border:1.5px solid #b5812f;border-radius:4mm;padding:6mm 8mm;margin-bottom:8mm;line-height:1.7}
.print-block h1{font-size:16pt;margin:0 0 3mm}
.print-block ol{margin:3mm 0 0;padding-inline-start:7mm}
