
/* Builder nav (draggable sections) */
.stepRow{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:nowrap;
  width:100%;
  padding:10px 10px;
  border:1px solid #e2e8f0;
  border-radius:14px;
  background:#ffffff;
  box-shadow: 0 1px 0 rgba(2,6,23,0.03);
  /* Ensure the title never renders under the actions on the right */
  justify-content:space-between;
}
.stepRowActive{
  border-color:#0f172a;
}
.stepIcon{
  width:16px;
  text-align:center;
  font-size:12px;
}
.stepIcon:empty{
  display:none;
}
.stepHandle{
  width:16px;
  text-align:center;
  color:#94a3b8;
  cursor:grab;
  user-select:none;
}
.stepHandleDisabled{
  cursor:default;
  color:transparent;
}
.dragging .stepRow{
  opacity:0.6;
}
.dragOver .stepRow{
  outline: 2px dashed #94a3b8;
  outline-offset: 2px;
}
.stepBtn{
  flex:1 1 auto;
  text-align:left;
  font-size:13px;
  font-weight:600;
  color:#0f172a;
  /* Prevent the title from flowing under the action icons */
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  padding-right:6px;
}
.stepBtn:focus{
  outline:none;
}


.stepLeft{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1;
  min-width:0;
}
.stepActions{
  display:flex;
  align-items:center;
  gap:6px;
  /* Keep the action buttons from shrinking into the title area */
  flex-shrink:0;
}

/* (see later in file) Sidebar width guard for section titles */
.stepGear,.stepChevron,.stepTrash{
  width:28px;
  height:28px;
  border-radius:10px;
  border:1px solid #e2e8f0;
  background:#fff;
  font-size:14px;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.stepGear:hover,.stepChevron:hover,.stepTrash:hover{
  background:#f8fafc;
}
.stepRowHidden{
  opacity:0.55;
}
.stepHiddenPill{
  display:inline-block;
  margin-left:8px;
  padding:2px 8px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  border:1px solid #e2e8f0;
  color:#334155;
  background:#f8fafc;
  vertical-align:middle;
}
.stepMenu{
  position:absolute;
  z-index:50;
  width:220px;
  border:1px solid #e2e8f0;
  border-radius:14px;
  background:#fff;
  box-shadow:0 12px 24px rgba(2,6,23,0.12);
  padding:6px;
}
.stepMenuItem{
  width:100%;
  text-align:left;
  padding:10px 10px;
  border-radius:12px;
  font-size:13px;
  font-weight:600;
  color:#0f172a;
  background:transparent;
}
.stepMenuItem:hover{
  background:#f8fafc;
}
.stepMenuItem.danger{
  color:#b91c1c;
}
.stepMenuItem.danger:hover{
  background:#fef2f2;
}
.stepMenuSep{
  height:1px;
  background:#e2e8f0;
  margin:6px 0;
  border-radius:999px;
}

/* Sidebar sizing
   Keep it flexible so it never forces layout overlap at common laptop widths.
*/
.builderNav{
  min-width: 0;
  max-width: 100%;
}

/* Add section (sidebar) */
.addSectionBtn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:14px 12px;
  border-radius:16px;
  border:2px dashed #cbd5e1;
  background:#ecfccb; /* soft JobLeads-like lime */
  font-weight:800;
  color:#0f172a;
}
.addSectionBtn:hover{ filter:brightness(0.98); }
.addSectionBtnPlus{
  width:22px;
  height:22px;
  border-radius:999px;
  border:1px solid #0f172a;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
}

