/* CVYARAT v8.2.4 — robust long-CV flow for every template family.
   Miniature cards stay one-page thumbnails. Live preview and PDF use natural
   document fragmentation, without moving a complete section to the next page. */

/* ---------- Shared document geometry ---------- */
#printArea{
  position:relative!important;
  width:210mm!important;
  min-width:210mm!important;
  max-width:210mm!important;
  min-height:297mm!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
  margin:0 auto!important;
}

#printArea > :is(.cvPaper,.cv-page,.pdfInspiredCv,.uploadedPremiumCv).previewCv:not(.miniCv),
.creatorScale .printArea > :is(.cvPaper,.cv-page,.pdfInspiredCv,.uploadedPremiumCv).previewCv:not(.miniCv){
  width:210mm!important;
  min-width:210mm!important;
  max-width:210mm!important;
  min-height:297mm!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
  contain:none!important;
  margin:0!important;
  transform:none!important;
  position:relative!important;
  break-inside:auto!important;
  page-break-inside:auto!important;
}

/* The preview container must grow with the document instead of clipping page 2+. */
.creatorPaperStage{overflow:auto!important;scrollbar-gutter:stable!important;}
.creatorScale{width:max-content!important;min-height:297mm!important;height:auto!important;}
.creatorScale .printArea{height:auto!important;max-height:none!important;overflow:visible!important;}

/* ---------- Never allow text to leave a column ---------- */
#printArea > .previewCv:not(.miniCv) :is(h1,h2,h3,h4,p,li,a,b,strong,span,small,time),
#printArea > .previewCv:not(.miniCv) :is(.cvEntry,.pdfEntry,.cv-item,.upItem),
#printArea > .previewCv:not(.miniCv) :is(.cvHeader,.cvAside,.cvBody,.cv-body,.cv-sidebar,.cv-main,.pdfSide,.pdfMain){
  min-width:0!important;
  max-width:100%!important;
  overflow-wrap:anywhere!important;
  word-break:break-word!important;
  hyphens:auto!important;
}
#printArea > .previewCv:not(.miniCv) :is(.cvEntry>div,.pdfEntry>div,.cv-item-head){
  min-width:0!important;
  flex-wrap:wrap!important;
}
#printArea > .previewCv:not(.miniCv) :is(.cvEntry time,.pdfEntry time,.cv-item time){
  white-space:normal!important;
  flex:0 1 auto!important;
}
#printArea > .previewCv:not(.miniCv) img,
#printArea > .previewCv:not(.miniCv) svg{max-width:100%!important;}

/* ---------- Generic CV templates ---------- */
#printArea > .cvPaper.previewCv:not(.miniCv){
  grid-template-rows:auto minmax(calc(297mm - var(--cv-header-h,36mm)),auto)!important;
  align-items:stretch!important;
}
#printArea > .cvPaper.previewCv:not(.miniCv) .cvHeader{
  height:auto!important;
  min-height:var(--cv-header-h,36mm)!important;
  max-height:none!important;
  overflow:visible!important;
}
#printArea > .cvPaper.previewCv:not(.miniCv) .cvHeader :is(h1,h2,p){
  max-height:none!important;
  overflow:visible!important;
  display:block!important;
  -webkit-line-clamp:unset!important;
  -webkit-box-orient:initial!important;
}
#printArea > .cvPaper.previewCv:not(.miniCv) :is(.cvAside,.cvBody){
  height:auto!important;
  min-height:calc(297mm - var(--cv-header-h,36mm))!important;
  max-height:none!important;
  overflow:visible!important;
  align-content:start!important;
}
/* A section may span pages; each individual record remains intact when possible. */
#printArea > .cvPaper.previewCv:not(.miniCv) :is(.cvSection,.cvAside>section){
  break-inside:auto!important;
  page-break-inside:auto!important;
  overflow:visible!important;
}
#printArea > .cvPaper.previewCv:not(.miniCv) :is(.cvEntry,.cvStats){
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}
#printArea > .cvPaper.previewCv:not(.miniCv) :is(.cvSection>h3,.cvAside>section>h3){
  break-after:avoid!important;
  page-break-after:avoid!important;
}

