/* CV page rendering (A4) - polished layouts */
.cv-page {
  width: 210mm; min-height: 297mm; background: var(--cvbg); color: #252a30;
  box-sizing: border-box; font-size: 10.5pt; line-height: 1.55;
  margin: 0 auto; box-shadow: 0 2px 18px rgba(0,0,0,.18); overflow: hidden;
}
.cv-page .row { display: flex; min-height: 297mm; }
.cv-page .row.pad { min-height: 0; }
.cv-page .pad { padding: 8mm 9mm; }
.cv-page .main { flex: 1; padding: 10mm 8mm; min-width: 0; }
.cv-page .main.wide { flex: 1.7; }
.cv-page .main.half, .cv-page .side.half { padding: 0 4mm; width: auto; }
.cv-page .side { width: 66mm; background: var(--sidebg); color: var(--sidetext); padding: 10mm 6.5mm; flex-shrink: 0; }
.cv-page .side.light { background: color-mix(in srgb, var(--primary) 6%, white); color: #252a30; }
.cv-page .side.mid { background: color-mix(in srgb, var(--primary) 12%, white); color: #252a30; }
.cv-page .side.none { background: transparent; color: inherit; padding: 0 4mm; }
.cv-page .side.bordered { border-inline-start: 1px solid color-mix(in srgb, var(--primary) 25%, white); }

/* ---------- headers ---------- */
.cv-header { padding: 9mm 9mm 6mm; display: flex; gap: 6mm; align-items: center; }
.cv-header .h-text { min-width: 0; flex: 1; }
.cv-header h1 { margin: 0 0 1.5mm; font-size: 23pt; line-height: 1.15; color: var(--primary); }
.cv-title { font-size: 12.5pt; color: var(--accent); margin-bottom: 2mm; font-weight: 600; }
.cv-contact { font-size: 9.5pt; opacity: .85; line-height: 1.8; }
.cv-contact .sep { margin: 0 6px; opacity: .5; }

.cv-header.band { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 80%, var(--accent))); color: #fff; padding: 11mm 9mm; }
.cv-header.band h1, .cv-header.band .cv-title { color: #fff; }
.cv-header.band .cv-title { opacity: .92; }

.cv-header.ats { display: block; text-align: center; border-bottom: 1px solid #bbb; padding: 10mm 9mm 5mm; }
.cv-header.ats h1 { color: #111; font-size: 21pt; }
.cv-header.ats .cv-title { color: #444; letter-spacing: .5px; }

.cv-header.plain { display: block; padding: 0 0 6mm; }
.cv-header.boldline { display: block; padding: 0 0 6mm; border-bottom: 4px solid var(--primary); }

.cv-header.line { display: block; border-bottom: 1.5px solid var(--accent); padding: 9mm 9mm 5mm; }

.cv-header.academic { display: block; text-align: center; padding: 10mm 9mm 5mm; }
.cv-header.academic h1 { color: #111; font-size: 20pt; }
.cv-header.academic::after { content: ""; display: block; width: 42mm; height: 1px; background: var(--accent); margin: 4mm auto 0; }

.cv-header.creative { position: relative; background: var(--primary); color: #fff; padding: 12mm 9mm 14mm; overflow: hidden; }
.cv-header.creative::after { content: ""; position: absolute; inset-inline-end: -18mm; top: -24mm; width: 62mm; height: 62mm; border-radius: 50%; background: var(--accent); opacity: .35; }
.cv-header.creative::before { content: ""; position: absolute; inset-inline-start: -10mm; bottom: -20mm; width: 40mm; height: 40mm; border-radius: 50%; background: #fff; opacity: .10; }
.cv-header.creative h1, .cv-header.creative .cv-title { color: #fff; position: relative; z-index: 1; }

/* avatar */
.avatar {
  width: 17mm; height: 17mm; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15pt;
  flex-shrink: 0; letter-spacing: 0;
}
.avatar.big { width: 26mm; height: 26mm; font-size: 20pt; margin: 0 auto 6mm; background: var(--accent); border: 1.2mm solid rgba(255,255,255,.25); }
.avatar.ring { border: 1.2mm solid var(--accent); background: transparent; color: var(--sidetext); }
.cv-header.band .avatar, .cv-header.creative .avatar { background: rgba(255,255,255,.2); border: .8mm solid rgba(255,255,255,.5); position: relative; z-index: 1; }

/* ---------- sections ---------- */
.cv-sec { margin: 0 0 6mm; }
.cv-page > .cv-sec { margin-inline: 9mm; }
.cv-sec h2 {
  font-size: 12pt; color: var(--primary); display: flex; align-items: center; gap: 2.5mm;
  padding-bottom: 1.2mm; margin: 0 0 3mm; border-bottom: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent);
}
.h2-mark { width: 2.6mm; height: 2.6mm; background: var(--accent); border-radius: .6mm; flex-shrink: 0; }
.cv-page .side h2 { color: inherit; border-bottom-color: rgba(255,255,255,.35); }
.cv-page .side.light h2, .cv-page .side.mid h2 { color: var(--primary); border-bottom-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.layout-minimal .cv-sec h2, .layout-classic .cv-sec h2 { border-bottom: 1px solid #999; color: #111; }
.layout-minimal .h2-mark, .layout-classic .h2-mark { display: none; }
.layout-classic .cv-sec h2 { justify-content: center; }

.cv-page p { margin: 0 0 2mm; font-size: 10pt; }

.job { margin-bottom: 4.5mm; }
.job-head { display: flex; justify-content: space-between; gap: 4mm; align-items: baseline; }
.job-head strong { font-size: 11pt; }
.period { color: var(--accent); font-size: 9pt; white-space: nowrap; font-weight: 600; }
.company { color: #5a626b; font-size: 10pt; margin: .5mm 0 1.2mm; }
.cv-page .side .company, .cv-page .side .period { color: inherit; opacity: .8; }
.cv-page .side.light .company, .cv-page .side.mid .company { color: #5a626b; opacity: 1; }
.cv-page .side.light .period, .cv-page .side.mid .period { color: var(--accent); opacity: 1; }

/* job accent rail (main column experience) */
.cv-page .main .sec-experience .job { border-inline-start: .8mm solid color-mix(in srgb, var(--accent) 45%, transparent); padding-inline-start: 3.5mm; }
.layout-minimal .main .sec-experience .job, .layout-classic .sec-experience .job { border-inline-start: none; padding-inline-start: 0; }

/* contact list with markers */
.contact-list .c-item { margin-bottom: 2.2mm; font-size: 9.5pt; display: flex; align-items: baseline; gap: 2mm; word-break: break-word; }
.c-item::before { content: ""; width: 1.8mm; height: 1.8mm; background: var(--accent); border-radius: 50%; flex-shrink: 0; transform: translateY(-.2mm); }
.cv-contact.items .c-item { display: inline-flex; margin-inline-end: 4mm; }

/* skill chips */
ul.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 2mm; }
ul.chips li { background: var(--primary); color: #fff; border-radius: 20px; padding: 1mm 3.5mm; font-size: 9pt; }
.cv-page .side:not(.light):not(.mid):not(.none) .chips li { background: rgba(255,255,255,.16); color: inherit; }

/* skill dots */
ul.dots { list-style: none; padding: 0; margin: 0; }
ul.dots li { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.4mm; font-size: 9.5pt; gap: 3mm; }
.dot-row { display: inline-flex; gap: 1.2mm; }
.dot-row i { width: 2.2mm; height: 2.2mm; border-radius: 50%; background: color-mix(in srgb, currentColor 22%, transparent); }
.dot-row i.on { background: var(--accent); }
.side.light .dot-row i.on, .side.mid .dot-row i.on { background: var(--primary); }

/* language bars */
ul.bars { list-style: none; padding: 0; margin: 0; }
ul.bars li { margin-bottom: 3mm; font-size: 9.5pt; }
.bars .bar { display: block; height: 1.8mm; background: color-mix(in srgb, currentColor 18%, transparent); border-radius: 2mm; margin-top: 1.2mm; overflow: hidden; }
.bars .bar i { display: block; height: 100%; background: var(--accent); border-radius: 2mm; }

ul.plain { margin: 0; padding-inline-start: 5mm; font-size: 10pt; }

/* timeline layout */
.layout-timeline .tl { position: relative; margin-inline-start: 3mm; padding-inline-start: 7mm; border-inline-start: .9mm solid var(--accent); margin-bottom: 6mm; }
.layout-timeline .tl .cv-sec { margin: 0; }
.layout-timeline .tl .job { position: relative; }
.layout-timeline .tl .job::before {
  content: ""; position: absolute; inset-inline-start: -8.6mm; top: 1.4mm;
  width: 2.6mm; height: 2.6mm; background: var(--accent); border-radius: 50%;
  box-shadow: 0 0 0 1.2mm color-mix(in srgb, var(--accent) 25%, transparent);
}
.layout-timeline .tl .sec-experience h2 { border: none; }
.layout-timeline .period { background: color-mix(in srgb, var(--accent) 14%, white); padding: .6mm 2.5mm; border-radius: 3mm; }

/* cards layout */
.cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; padding: 7mm 9mm; }
.cards-grid .cv-sec { background: #fff; border: 1px solid #e6e8eb; border-top: 1.2mm solid var(--accent); border-radius: 2.5mm; padding: 4.5mm; margin: 0; box-shadow: 0 .5mm 2mm rgba(0,0,0,.04); }
.cards-grid .cv-sec[data-sec="experience"], .cards-grid .cv-sec[data-sec="summary"] { grid-column: 1 / -1; }

/* creative numbered sections */
.numbered { counter-reset: secn; }
.numbered .cv-sec h2 { counter-increment: secn; }
.numbered .cv-sec h2 .h2-mark { display: none; }
.numbered .cv-sec h2::before {
  content: counter(secn, decimal-leading-zero); color: var(--accent); font-size: 13pt; font-weight: 700;
  border-bottom: .8mm solid var(--accent); padding-bottom: .5mm;
}
.layout-compact .cv-sec h2 { border-bottom: none; }

/* minimal (ATS) tweaks */
.layout-minimal .cv-header.ats + section { margin-top: 5mm; }
.layout-minimal { font-size: 10.5pt; }
.layout-minimal .period { color: #444; }

/* contenteditable focus */
.cv-page [contenteditable]:focus { outline: 2px dashed var(--accent); outline-offset: 2px; }

@media print {
  /* ---- A4 print: only the CV page, nothing else ---- */
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; width: auto !important; height: auto !important; display: block !important; overflow: visible !important; }
  .skip, .topnav, footer, .tpl-switch, .panel, .editor-wrap > div:first-child,
  .filters, .pager { display: none !important; }
  .editor-wrap { display: block !important; padding: 0 !important; margin: 0 !important; max-width: none !important; width: auto !important; gap: 0 !important; grid-template-columns: none !important; }
  .preview-area { display: block !important; width: auto !important; margin: 0 !important; padding: 0 !important; }
  #print-root, #root { display: block !important; margin: 0 !important; padding: 0 !important; width: auto !important; }
  #print-root .cv-page, #root .cv-page, .cv-page {
    width: 210mm !important; min-height: 0 !important; height: 297mm !important;
    margin: 0 !important; box-shadow: none !important; break-inside: avoid; page-break-inside: avoid;
  }
  .cv-page .row { break-inside: avoid; page-break-inside: avoid; min-height: 297mm; }
  .cv-sec, .job, .cv-header { break-inside: avoid; page-break-inside: avoid; }
  .cv-page [contenteditable]:focus { outline: none !important; }
  @page { size: A4; margin: 0; }
}
}

/* ============ new premium families ============ */

/* executive */
.cv-header.executive { display: block; text-align: center; padding: 12mm 12mm 6mm; border-top: 1.6mm solid var(--primary); border-bottom: .4mm solid var(--accent); margin-bottom: 6mm; }
.cv-header.executive h1 { color: var(--primary); font-size: 24pt; letter-spacing: .5px; }
.layout-executive .cv-sec h2 { justify-content: center; border: none; letter-spacing: 1px; font-size: 12.5pt; }
.layout-executive .cv-sec h2::before, .layout-executive .cv-sec h2::after { content: ""; flex: 1; height: .4mm; background: color-mix(in srgb, var(--accent) 60%, transparent); }
.layout-executive .h2-mark { display: none; }
.layout-executive .job-head strong { font-size: 11.5pt; }

/* photo header */
.cv-header.photo { display: block; text-align: center; background: linear-gradient(160deg, var(--primary), color-mix(in srgb, var(--primary) 75%, var(--accent))); color: #fff; padding: 13mm 9mm 11mm; }
.cv-header.photo h1, .cv-header.photo .cv-title { color: #fff; }
.cv-header.photo .avatar { margin: 0 auto 4mm; width: 30mm; height: 30mm; font-size: 22pt; background: rgba(255,255,255,.18); border: 1.4mm solid rgba(255,255,255,.85); }
.layout-photo .row.pad { padding: 0; }

/* medical */
.cv-header.medical { display: block; padding: 9mm 9mm 5mm; border-bottom: 1mm solid var(--primary); }
.cv-header.medical h1 { font-size: 22pt; }
.layout-medical .cv-sec h2 .h2-mark { border-radius: 50%; width: 2.8mm; height: 2.8mm; position: relative; }
.layout-medical .side.bordered { padding-top: 2mm; }
.layout-medical ul.chips li { background: color-mix(in srgb, var(--primary) 10%, white); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 35%, white); }

/* student */
.cv-header.student { display: block; padding: 9mm 9mm 6mm; background: color-mix(in srgb, var(--accent) 10%, white); border-bottom: .8mm dashed var(--accent); }
.cv-header.student h1 { font-size: 22pt; }
.cv-header.student .cv-title { display: inline-block; background: var(--accent); color: #fff; padding: .8mm 4mm; border-radius: 20px; font-size: 10.5pt; }
.layout-student .sec-education h2 { color: var(--accent); }

/* tech */
.cv-header.tech { display: block; padding: 8mm 9mm; background: color-mix(in srgb, var(--primary) 5%, white); border-inline-start: 2.5mm solid var(--accent); }
.cv-header.tech h1 { font-size: 22pt; }
.layout-tech .company { color: var(--accent); font-weight: 600; }
.layout-tech ul.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 2mm; }
.layout-tech ul.chips li { border-radius: 1.5mm; text-align: center; }

/* designer */
.cv-header.designer { display: block; padding: 12mm 9mm 7mm; position: relative; overflow: hidden; }
.cv-header.designer::before { content: ""; position: absolute; inset-inline-end: -14mm; top: -18mm; width: 48mm; height: 48mm; border-radius: 50%; background: color-mix(in srgb, var(--accent) 30%, transparent); }
.cv-header.designer h1 { font-size: 30pt; line-height: 1.05; position: relative; }
.cv-header.designer .cv-title { font-size: 14pt; }
.layout-designer .numbered .cv-sec h2 { font-size: 14pt; }
.layout-designer .numbered .cv-sec h2::before { font-size: 17pt; }

/* dark premium */
.layout-dark.cv-page { background: #161a24; color: #e9edf5; }
.layout-dark .cv-header.dark { display: flex; background: #10131b; border-bottom: .5mm solid var(--accent); }
.layout-dark .cv-header.dark h1 { color: #fff; }
.layout-dark .cv-header.dark .cv-title { color: var(--accent); }
.layout-dark .cv-sec h2 { color: #fff; border-bottom-color: color-mix(in srgb, var(--accent) 70%, transparent); }
.layout-dark .company { color: #a7b0c0; }
.layout-dark p { color: #cfd6e2; }
.layout-dark ul.chips li { background: var(--accent); color: #10131b; }
.layout-dark .dot-row i { background: rgba(255,255,255,.15); }
.layout-dark .dot-row i.on { background: var(--accent); }
.layout-dark .bars .bar { background: rgba(255,255,255,.12); }
.layout-dark .cv-page .side.none { color: inherit; }

/* color rail */
.railbar { width: 13mm; background: linear-gradient(180deg, var(--primary), var(--accent)); flex-shrink: 0; }
.rail-content { flex: 1; padding: 10mm 9mm; min-width: 0; }
.layout-rail .cv-header.plain { border-bottom: .5mm solid color-mix(in srgb, var(--accent) 60%, transparent); }

/* elegant */
.cv-header.elegant { display: block; text-align: center; padding: 11mm 9mm 6mm; }
.cv-header.elegant h1 { font-size: 24pt; font-weight: 600; }
.cv-header.elegant .cv-title { letter-spacing: 3px; font-size: 11pt; text-transform: uppercase; }
.cv-header.elegant .cv-title:lang(ar), [dir="rtl"] .cv-header.elegant .cv-title { letter-spacing: 1px; text-transform: none; }
.cv-header.elegant::after { content: ""; display: block; width: 55mm; margin: 4mm auto 0; border-top: .5mm solid var(--primary); border-bottom: .2mm solid var(--primary); height: 1.4mm; }
.layout-elegant .cv-sec h2 { justify-content: center; border: none; }
.layout-elegant .cv-sec h2::before, .layout-elegant .cv-sec h2::after { content: ""; flex: .35; height: .25mm; background: #999; }
.layout-elegant .h2-mark { display: none; }

/* compact pro */
.layout-dense { font-size: 9.5pt; }
.layout-dense .pad.tight { padding: 6mm 9mm; }
.layout-dense .cv-sec { margin-bottom: 3.5mm; }
.layout-dense .job { margin-bottom: 2.5mm; }
.layout-dense .cv-sec h2 { font-size: 11pt; margin-bottom: 2mm; padding-bottom: .8mm; }
.layout-dense ul.chips li { font-size: 8.5pt; padding: .8mm 3mm; }