.addSectionMenu{
  position:absolute;
  left:0;
  right:0;
  bottom:calc(100% + 10px);
  z-index:40;
  border:1px solid #e2e8f0;
  border-radius:16px;
  background:#fff;
  box-shadow:0 14px 28px rgba(2,6,23,0.12);
  overflow:hidden;
}
.addSectionOption{
  width:100%;
  display:flex;
  gap:12px;
  padding:12px 12px;
  text-align:left;
  background:transparent;
}
.addSectionOption:hover{ background:#f8fafc; }
.addSectionOption:disabled{ opacity:0.55; cursor:not-allowed; }
.addSectionOptionIcon{
  width:28px;
  height:28px;
  border-radius:12px;
  border:1px solid #e2e8f0;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  background:#fff;
}
.addSectionOptionTitle{ font-size:13px; font-weight:800; color:#0f172a; }
.addSectionOptionDesc{ font-size:12px; color:#64748b; margin-top:2px; }

/* Live preview stage (A4 canvas) */
.previewStage{
  display:flex;
  justify-content:center;
  padding: 16px;
  overflow:auto;
  background: #ffffff;
  border-radius: 14px;
}

/* Screen */
.resumePage {
  width: 210mm;
  min-height: 297mm;
  background:#fff;
  border: 1px solid rgba(2,6,23,0.08);
  box-shadow: 0 12px 24px rgba(2,6,23,0.08);
  border-radius: 10px;
  overflow: hidden;
  transform-origin: top center;
}
/* Print / PDF */
@media print {
  .previewStage{ padding:0 !important; overflow: visible !important; background: transparent !important; }
  .resumePage{ transform:none !important; width: 210mm !important; min-height: auto !important; box-shadow:none !important; border:none !important; border-radius:0 !important; }

  @page { size: A4; margin: 10mm; }
  header, nav, footer, #btnDownload, #btnReset, #autosave, #stepList, #btnPrev, #btnNext, #stepTitle, #stepHint, #sectionNameRow, #stepContent, #templateSelect, #atsToggle {
    display: none !important;
  }
  main { padding: 0 !important; }
  section { box-shadow: none !important; }
  .resumePage { box-shadow: none !important; border: none !important; border-radius: 0 !important; }
  body { background: white !important; }

  /*
    Print mode used by the “Download PDF” button.
    This guarantees ONLY the resume preview is printed (no Builder UI).
  */
  body.print-cv-only * { visibility: hidden !important; }
  body.print-cv-only #resume,
  body.print-cv-only #resume * { visibility: visible !important; }
  body.print-cv-only #resume {
    position: absolute !important;
    left: 50% !important;
    top: 0 !important;
    transform: translateX(-50%) !important;
    width: 190mm !important;
    max-width: 190mm !important;
  }
  body.print-cv-only .resumePage {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
  }
}

/* Template: Modern */
.resume.modern {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: #0f172a;
}
.resume.modern .top {
  padding: 22px 22px 18px 22px;
  border-bottom: 1px solid #e2e8f0;
}
.resume.modern .name {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}
.resume.modern .title {
  margin-top: 6px;
  color: #334155;
  font-size: 13px;
}
.resume.modern .contact {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 10.8px;
  color: #475569;
}
.resume.modern .body {
  padding: 18px 22px 22px 22px;
}
.resume.modern .section {
  margin-top: 14px;
}
.resume.modern .sectionTitle {
  font-size: 10.8px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #0f172a;
  font-weight: 800;
}
.resume.modern .divider {
  height: 1px;
  background: #e2e8f0;
  margin-top: 6px;
}
.resume.modern .item {
  margin-top: 10px;
}
.resume.modern .itemHeader {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.resume.modern .itemTitle {
  font-weight: 700;
  font-size: 13px;
}
.resume.modern .itemMeta {
  font-size: 10.8px;
  color: #475569;
}
.resume.modern ul {
  margin-top: 6px;
  padding-left: 16px;
  font-size: 10.8px;
  color: #0f172a;
}
.resume.modern li { margin: 3px 0; }
.resume.modern .skills {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.resume.modern .skill {
  font-size: 10.8px;
  padding: 5px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
}

/* Template: Classic */
.resume.classic{
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, Helvetica, "Noto Sans", "Liberation Sans", sans-serif;
color:#0b1220;
}
.resume.classic .cTop{
  padding: 20px 24px 10px;
  text-align:center !important;
}
.resume.classic .cName{
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.resume.classic .cHeaderLine{
  margin-top: 6px;
  font-size: 11.8px;
  color: #0b1220;
  font-weight: 500;
}
.resume.classic .cBody{
  padding: 0 24px 18px;
}
.resume.classic 
.cRule{
  /* Legacy fallback (should not be used) */
  height: 1px;
  background: rgba(11, 18, 32, 0.8);
  opacity: 1;
}
.cRuleSvg{
  width: 100%;
  height: 1px;
  display: block;
}
.cRuleSvg line{
  stroke: rgba(11, 18, 32, 0.8);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  shape-rendering: crispEdges;
  stroke-linecap: square;
}

.resume.classic .cSection{
  margin-top: 10px;
}
.resume.classic .cRow{
  display:grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  padding: 8px 0;
}

.resume.classic .cSectionGrid3{
  display:grid;
  grid-template-columns: 150px 1fr 160px;
  column-gap: 16px;
  row-gap: 6px;
  padding: 8px 0;
}
.resume.classic .cDateLeft{
  font-size: 11.8px;
}
.resume.classic .cLabel{
  font-size: 10.4px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #0b1220;
  align-self: start;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.resume.classic .cContent{
  font-size: 12.6px;
  line-height: 1.5;
}

/* Repeated-entry sections (experience/education/custom) use .cMain blocks.
   Make them match .cContent so bullet/sub text is consistent with Projects. */
.resume.classic .cMain{
  font-size: 12.6px;
  line-height: 1.5;
}
.resume.classic .cPara{
  white-space: pre-wrap;
}
.resume.classic .cEntry{
  margin-top: 6px;
}
.resume.classic .cEntryGrid{
  display:grid;
  grid-template-columns: 105px 1fr 160px;
  gap: 16px;
  align-items: start;
}
.resume.classic .cDate{
  font-size: 10.4px;
}
.resume.classic .cLoc{
  font-size: 10.4px;
  text-align: right;
}
.resume.classic .cMainTitle{
  font-size: 12.2px;
  font-weight: 800;
}
.resume.classic .cSub{
  margin-top: 2px;
  font-size: 11.8px;
  font-weight: 700;
}
.resume.classic .cBullets{
  margin-top: 4px;
  padding-left: 0;
  margin-left: 0;
  list-style: none;
}

.resume.classic .cBullets li{
  position: relative;
  margin: 2px 0;
  padding-left: 12px;
}

.resume.classic .cBullets li::before{
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  transform: translateY(-50%);
  width: 3.2px;
  height: 3.2px;
  border-radius: 50%;
  background: #0b1220;
}

.resume.classic .cInline{
  font-size: 12.2px;
}


.resume.classic a{
  color:#0b1220;
  text-decoration:none;
}
.resume.classic .cTopRule{
  margin-bottom: 6px;
}
.resume.classic .cCertGrid{
  display:grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: baseline;
}
.resume.classic .cCertWhen{
  text-align:right;
  font-size: 11.4px;
  white-space: nowrap;
}

/* Classic: references layout (JobLeads-like) */
.resume.classic .cRefRow{
  display:grid;
  grid-template-columns: 1fr 180px;
  gap: 18px;
  align-items:start;
  margin-top: 6px;
}
.resume.classic .cRefName{
  font-weight: 800;
  font-size: 11.2px;
}
.resume.classic .cRefSub{
  margin-top: 2px;
  font-weight: 600;
}
.resume.classic .cRefContact{
  text-align: right;
  font-size: 10.6px;
}
.resume.classic .cRefDesc{
  margin-top: 4px;
  white-space: normal;
}


/* Editable section headings (Builder + CV stay in sync) */
.sectionTitleEditable{
  cursor:text;
  border-radius: 10px;
  padding: 2px 6px;
  display: inline-block;
}
.sectionTitleEditable:hover{
  background: rgba(148,163,184,0.18);
  outline: 1px dashed rgba(148,163,184,0.9);
  outline-offset: 2px;
}
.sectionTitleEditable:focus{
  outline: 2px solid #0f172a;
  background: rgba(15,23,42,0.08);
}

@media print {
  .sectionTitleEditable:hover,
  .sectionTitleEditable:focus{
    outline: none !important;
    background: none !important;
  }
}


/* Builder chips (JobLeads-like) */
.chipSkill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid #e2e8f0;
  background:#f7ffb1;
  font-size:12px;
}
.chipCheck{
  width:16px;
  height:16px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  border:1px solid rgba(11,18,32,0.25);
  background:#ffffff;
}
.chipText{ line-height:1; }
.chipX{
  border:none;
  background:transparent;
  font-size:14px;
  line-height:1;
  cursor:pointer;
  color:#0b1220;
  opacity:0.7;
}
.chipX:hover{ opacity:1; }

/* Builder: JobLeads-like entry rows (for multi-entry sections) */
.jlEntry{
  border-top: 1px solid #e2e8f0;
}
.jlEntry:first-child{
  border-top: 0;
}
.jlEntryHeader{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  background: #f3f0ea;
}
.jlEntryHandle{
  width: 18px;
  text-align: center;
  color: #94a3b8;
  user-select: none;
  cursor: grab;
}
.jlEntryHandleDisabled{
  cursor: default;
  color: transparent;
}
.jlEntryInfo{
  flex: 1;
  min-width: 0;
}
.jlEntryTitle{
  font-size: 14px;
  font-weight: 700;
  color: #0b1220;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jlEntrySub{
  margin-top: 2px;
  font-size: 10.8px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jlEntryActions{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.jlIconBtn{
  border: 0;
  background: transparent;
  padding: 6px;
  border-radius: 10px;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
}
.jlIconBtn:hover{
  background: rgba(15,23,42,0.06);
  color: #0b1220;
}
.jlEntryBody{
  padding: 12px;
  background: #ffffff;
}
.jlEntryDragOver{
  outline: 2px dashed #94a3b8;
  outline-offset: -2px;
}
.jlEntryDragging{
  opacity: 0.6;
}
.jlAddEntryBtn{
  width: 100%;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
}
.jlAddEntryBtn:hover{
  background: #f8fafc;
}
.jlAddEntryBtn .jlPlus{
  display:inline-flex;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(11,18,32,0.25);
  align-items:center;
  justify-content:center;
  margin-right: 8px;
  font-size: 10.8px;
}


/* Builder: inputs with leading icons (phone/email) */
.jlIconInput{
  position: relative;
}
.jlIconInput .jlIcon{
  position:absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #64748b;
  pointer-events:none;
}
/* Classic: skills 2-column list */
.resume.classic .cTwoCol{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
.resume.classic .cColItem{
  margin: 2px 0;
}

/* Classic: languages visualisation */
.resume.classic .cLangList{
  display:grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 90px;
  row-gap: 10px;
}
.resume.classic .cLangItem{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 18px;
}
.resume.classic .cLangName{
  display:inline-block;
  font-weight:700;
  border-bottom: 2px solid #0b1220;
  padding-bottom: 2px;
}
.resume.classic .cLangDesc{
  font-size:12px;
}
.resume.classic .cDots{
  display:inline-flex;
  gap: 14px;
  padding-bottom: 4px;
}
.resume.classic .cDot{
  width:5px;
  height:5px;
  border-radius:999px;
  background: rgba(11,18,32,0.25);
}
.resume.classic .cDot.on{
  background:#0b1220;
}

/* Classic: certificates */
.resume.classic .cCertEntry{
  margin-top: 6px;
}
.resume.classic .cDateInline{
  margin-top: 2px;
  font-size: 10.8px;
}


@media (max-width: 520px){
  .cLangList{ grid-template-columns: 1fr; column-gap: 0; }
}