/* Full-height profile rail templates must stretch with page 2+, not stop at 297mm. */
#printArea > .cvPaper.previewCv:not(.miniCv):is(.layout-split,.layout-canvaSplitProfile){
  grid-template-rows:minmax(297mm,auto)!important;
}
#printArea > .cvPaper.previewCv:not(.miniCv):is(.layout-split,.layout-canvaSplitProfile) .cvHeader{
  height:auto!important;
  min-height:297mm!important;
  max-height:none!important;
  align-self:stretch!important;
}
/* Single-column templates need an expanding header when a title/summary is long. */
#printArea > .cvPaper.previewCv:not(.miniCv):is(.layout-canvaSingleColumnAts,.layout-addonLegalClassic,.layout-addonAcademicModern,.layout-addonTeacherStructured) .cvHeader{
  height:auto!important;
  min-height:34mm!important;
  max-height:none!important;
}

/* ---------- Imported template pack ---------- */
#printArea > .cv-page.cvPackBridge.previewCv:not(.miniCv),
#printArea > .cv-page.cvPackBridge.previewCv:not(.miniCv) .cv-body{
  min-height:297mm!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
  contain:none!important;
  align-items:stretch!important;
}
#printArea > .cv-page.cvPackBridge.previewCv:not(.miniCv) :is(.cv-sidebar,.cv-main){
  min-width:0!important;
  min-height:297mm!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
}
#printArea > .cv-page.cvPackBridge.previewCv:not(.miniCv) .cv-section{
  break-inside:auto!important;
  page-break-inside:auto!important;
  overflow:visible!important;
}
#printArea > .cv-page.cvPackBridge.previewCv:not(.miniCv) :is(.cv-item,.cv-photo){
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}
#printArea > .cv-page.cvPackBridge.previewCv:not(.miniCv) .cv-section-title{
  break-after:avoid!important;
  page-break-after:avoid!important;
}
#printArea > .cv-page.cvPackBridge.previewCv:not(.miniCv).tpl-top-band .cv-sidebar{
  height:auto!important;
  min-height:72mm!important;
  max-height:none!important;
  overflow:visible!important;
}
#printArea > .cv-page.cvPackBridge.previewCv:not(.miniCv).tpl-top-band .cv-main{
  height:auto!important;
  min-height:225mm!important;
  max-height:none!important;
  overflow:visible!important;
}

/* ---------- PDF-inspired templates ---------- */
#printArea > .pdfInspiredCv.previewCv:not(.miniCv){
  align-items:stretch!important;
}
#printArea > .pdfInspiredCv.previewCv:not(.miniCv) :is(.pdfSide,.pdfMain){
  min-height:297mm!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
}
#printArea > .pdfInspiredCv.previewCv:not(.miniCv) :is(.pdfMain>section,.pdfSide>section){
  break-inside:auto!important;
  page-break-inside:auto!important;
  overflow:visible!important;
}
#printArea > .pdfInspiredCv.previewCv:not(.miniCv) :is(.pdfEntry,.pdfStats,.pdfPhoto){
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}
#printArea > .pdfInspiredCv.previewCv:not(.miniCv) :is(.pdfMain>section>h3,.pdfSide>section>h3){
  break-after:avoid!important;
  page-break-after:avoid!important;
}
#printArea > .pdfInspiredCv.previewCv:not(.miniCv) .pdfChips span{max-width:100%!important;}

/* ---------- Uploaded premium templates ---------- */
#printArea > .uploadedPremiumCv.previewCv:not(.miniCv){
  min-height:297mm!important;
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
  contain:none!important;
}
#printArea > .uploadedPremiumCv.previewCv:not(.miniCv) :is(.upBlueTop,.upBlueGrid,.upBlackLeft,.upBlackRight,.upBrownHeader,.upBrownGrid,.upBrownGrid>div,.upBrownExperience){
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
}
#printArea > .uploadedPremiumCv.previewCv:not(.miniCv) .upBlueTop{min-height:131mm!important;}
#printArea > .uploadedPremiumCv.previewCv:not(.miniCv) .upBlueGrid{min-height:166mm!important;}
#printArea > .uploadedPremiumCv.previewCv:not(.miniCv).layout-premiumBlackEditorial{
  grid-template-rows:minmax(297mm,auto)!important;
  align-items:stretch!important;
}
#printArea > .uploadedPremiumCv.previewCv:not(.miniCv) :is(.upBlackLeft,.upBlackRight){min-height:297mm!important;}
#printArea > .uploadedPremiumCv.previewCv:not(.miniCv) .upBrownHeader{min-height:96mm!important;}
#printArea > .uploadedPremiumCv.previewCv:not(.miniCv) .upBrownGrid{min-height:201mm!important;}
#printArea > .uploadedPremiumCv.previewCv:not(.miniCv) .upBrownExperience{min-height:110mm!important;}
#printArea > .uploadedPremiumCv.previewCv:not(.miniCv) :is(.upItem, .upPhoto, .upSkillBar){
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}
#printArea > .uploadedPremiumCv.previewCv:not(.miniCv) section{
  break-inside:auto!important;
  page-break-inside:auto!important;
}
#printArea > .uploadedPremiumCv.previewCv:not(.miniCv) section>h3{
  break-after:avoid!important;
  page-break-after:avoid!important;
}
#printArea > .uploadedPremiumCv.previewCv:not(.miniCv) :is(.upItem b,.upItem span,.upItem p,.upBlueTop section p,.upBlackRight section:first-of-type p,.upBrownGrid>div section:first-child p,.upBrownContact li,.upBlackContact li){
  max-height:none!important;
  overflow:visible!important;
  display:block!important;
  -webkit-line-clamp:unset!important;
  -webkit-box-orient:initial!important;
}

