/* CV Builder tool styles. */

.cv-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.cv-import-control { flex: 1 1 320px; }
.cv-import-control label { margin-top: 0; }
.cv-toolbar button { margin-top: 0; white-space: nowrap; }
.cv-template-chooser {
  margin-top: 22px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.018);
}
.cv-template-chooser-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.cv-template-chooser h2 { margin: 6px 0 3px; font-size: 1.55rem; }
.cv-template-chooser p { margin: 0; }
.cv-gallery-toggle { display: flex; gap: 7px; flex: 0 0 auto; }
.panel .cv-gallery-toggle button {
  margin: 0;
  padding: 9px 11px;
  background: transparent;
  font-size: .76rem;
}
.panel .cv-gallery-toggle button.active { border-color: var(--accent-2); background: var(--accent-soft); }
.cv-template-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.panel .cv-template-card {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 9px;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255,255,255,.02);
  text-align: left;
}
.panel .cv-template-card:hover { transform: translateY(-2px); }
.panel .cv-template-card.selected { border-color: var(--accent-2); box-shadow: 0 0 0 2px var(--accent-soft); }
.cv-template-card-preview {
  aspect-ratio: 210 / 297;
  overflow: hidden;
  border-radius: 7px;
  background: #d9dce3;
  pointer-events: none;
}
.cv-template-card-preview .cv-preview {
  width: 350.88%;
  min-height: 0;
  aspect-ratio: 210 / 297;
  transform: scale(.285);
  transform-origin: left top;
  box-shadow: none;
}
.cv-template-card-copy { display: block; padding: 11px 2px 2px; color: var(--text); }
.cv-template-card-copy strong { display: block; font-size: .92rem; }
.cv-template-card-copy > span { display: block; margin-top: 3px; color: var(--muted); font: 400 .76rem/1.4 Inter, sans-serif; }
.cv-template-selected {
  position: absolute;
  top: 17px;
  right: 17px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(9,7,16,.82);
  font: 700 .64rem/1 ui-monospace, monospace;
}
.cv-template-card.selected .cv-template-selected { background: var(--accent-strong); }
.cv-builder-shell {
  display: grid;
  grid-template-columns: minmax(340px, .9fr) minmax(420px, 1.1fr);
  gap: 22px;
  margin-top: 22px;
  align-items: start;
  scroll-margin-top: 110px;
}
.cv-editor {
  max-height: 78vh;
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.018);
  scrollbar-color: var(--border-strong) transparent;
}
.cv-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.cv-editor-heading:first-child { margin-top: 0; }
.cv-editor-heading h3 { margin: 0; font-size: 1rem; }
.cv-sample-editor-note {
  display: grid;
  gap: 3px;
  margin-bottom: 16px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 55%, var(--border));
  border-radius: 10px;
  color: var(--text);
  background: var(--accent-soft);
  font-size: .82rem;
}
.cv-sample-editor-note span { color: var(--muted); line-height: 1.45; }
.panel .cv-mini-btn {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: .75rem;
}
.cv-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.cv-field { min-width: 0; margin: 0; }
.cv-field > span { display: block; margin: 10px 0 6px; }
.cv-field-wide { grid-column: 1 / -1; }
.cv-field textarea { min-height: 105px; }
.cv-inline-editor {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}
.cv-inline-editor .cv-mini-btn { margin-bottom: 2px; }
.cv-skill-editor {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(150px, .9fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 8px;
}
.cv-skill-editor .cv-mini-btn { margin-bottom: 2px; }
.cv-skill-level-field input[type="range"] { width: 100%; accent-color: var(--accent); }
.cv-entry-editor {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.02);
}
.cv-entry-editor-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.cv-photo-row { display: flex; align-items: flex-end; gap: 10px; }
.cv-photo-row .cv-field { flex: 1; }
.cv-photo-row .cv-mini-btn { margin-bottom: 2px; }
.cv-empty-note { margin: 4px 0 12px; font-size: .88rem; }
.cv-check-row { display: flex; align-items: center; gap: 9px; margin-top: 14px; }
.cv-check-row input { width: auto; }
.cv-editor-save {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  padding: 15px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--accent-soft);
}
.cv-editor-save-copy { display: grid; gap: 3px; }
.cv-editor-save-copy span { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.panel .cv-editor-save button { flex: 0 0 auto; margin: 0; }
.cv-colour-field { padding: 0; border: 0; }
.cv-colour-field legend { margin: 10px 0 8px; color: var(--muted); }
.cv-colour-presets { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; min-height: 42px; }
.panel .cv-colour-dot {
  position: relative;
  width: 27px;
  height: 27px;
  margin: 0;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 50%;
  background: var(--cv-dot-colour);
  box-shadow: 0 0 0 1px rgba(255,255,255,.2);
}
.panel .cv-colour-dot:hover { transform: scale(1.08); }
.panel .cv-colour-dot[aria-pressed="true"] {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent-2);
}
.cv-field input[type="range"] { width: 100%; accent-color: var(--accent); }
.cv-preview-shell { position: sticky; top: 22px; min-width: 0; }
.cv-preview-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font: 500 .78rem/1.4 ui-monospace, monospace;
}
.cv-preview {
  --cv-accent: #6d38f2;
  --cv-font-size: 9px;
  width: 100%;
  min-height: 0;
  aspect-ratio: 210 / 297;
  overflow: hidden;
  color: #1d2433;
  background: #fff;
  box-shadow: 0 16px 46px rgba(0,0,0,.4);
  font-family: Arial, Helvetica, sans-serif;
  font-size: var(--cv-font-size);
  line-height: 1.35;
  position: relative;
}
.cv-preview > * { position: relative; z-index: 1; }
.cv-preview[data-paper="letter"] { aspect-ratio: 8.5 / 11; }
.cv-preview[data-font="serif"] { font-family: Georgia, "Times New Roman", serif; }
.cv-preview[data-font="mono"] { font-family: "Courier New", monospace; }
.cv-preview[data-spacing="tight"] { line-height: 1.2; }
.cv-preview[data-spacing="relaxed"] { line-height: 1.5; }
.cv-document-header { padding: 5.5% 7% 3.5%; }
.cv-document-identity h1 {
  margin: 0;
  color: inherit;
  font-size: 2.15em;
  line-height: 1.05;
  letter-spacing: -.035em;
}
.cv-document-title { margin: 5px 0 0; font-size: 1em; opacity: .75; }
.cv-document-contact { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: .78em; }
.cv-document-contact span { overflow-wrap: anywhere; }
.cv-document-photo {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 50%;
  flex: 0 0 auto;
}
.cv-document-layout { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(120px, .85fr); }
.cv-document-main { padding: 1% 4% 6% 7%; }
.cv-document-aside { padding: 1% 7% 6% 6%; }
.cv-document-section { margin: 0 0 1.05em; break-inside: avoid; }
.cv-document-section h2 {
  margin: 0 0 .45em;
  color: var(--cv-accent);
  font-size: 1.02em;
  line-height: 1.2;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.cv-document-section p { margin: 0 0 .45em; }
.cv-document-section ul { margin: .3em 0 0; padding-left: 1.15em; }
.cv-document-section li { margin: .1em 0; }
.cv-document-entry { margin-bottom: .78em; break-inside: avoid; }
.cv-document-entry-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.cv-document-entry-heading h3 { margin: 0; font-size: 1em; }
.cv-document-entry-heading span { flex: 0 0 auto; color: #697284; font-size: .76em; }
.cv-document-meta { margin: .1em 0 .28em; color: #697284; font-size: .78em; }
.cv-skill-list { display: grid; gap: .55em; }
.cv-skill-item { display: grid; gap: .26em; min-width: 0; }
.cv-skill-name { overflow-wrap: anywhere; font-size: .8em; }
.cv-skill-rating { display: flex; align-items: center; gap: 3px; }
.cv-skill-rating-bar { width: 100%; height: 4px; overflow: hidden; border-radius: 999px; background: #dfe3ea; }
.cv-skill-rating-bar i { display: block; height: 100%; border-radius: inherit; background: var(--cv-accent); }
.cv-skill-rating-stars { gap: 1px; font-size: .82em; line-height: 1; }
.cv-skill-rating-stars .cv-skill-symbol { color: #cdd2dc; }
.cv-skill-rating-stars .cv-skill-symbol.filled { color: var(--cv-accent); }
.cv-skill-rating-dots .cv-skill-symbol {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cdd2dc;
}
.cv-skill-rating-dots .cv-skill-symbol.filled { background: var(--cv-accent); }

.cv-template-modern {
  display: grid;
  grid-template-columns: 31% 69%;
  grid-template-rows: auto 1fr;
}
.cv-template-modern .cv-document-header {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 11px;
  padding: 11% 12% 6%;
  color: #fff;
  background: var(--cv-accent);
}
.cv-template-modern .cv-document-photo { width: 72px; height: 72px; }
.cv-template-modern .cv-document-identity h1 { font-size: 1.8em; letter-spacing: -.02em; }
.cv-template-modern .cv-document-title { font-size: .82em; letter-spacing: .12em; text-transform: uppercase; }
.cv-template-modern .cv-document-contact { display: flex; flex-direction: column; gap: 4px; margin-top: 5px; font-size: .72em; }
.cv-template-modern .cv-document-layout { display: contents; }
.cv-template-modern .cv-document-main { grid-column: 2; grid-row: 1 / 3; padding: 7% 8% 7%; }
.cv-template-modern .cv-document-aside {
  grid-column: 1;
  grid-row: 2;
  padding: 4% 12% 10%;
  color: #fff;
  background: var(--cv-accent);
}
.cv-template-modern .cv-document-aside .cv-document-section h2 { color: #fff; }
.cv-template-modern .cv-skill-list { gap: 0; }
.cv-template-modern .cv-skill-item {
  padding: 4px 0 5px;
  border-bottom: 2px solid rgba(255,255,255,.58);
}
.cv-template-modern .cv-skill-rating-bar { background: rgba(255,255,255,.28); }
.cv-template-modern .cv-skill-rating-bar i { background: #fff; }
.cv-template-modern .cv-skill-rating-stars .cv-skill-symbol { color: rgba(255,255,255,.34); }
.cv-template-modern .cv-skill-rating-stars .cv-skill-symbol.filled { color: #fff; }
.cv-template-modern .cv-skill-rating-dots .cv-skill-symbol { background: rgba(255,255,255,.34); }
.cv-template-modern .cv-skill-rating-dots .cv-skill-symbol.filled { background: #fff; }

.cv-template-classic { font-family: Georgia, "Times New Roman", serif; line-height: 1.24; }
.cv-template-classic .cv-document-header { padding: 4% 7% 1.5%; text-align: center; }
.cv-template-classic .cv-document-identity h1 { font-size: 1.9em; }
.cv-template-classic .cv-document-title { margin-top: 3px; }
.cv-template-classic .cv-document-contact { justify-content: center; }
.cv-template-classic .cv-document-layout { display: block; }
.cv-template-classic .cv-document-main,
.cv-template-classic .cv-document-aside { padding: 0 7% 2%; }
.cv-template-classic .cv-document-aside { padding-top: 0; }
.cv-template-classic .cv-document-section { margin-bottom: .62em; }
.cv-template-classic .cv-document-section {
  display: grid;
  grid-template-columns: 96px 1fr;
  column-gap: 12px;
  padding-top: .48em;
  border-top: 1px solid #9aa0aa;
}
.cv-template-classic .cv-document-section h2 { color: #1d2433; font-size: .8em; }
.cv-template-classic .cv-document-section > :not(h2) { grid-column: 2; }
.cv-template-classic .cv-skill-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55em 1.2em; }
.cv-template-classic .cv-document-entry { margin-bottom: .5em; }
.cv-template-classic .cv-document-section ul { margin-top: .15em; }

.cv-template-compact { line-height: 1.27; }
.cv-template-compact .cv-document-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 2.5%;
  border-bottom: 3px solid var(--cv-accent);
}
.cv-template-compact .cv-document-identity h1 { font-size: 2em; }
.cv-template-compact .cv-document-layout { grid-template-columns: minmax(0, 3fr) minmax(115px, 1fr); }
.cv-template-compact .cv-document-main { padding-bottom: 4%; }
.cv-template-compact .cv-document-aside { padding-bottom: 4%; }
.cv-template-compact .cv-document-section { margin-bottom: .58em; }
.cv-template-compact .cv-document-entry { margin-bottom: .56em; }
.cv-template-compact .cv-document-section h2 { color: #1d2433; border-bottom: 2px solid var(--cv-accent); padding-bottom: 4px; }
.cv-template-compact .cv-document-photo { width: 54px; height: 54px; border-radius: 8px; }
.cv-template-compact .cv-contact-list { display: flex; flex-direction: column; gap: 5px; margin: 0; font-size: .78em; }
.cv-template-compact .cv-contact-list span { overflow-wrap: anywhere; }
.cv-template-compact .cv-skill-list { gap: 0; }
.cv-template-compact .cv-skill-item {
  padding: 3px 0 4px;
  border-bottom: 2px solid color-mix(in srgb, var(--cv-accent) 70%, white);
}

.cv-template-editorial { line-height: 1.17; }
.cv-template-editorial .cv-document-header {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 8% 0 0;
  color: #111827;
  background: var(--cv-accent);
}
.cv-template-editorial .cv-document-header.cv-no-photo { padding: 5% 7%; }
.cv-template-editorial .cv-document-photo { width: 18%; height: auto; aspect-ratio: 1; border-radius: 0; }
.cv-template-editorial .cv-document-identity h1 { max-width: 12ch; font-size: 1.95em; text-transform: uppercase; }
.cv-template-editorial .cv-document-contact { margin-left: auto; max-width: 34%; }
.cv-template-editorial .cv-document-layout { display: block; }
.cv-template-editorial .cv-document-main,
.cv-template-editorial .cv-document-aside { padding: 1.5% 8% 0; }
.cv-template-editorial .cv-document-aside { padding-bottom: 2.5%; }
.cv-template-editorial .cv-document-section { margin-bottom: .38em; }
.cv-template-editorial .cv-document-entry { margin-bottom: .38em; }
.cv-template-editorial .cv-document-section h2 {
  display: inline-block;
  margin-bottom: .35em;
  padding: 2px 7px;
  color: #fff;
  background: #111827;
  font-size: .82em;
}
.cv-template-editorial .cv-skill-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 30px; }
.cv-template-editorial .cv-skill-item { padding: 0 0 5px; border-bottom: 3px solid #111827; }

/* Dense single-column ATS layout. */
.cv-template-pure_ats { line-height: 1.16; }
.cv-template-pure_ats .cv-document-header { padding: 4.5% 6% 1.4%; border-bottom: 1px solid #2a2a2a; }
.cv-template-pure_ats .cv-document-identity h1 { font-size: 1.55em; letter-spacing: 0; }
.cv-template-pure_ats .cv-document-title { margin-top: 2px; font-size: .84em; }
.cv-template-pure_ats .cv-document-contact { margin-top: 4px; gap: 2px 9px; font-size: .64em; }
.cv-template-pure_ats .cv-document-layout { display: block; }
.cv-template-pure_ats .cv-document-main,
.cv-template-pure_ats .cv-document-aside { padding: 1.2% 6% 2.5%; }
.cv-template-pure_ats .cv-document-aside { padding-top: 0; }
.cv-template-pure_ats .cv-document-section { margin-bottom: .42em; }
.cv-template-pure_ats .cv-document-section h2 {
  margin-bottom: .3em;
  padding-bottom: 2px;
  border-bottom: 1px solid #333;
  color: #171717;
  font-size: .76em;
  letter-spacing: .02em;
}
.cv-template-pure_ats .cv-document-entry { margin-bottom: .34em; }
.cv-template-pure_ats .cv-skill-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35em 1em; }

/* Strong section rules for specialist and technical resumes. */
.cv-template-specialist { font-family: Georgia, "Times New Roman", serif; line-height: 1.22; }
.cv-template-specialist .cv-document-header { padding: 5% 6% 2%; }
.cv-template-specialist .cv-document-identity h1 { font-size: 2em; letter-spacing: -.015em; }
.cv-template-specialist .cv-document-title { font-family: Arial, sans-serif; font-weight: 700; }
.cv-template-specialist .cv-document-contact { justify-content: flex-end; margin-top: 6px; font-size: .68em; }
.cv-template-specialist .cv-document-layout { display: block; }
.cv-template-specialist .cv-document-main,
.cv-template-specialist .cv-document-aside { padding: 1% 6% 3%; }
.cv-template-specialist .cv-document-aside { padding-top: 0; }
.cv-template-specialist .cv-document-section { margin-bottom: .7em; }
.cv-template-specialist .cv-document-section h2 {
  padding: 0 0 4px;
  border-bottom: 2px solid #222;
  color: #111;
  font-family: Arial, sans-serif;
  font-size: .94em;
  letter-spacing: 0;
  text-transform: none;
}
.cv-template-specialist .cv-document-entry { margin-bottom: .55em; }
.cv-template-specialist .cv-skill-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45em 1.5em; }

/* Minimal information rail. */
.cv-template-clean {
  display: grid;
  grid-template-columns: 28% 72%;
  grid-template-rows: auto 1fr;
  line-height: 1.25;
}
.cv-template-clean .cv-document-header { grid-column: 2; grid-row: 1; padding: 7% 8% 3%; border-bottom: 1px solid #d7d9dd; }
.cv-template-clean .cv-document-identity h1 { max-width: 12ch; font-size: 2.35em; text-transform: uppercase; }
.cv-template-clean .cv-document-title { font-size: .82em; }
.cv-template-clean .cv-document-layout { display: contents; }
.cv-template-clean .cv-document-main { grid-column: 2; grid-row: 2; padding: 3% 8% 6%; }
.cv-template-clean .cv-document-aside {
  grid-column: 1;
  grid-row: 1 / 3;
  padding: 13% 13% 8%;
  border-right: 1px solid #d7d9dd;
}
.cv-template-clean .cv-document-section { margin-bottom: .9em; }
.cv-template-clean .cv-document-section h2 { color: #161616; font-size: .9em; }
.cv-template-clean .cv-document-aside .cv-document-section h2::after {
  content: "";
  display: block;
  width: 22px;
  margin-top: 5px;
  border-bottom: 3px solid #181818;
}
.cv-template-clean .cv-skill-list { gap: .38em; }

/* Simple blue ATS layout. */
.cv-template-simple_ats { line-height: 1.22; }
.cv-template-simple_ats .cv-document-header { display: flex; align-items: center; gap: 14px; padding: 5% 6% 2.5%; }
.cv-template-simple_ats .cv-document-photo { order: 3; width: 58px; height: 58px; margin-left: auto; border-radius: 0; }
.cv-template-simple_ats .cv-document-identity h1 { color: var(--cv-accent); font-size: 2em; letter-spacing: 0; }
.cv-template-simple_ats .cv-document-contact { margin: 0 0 0 auto; max-width: 38%; justify-content: flex-end; text-align: right; font-size: .66em; }
.cv-template-simple_ats .cv-document-layout { display: block; }
.cv-template-simple_ats .cv-document-main,
.cv-template-simple_ats .cv-document-aside { padding: 1% 6% 3%; }
.cv-template-simple_ats .cv-document-aside { padding-top: 0; }
.cv-template-simple_ats .cv-document-section { margin-bottom: .62em; }
.cv-template-simple_ats .cv-document-section h2 {
  padding-bottom: 3px;
  border-bottom: 1px solid var(--cv-accent);
  color: var(--cv-accent);
  font-size: .95em;
  letter-spacing: 0;
  text-transform: none;
}
.cv-template-simple_ats .cv-document-entry { margin-bottom: .46em; }
.cv-template-simple_ats .cv-skill-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4em 1em; }

/* Formal corporate split. */
.cv-template-corporate { line-height: 1.2; }
.cv-template-corporate .cv-document-header { display: grid; justify-items: center; padding: 5% 7% 2.5%; text-align: center; }
.cv-template-corporate .cv-document-photo { width: 58px; height: 58px; border-radius: 3px; }
.cv-template-corporate .cv-document-identity h1 { margin-top: 8px; font-family: Georgia, serif; font-size: 1.9em; letter-spacing: .06em; }
.cv-template-corporate .cv-document-title { font-size: .72em; text-transform: uppercase; }
.cv-template-corporate .cv-document-layout { grid-template-columns: 29% 71%; margin: 0 6% 4%; border-top: 1px solid #d4d6da; }
.cv-template-corporate .cv-document-main { grid-column: 2; padding: 4% 0 3% 6%; }
.cv-template-corporate .cv-document-aside { grid-column: 1; grid-row: 1; padding: 4% 8% 3% 0; border-right: 1px solid #d4d6da; }
.cv-template-corporate .cv-document-section { margin-bottom: .62em; }
.cv-template-corporate .cv-document-section h2 { color: #181818; font-family: Georgia, serif; font-size: .82em; letter-spacing: .04em; }
.cv-template-corporate .cv-skill-list { gap: .35em; }

/* Fresh coloured header and skills rail. */
.cv-template-clear { line-height: 1.22; }
.cv-template-clear .cv-document-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4% 6% 0;
  padding: 0;
  background: color-mix(in srgb, var(--cv-accent) 68%, white);
}
.cv-template-clear .cv-document-photo { width: 29%; height: auto; aspect-ratio: 1; border-radius: 0; }
.cv-template-clear .cv-document-identity h1 { font-size: 1.9em; }
.cv-template-clear .cv-document-contact { margin: 8px 5% 8px auto; max-width: 40%; font-size: .66em; }
.cv-template-clear .cv-document-layout { grid-template-columns: 31% 69%; margin: 0 6% 4%; }
.cv-template-clear .cv-document-main { grid-column: 2; padding: 4% 0 3% 6%; }
.cv-template-clear .cv-document-aside { grid-column: 1; grid-row: 1; padding: 4% 9% 3% 0; }
.cv-template-clear .cv-document-section { margin-bottom: .65em; }
.cv-template-clear .cv-document-section h2 { color: #191919; font-size: .9em; letter-spacing: 0; text-transform: none; }
.cv-template-clear .cv-skill-list { gap: .32em; }

/* Warm precision timeline. */
.cv-template-precision_ats { font-family: Georgia, "Times New Roman", serif; line-height: 1.2; }
.cv-template-precision_ats .cv-document-header { display: flex; align-items: flex-start; padding: 5% 6% 2%; }
.cv-template-precision_ats .cv-document-identity h1 { color: var(--cv-accent); font-size: 2em; font-weight: 400; letter-spacing: 0; }
.cv-template-precision_ats .cv-document-title { color: var(--cv-accent); font-size: .76em; }
.cv-template-precision_ats .cv-document-contact { margin: 0 0 0 auto; max-width: 44%; justify-content: flex-end; text-align: right; color: var(--cv-accent); font-size: .64em; }
.cv-template-precision_ats .cv-document-layout { display: block; }
.cv-template-precision_ats .cv-document-main,
.cv-template-precision_ats .cv-document-aside { padding: 1% 6% 3%; }
.cv-template-precision_ats .cv-document-aside { padding-top: 0; }
.cv-template-precision_ats .cv-document-section { margin-bottom: .6em; }
.cv-template-precision_ats .cv-document-section h2 { color: var(--cv-accent); font-size: 1em; font-weight: 400; letter-spacing: 0; text-transform: none; }
.cv-template-precision_ats .cv-document-entry { margin-bottom: .52em; padding-bottom: .35em; border-bottom: 1px solid #ddd; }
.cv-template-precision_ats .cv-skill-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .42em 1.5em; }

/* Main ATS column with an auxiliary right rail. */
.cv-template-two_column_ats { line-height: 1.2; }
.cv-template-two_column_ats .cv-document-header { padding: 4.5% 6% 2%; }
.cv-template-two_column_ats .cv-document-identity h1 { color: var(--cv-accent); font-family: Georgia, serif; font-size: 1.9em; font-weight: 400; }
.cv-template-two_column_ats .cv-document-layout { grid-template-columns: minmax(0, 3.2fr) minmax(120px, .8fr); }
.cv-template-two_column_ats .cv-document-main { padding: 1% 4% 4% 6%; }
.cv-template-two_column_ats .cv-document-aside { padding: 1% 7% 4% 5%; }
.cv-template-two_column_ats .cv-document-section { margin-bottom: .6em; }
.cv-template-two_column_ats .cv-document-section h2 { color: var(--cv-accent); font-family: Georgia, serif; font-size: .92em; font-weight: 400; letter-spacing: 0; text-transform: none; }
.cv-template-two_column_ats .cv-document-entry { margin-bottom: .46em; }
.cv-template-two_column_ats .cv-skill-list { gap: .3em; }

/* Traditional body with a dark supporting sidebar. */
.cv-template-balanced {
  display: grid;
  grid-template-columns: 70% 30%;
  grid-template-rows: auto 1fr;
  line-height: 1.2;
}
.cv-template-balanced .cv-document-header { grid-column: 1; grid-row: 1; padding: 6% 7% 2.5%; }
.cv-template-balanced .cv-document-header.cv-has-photo { display: flex; align-items: center; gap: 12px; }
.cv-template-balanced .cv-document-photo { width: 48px; height: 48px; }
.cv-template-balanced .cv-document-identity h1 { font-size: 1.75em; }
.cv-template-balanced .cv-document-layout { display: contents; }
.cv-template-balanced .cv-document-main { grid-column: 1; grid-row: 2; padding: 1% 5% 5% 7%; }
.cv-template-balanced .cv-document-aside { grid-column: 2; grid-row: 1 / 3; padding: 16% 12% 8%; color: #fff; background: color-mix(in srgb, var(--cv-accent) 58%, #0e1a31); }
.cv-template-balanced .cv-document-section { margin-bottom: .62em; }
.cv-template-balanced .cv-document-section h2 { color: #1b1b1b; font-size: .88em; letter-spacing: 0; text-transform: none; }
.cv-template-balanced .cv-document-aside .cv-document-section h2 { color: #fff; }
.cv-template-balanced .cv-skill-list { gap: .35em; }
.cv-template-balanced .cv-skill-rating-bar { background: rgba(255,255,255,.28); }
.cv-template-balanced .cv-skill-rating-bar i { background: #fff; }

/* Soft full-width header for conservative ATS use. */
.cv-template-header_ats { line-height: 1.2; }
.cv-template-header_ats .cv-document-header { margin: 2% 2% 0; padding: 4% 5%; border-radius: 10px; background: color-mix(in srgb, var(--cv-accent) 24%, white); }
.cv-template-header_ats .cv-document-identity h1 { font-size: 2.25em; font-weight: 400; letter-spacing: 0; }
.cv-template-header_ats .cv-document-contact { margin: -2.6em 0 0 auto; max-width: 48%; justify-content: flex-end; text-align: right; font-size: .64em; }
.cv-template-header_ats .cv-document-layout { display: block; }
.cv-template-header_ats .cv-document-main,
.cv-template-header_ats .cv-document-aside { padding: 2.5% 6% 3%; }
.cv-template-header_ats .cv-document-aside { padding-top: 0; }
.cv-template-header_ats .cv-document-section { margin-bottom: .58em; }
.cv-template-header_ats .cv-document-section h2 { color: var(--cv-accent); font-size: 1.2em; font-weight: 400; letter-spacing: 0; text-transform: none; }
.cv-template-header_ats .cv-document-entry { margin-bottom: .44em; }
.cv-template-header_ats .cv-skill-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4em 1em; }

/* Compact right rail. */
.cv-template-essential_ats {
  display: grid;
  grid-template-columns: 74% 26%;
  grid-template-rows: auto 1fr;
  line-height: 1.17;
}
.cv-template-essential_ats .cv-document-header { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 10px; padding: 5% 5% 2%; }
.cv-template-essential_ats .cv-document-photo { width: 42px; height: 42px; border-radius: 5px; }
.cv-template-essential_ats .cv-document-identity h1 { font-size: 1.7em; }
.cv-template-essential_ats .cv-document-layout { display: contents; }
.cv-template-essential_ats .cv-document-main { grid-column: 1; grid-row: 2; padding: 1% 4% 4% 5%; }
.cv-template-essential_ats .cv-document-aside { grid-column: 2; grid-row: 1 / 3; padding: 14% 9% 5%; }
.cv-template-essential_ats .cv-document-section { margin-bottom: .5em; }
.cv-template-essential_ats .cv-document-section h2 { color: #171717; font-size: .82em; letter-spacing: 0; text-transform: none; }
.cv-template-essential_ats .cv-document-entry { margin-bottom: .38em; }
.cv-template-essential_ats .cv-skill-list { gap: .27em; }

/* Serif editorial body with right-hand expertise. */
.cv-template-polished {
  display: grid;
  grid-template-columns: 76% 24%;
  grid-template-rows: auto 1fr;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.18;
}
.cv-template-polished .cv-document-header { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 12px; padding: 5% 5% 2%; color: #202020; }
.cv-template-polished .cv-document-photo { width: 54px; height: 54px; border-radius: 0; }
.cv-template-polished .cv-document-identity h1 { color: var(--cv-accent); font-size: 1.85em; font-weight: 400; letter-spacing: 0; }
.cv-template-polished .cv-document-layout { display: contents; }
.cv-template-polished .cv-document-main { grid-column: 1; grid-row: 2; padding: 1% 5% 4%; }
.cv-template-polished .cv-document-aside { grid-column: 2; grid-row: 1 / 3; padding: 14% 10% 5%; }
.cv-template-polished .cv-document-section { margin-bottom: .54em; }
.cv-template-polished .cv-document-section h2 { color: #252525; font-size: .82em; font-weight: 400; letter-spacing: .1em; }
.cv-template-polished .cv-document-entry { margin-bottom: .42em; }
.cv-template-polished .cv-skill-list { gap: .3em; }

/* High-impact coloured banner. */
.cv-template-modern_banner { line-height: 1.18; }
.cv-template-modern_banner .cv-document-header { display: flex; align-items: center; gap: 13px; padding: 5% 6%; color: #fff; background: var(--cv-accent); }
.cv-template-modern_banner .cv-document-photo { width: 52px; height: 52px; }
.cv-template-modern_banner .cv-document-identity h1 { font-size: 1.9em; font-style: italic; }
.cv-template-modern_banner .cv-document-contact { margin: 0 0 0 auto; max-width: 46%; justify-content: flex-end; text-align: right; font-size: .64em; }
.cv-template-modern_banner .cv-document-layout { grid-template-columns: minmax(0, 3fr) minmax(120px, 1fr); padding: 0 4%; }
.cv-template-modern_banner .cv-document-main { padding: 4% 4% 4% 1%; }
.cv-template-modern_banner .cv-document-aside { padding: 4% 1% 4% 8%; border-left: 1px solid #d7d9df; }
.cv-template-modern_banner .cv-document-section { margin-bottom: .52em; }
.cv-template-modern_banner .cv-document-section h2 { color: #171717; font-size: .82em; letter-spacing: 0; text-transform: none; }
.cv-template-modern_banner .cv-document-entry { margin-bottom: .4em; }
.cv-template-modern_banner .cv-skill-list { gap: .28em; }

/* Creative split with abstract colour fields. */
.cv-template-creative {
  background:
    radial-gradient(circle at 91% 13%, color-mix(in srgb, var(--cv-accent) 28%, transparent) 0 12%, transparent 12.5%),
    radial-gradient(circle at 72% 95%, color-mix(in srgb, var(--cv-accent) 20%, transparent) 0 14%, transparent 14.5%),
    #fff;
  line-height: 1.18;
}
.cv-template-creative .cv-document-header { display: flex; align-items: center; gap: 14px; padding: 5% 6% 2%; }
.cv-template-creative .cv-document-photo { order: 3; width: 27%; height: auto; aspect-ratio: 1; margin-left: auto; border-radius: 36% 0 36% 36%; }
.cv-template-creative .cv-document-identity h1 { max-width: 8ch; color: color-mix(in srgb, var(--cv-accent) 68%, #102247); font-size: 3em; line-height: .9; }
.cv-template-creative .cv-document-title { color: color-mix(in srgb, var(--cv-accent) 70%, #102247); font-size: 1.1em; font-weight: 700; }
.cv-template-creative .cv-document-layout { grid-template-columns: 68% 32%; }
.cv-template-creative .cv-document-main { padding: 2% 4% 5% 6%; }
.cv-template-creative .cv-document-aside { padding: 2% 12% 5% 8%; }
.cv-template-creative .cv-document-section { margin-bottom: .54em; }
.cv-template-creative .cv-document-section h2 { color: color-mix(in srgb, var(--cv-accent) 70%, #102247); font-size: .86em; letter-spacing: 0; text-transform: none; }
.cv-template-creative .cv-document-entry { margin-bottom: .4em; }
.cv-template-creative .cv-skill-list { gap: .28em; }

/* Gentle contemporary paper with pastel washes. */
.cv-template-pastel {
  background:
    linear-gradient(125deg, rgba(255,226,221,.48), transparent 36%),
    linear-gradient(300deg, rgba(220,214,255,.42), transparent 42%),
    #fff;
  line-height: 1.2;
}
.cv-template-pastel .cv-document-header { display: flex; align-items: center; gap: 13px; padding: 5% 6% 2%; }
.cv-template-pastel .cv-document-photo { width: 48px; height: 48px; }
.cv-template-pastel .cv-document-identity h1 { font-size: 1.85em; }
.cv-template-pastel .cv-document-contact { margin: 0 0 0 auto; max-width: 42%; justify-content: flex-end; text-align: right; font-size: .64em; }
.cv-template-pastel .cv-document-layout { display: block; }
.cv-template-pastel .cv-document-main,
.cv-template-pastel .cv-document-aside { padding: 1% 6% 3%; }
.cv-template-pastel .cv-document-aside { padding-top: 0; }
.cv-template-pastel .cv-document-section { margin-bottom: .55em; }
.cv-template-pastel .cv-document-section h2 { color: #595766; font-size: .82em; letter-spacing: 0; text-transform: none; }
.cv-template-pastel .cv-document-entry { margin-bottom: .4em; }
.cv-template-pastel .cv-skill-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .38em 1.4em; }

/* Decorative organic portfolio layout. */
.cv-template-visionary {
  background:
    radial-gradient(ellipse at -4% 18%, color-mix(in srgb, var(--cv-accent) 24%, transparent) 0 19%, transparent 19.5%),
    radial-gradient(ellipse at 104% 82%, color-mix(in srgb, var(--cv-accent) 22%, transparent) 0 23%, transparent 23.5%),
    linear-gradient(135deg, #fffdf5, #f7f4e7);
  line-height: 1.18;
}
.cv-template-visionary .cv-document-header { display: grid; justify-items: center; padding: 5% 6% 2%; text-align: center; }
.cv-template-visionary .cv-document-photo { width: 58px; height: 58px; }
.cv-template-visionary .cv-document-identity h1 { margin-top: 5px; font-family: Georgia, serif; font-size: 2.2em; font-weight: 400; }
.cv-template-visionary .cv-document-title { color: var(--cv-accent); font-size: .68em; letter-spacing: .18em; text-transform: uppercase; }
.cv-template-visionary .cv-document-contact { justify-content: center; margin-top: 7px; font-size: .62em; }
.cv-template-visionary .cv-document-layout { grid-template-columns: 30% 70%; margin: 0 6% 4%; }
.cv-template-visionary .cv-document-main { grid-column: 2; padding: 3% 0 3% 6%; }
.cv-template-visionary .cv-document-aside { grid-column: 1; grid-row: 1; padding: 3% 10% 3% 0; }
.cv-template-visionary .cv-document-section { margin-bottom: .52em; }
.cv-template-visionary .cv-document-section h2 { color: var(--cv-accent); font-family: Georgia, serif; font-size: .82em; font-weight: 400; letter-spacing: .14em; }
.cv-template-visionary .cv-document-entry { margin-bottom: .4em; }
.cv-template-visionary .cv-skill-list { gap: .28em; }

/* User-controlled distance between document sections; 100% preserves each template's rhythm. */
.cv-preview .cv-document-section { margin-bottom: var(--cv-section-gap, 1.05em); }
.cv-preview .cv-document-section[data-section="experience"] .cv-document-entry { margin-bottom: 0; }
.cv-preview .cv-document-section[data-section="experience"] .cv-document-entry:not(:last-child) {
  margin-bottom: var(--cv-experience-gap, .78em);
}

.cv-pdf-export-stage {
  position: fixed;
  top: 0;
  left: -100000px;
  z-index: -1;
  background: #fff;
  pointer-events: none;
}

@media (max-width: 980px) {
  .cv-builder-shell { grid-template-columns: 1fr; }
  .cv-template-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cv-editor { max-height: none; }
  .cv-preview-shell { position: static; }
}

@media (max-width: 640px) {
  .cv-form-grid,
  .cv-inline-editor,
  .cv-skill-editor { grid-template-columns: 1fr; }
  .cv-inline-editor .cv-mini-btn,
  .cv-skill-editor .cv-mini-btn { justify-self: start; }
  .cv-toolbar { align-items: stretch; }
  .cv-toolbar button { width: 100%; }
  .cv-template-chooser-head { align-items: flex-start; flex-direction: column; }
  .cv-template-gallery { grid-template-columns: 1fr; }
  .cv-gallery-toggle { width: 100%; }
  .cv-gallery-toggle button { flex: 1; }
  .cv-editor-save { align-items: stretch; flex-direction: column; }
  .panel .cv-editor-save button { width: 100%; }
}