/* A subtle page boundary in live preview, without altering layout or PDF. */
#printArea::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:999;
  pointer-events:none;
  background:repeating-linear-gradient(to bottom,transparent 0,transparent calc(297mm - 1px),rgba(30,41,59,.22) calc(297mm - 1px),rgba(30,41,59,.22) 297mm);
}
@media print{#printArea::after{display:none!important;}}

/* ---------- v8.2.4 final hardening: chips, lists and complex layouts ---------- */
/* Small atomic items must never be cut between two physical pages. */
#printArea > .previewCv:not(.miniCv) :is(
  .cvTags span,.cv-tag,.pdfChips span,
  .cv-contact li,.cvContact li,.pdfContact li,.pdfMiniList li,
  .upContact li,.upLangs li,.upBrownContact li,.upBlackContact li,
  .upRing,.cvStats b,.pdfStats b
){
  break-inside:avoid!important;
  page-break-inside:avoid!important;
  max-width:100%!important;
}

/* CSS multi-column and nested two-column grids fragment unpredictably in PDF.
   Keep the visual identity, but use a stable reading flow for full CVs. */
#printArea > .cvPaper.previewCv:not(.miniCv).layout-monoSwiss .cvAside{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
#printArea > .cvPaper.previewCv:not(.miniCv).layout-monoSwiss .cvAside>section:first-child{
  grid-column:1/-1!important;
}
#printArea > .cvPaper.previewCv:not(.miniCv).layout-monoSwiss .cvBody{
  columns:auto!important;
  column-count:1!important;
  column-gap:0!important;
  display:block!important;
}
#printArea > .cvPaper.previewCv:not(.miniCv).layout-modularImpact .cvBody{
  grid-template-columns:minmax(0,1fr)!important;
}
#printArea > .cvPaper.previewCv:not(.miniCv).layout-modularImpact :is(.cvStats,.cvSection){
  grid-column:1!important;
}

/* Mono Swiss is intentionally a single-canvas editorial layout, not the
   generic sidebar grid used by most templates. Preserve that structure. */
#printArea > .cvPaper.previewCv:not(.miniCv).layout-monoSwiss{
  display:block!important;
  grid-template-columns:none!important;
  grid-template-rows:none!important;
}
#printArea > .cvPaper.previewCv:not(.miniCv).layout-monoSwiss :is(.cvAside,.cvBody){
  min-height:0!important;
}

/* ===== CVYARAT v8.2.5: measured physical-page renderer ===== */
#printArea::after{display:none!important;content:none!important;}
#printArea{width:210mm!important;min-height:297mm!important;height:auto!important;overflow:visible!important;}
.cvyPagedDocument{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:10mm!important;width:210mm!important;min-width:210mm!important;max-width:210mm!important;margin:0!important;padding:0!important;overflow:visible!important;}
.cvyPhysicalPage{position:relative!important;width:210mm!important;min-width:210mm!important;max-width:210mm!important;height:297mm!important;min-height:297mm!important;max-height:297mm!important;margin:0!important;padding:0!important;overflow:hidden!important;background:#fff!important;border-radius:16px!important;box-shadow:0 20px 60px rgba(15,23,42,.16)!important;isolation:isolate!important;break-inside:avoid!important;page-break-inside:avoid!important;}
.cvyPageSlice{position:absolute!important;inset:0!important;width:210mm!important;height:297mm!important;overflow:hidden!important;background:#fff!important;}
.cvyPrintDocument{gap:0!important;display:block!important;}
.cvyPrintDocument .cvyPhysicalPage{border-radius:0!important;box-shadow:none!important;break-after:page!important;page-break-after:always!important;}
.cvyPrintDocument .cvyPhysicalPage:last-child{break-after:auto!important;page-break-after:auto!important;}

/* The source and every clipped page canvas must keep the same continuous layout. */
.cvyFlowRoot{width:210mm!important;min-width:210mm!important;max-width:210mm!important;height:auto!important;min-height:297mm!important;max-height:none!important;overflow:visible!important;contain:none!important;margin:0!important;zoom:1!important;}
.cvyPageCanvas{border-radius:0!important;box-shadow:none!important;pointer-events:none!important;}
.cvyFlowRoot :is(h1,h2,h3,h4,p,li,a,b,strong,span,small,time){min-width:0!important;max-width:100%!important;overflow-wrap:anywhere!important;word-break:break-word!important;hyphens:auto!important;}
.cvyFlowRoot :is(.cvEntry>div,.pdfEntry>div,.cv-item-head){min-width:0!important;flex-wrap:wrap!important;}
.cvyFlowRoot :is(.cvEntry time,.pdfEntry time,.cv-item time){white-space:normal!important;flex:0 1 auto!important;}
.cvyFlowRoot img,.cvyFlowRoot svg{max-width:100%!important;}

/* Generic cvPaper family. */
.cvyFlowRoot.cvPaper{grid-template-rows:auto minmax(calc(297mm - var(--cv-header-h,36mm)),auto)!important;align-items:stretch!important;}
.cvyFlowRoot.cvPaper .cvHeader{height:auto!important;min-height:var(--cv-header-h,36mm)!important;max-height:none!important;overflow:visible!important;}
.cvyFlowRoot.cvPaper .cvHeader :is(h1,h2,p){max-height:none!important;overflow:visible!important;display:block!important;-webkit-line-clamp:unset!important;-webkit-box-orient:initial!important;}
.cvyFlowRoot.cvPaper :is(.cvAside,.cvBody){height:auto!important;min-height:calc(297mm - var(--cv-header-h,36mm))!important;max-height:none!important;overflow:visible!important;align-content:start!important;}
.cvyFlowRoot.cvPaper :is(.cvSection,.cvAside>section){overflow:visible!important;break-inside:auto!important;page-break-inside:auto!important;}
.cvyFlowRoot.cvPaper:is(.layout-split,.layout-canvaSplitProfile){grid-template-rows:minmax(297mm,auto)!important;}
.cvyFlowRoot.cvPaper:is(.layout-split,.layout-canvaSplitProfile) .cvHeader{height:auto!important;min-height:297mm!important;max-height:none!important;align-self:stretch!important;}
.cvyFlowRoot.cvPaper:is(.layout-canvaSingleColumnAts,.layout-addonLegalClassic,.layout-addonAcademicModern,.layout-addonTeacherStructured) .cvHeader{height:auto!important;min-height:34mm!important;max-height:none!important;}
.cvyFlowRoot.cvPaper.layout-monoSwiss{display:block!important;grid-template-columns:none!important;grid-template-rows:none!important;}
.cvyFlowRoot.cvPaper.layout-monoSwiss .cvAside{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
.cvyFlowRoot.cvPaper.layout-monoSwiss .cvAside>section:first-child{grid-column:1/-1!important;}
.cvyFlowRoot.cvPaper.layout-monoSwiss :is(.cvAside,.cvBody){min-height:0!important;}
.cvyFlowRoot.cvPaper.layout-monoSwiss .cvBody{columns:auto!important;column-count:1!important;column-gap:0!important;display:block!important;}
.cvyFlowRoot.cvPaper.layout-modularImpact .cvBody{grid-template-columns:minmax(0,1fr)!important;}
.cvyFlowRoot.cvPaper.layout-modularImpact :is(.cvStats,.cvSection){grid-column:1!important;}

/* Imported pack family. */
.cvyFlowRoot.cv-page.cvPackBridge,.cvyFlowRoot.cv-page.cvPackBridge .cv-body{height:auto!important;min-height:297mm!important;max-height:none!important;overflow:visible!important;contain:none!important;align-items:stretch!important;}
.cvyFlowRoot.cv-page.cvPackBridge :is(.cv-sidebar,.cv-main){min-width:0!important;height:auto!important;min-height:297mm!important;max-height:none!important;overflow:visible!important;}
.cvyFlowRoot.cv-page.cvPackBridge .cv-section{overflow:visible!important;break-inside:auto!important;page-break-inside:auto!important;}
.cvyFlowRoot.cv-page.cvPackBridge.tpl-top-band .cv-sidebar{height:auto!important;min-height:72mm!important;max-height:none!important;overflow:visible!important;}
.cvyFlowRoot.cv-page.cvPackBridge.tpl-top-band .cv-main{height:auto!important;min-height:225mm!important;max-height:none!important;overflow:visible!important;}

/* PDF-inspired family. */
.cvyFlowRoot.pdfInspiredCv{align-items:stretch!important;}
.cvyFlowRoot.pdfInspiredCv :is(.pdfSide,.pdfMain){height:auto!important;min-height:297mm!important;max-height:none!important;overflow:visible!important;}
.cvyFlowRoot.pdfInspiredCv :is(.pdfMain>section,.pdfSide>section){overflow:visible!important;break-inside:auto!important;page-break-inside:auto!important;}

/* Uploaded premium family. */
.cvyFlowRoot.uploadedPremiumCv{height:auto!important;min-height:297mm!important;max-height:none!important;overflow:visible!important;contain:none!important;}
.cvyFlowRoot.uploadedPremiumCv :is(.upBlueTop,.upBlueGrid,.upBlackLeft,.upBlackRight,.upBrownHeader,.upBrownGrid,.upBrownGrid>div,.upBrownExperience){height:auto!important;max-height:none!important;overflow:visible!important;}
.cvyFlowRoot.uploadedPremiumCv .upBlueTop{min-height:131mm!important;}
.cvyFlowRoot.uploadedPremiumCv .upBlueGrid{min-height:166mm!important;}
.cvyFlowRoot.uploadedPremiumCv.layout-premiumBlackEditorial{grid-template-rows:minmax(297mm,auto)!important;align-items:stretch!important;}
.cvyFlowRoot.uploadedPremiumCv :is(.upBlackLeft,.upBlackRight){min-height:297mm!important;}
.cvyFlowRoot.uploadedPremiumCv .upBrownHeader{min-height:96mm!important;}
.cvyFlowRoot.uploadedPremiumCv .upBrownGrid{min-height:201mm!important;}
.cvyFlowRoot.uploadedPremiumCv .upBrownExperience{min-height:110mm!important;}
.cvyFlowRoot.uploadedPremiumCv :is(.upItem b,.upItem span,.upItem p,.upBlueTop section p,.upBlackRight section:first-of-type p,.upBrownGrid>div section:first-child p,.upBrownContact li,.upBlackContact li){max-height:none!important;overflow:visible!important;display:block!important;-webkit-line-clamp:unset!important;-webkit-box-orient:initial!important;}

@media(max-width:820px){.cvyPagedDocument{gap:7mm!important;}}

/* ===== CVYARAT v8.2.6: continuation-page offset hardening =====
   Physical pages are viewport windows over one continuous CV. The offset is
   applied with absolute top positioning rather than transform, because older
   template rules and some browser/PDF engines reset transforms on CV roots. */
.cvyPageSlice{position:absolute!important;inset:0!important;overflow:hidden!important;contain:paint!important;}
.cvyPageCanvas{
  position:absolute!important;
  left:0!important;
  right:auto!important;
  bottom:auto!important;
  transform:none!important;
  translate:none!important;
  scale:none!important;
  rotate:none!important;
  transform-origin:top left!important;
  margin:0!important;
  border-radius:0!important;
  box-shadow:none!important;
  pointer-events:none!important;
  will-change:auto!important;
}
.cvyContinuationPage .cvyPageCanvas{border-radius:0!important;box-shadow:none!important;}
.cvyFlowRoot :is(.cvHeader,.cvAside,.cvBody,.cv-body,.cv-sidebar,.cv-main,.pdfSide,.pdfMain,.upBlueTop,.upBlueGrid,.upBlackLeft,.upBlackRight,.upBrownHeader,.upBrownGrid,.upBrownExperience){
  position:relative!important;
  inset:auto!important;
  translate:none!important;
}
@media print{
  .cvyPageCanvas{transform:none!important;translate:none!important;}
  .cvyPhysicalPage{overflow:hidden!important;}
}
