.builder-shell {
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1fr;
  height: calc(100vh - var(--header-h));
}

/*  Form column  */
.form-col {
  overflow-y: auto;
  border-right: 1px solid var(--border-subtle);
  padding: var(--space-md);
  background: var(--bg-primary);
  scrollbar-width: thin;
  scrollbar-color: var(--stone-brown) var(--bg-primary);
}
.form-col::-webkit-scrollbar {
  width: 8px;
}
.form-col::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
.form-col::-webkit-scrollbar-thumb {
  background: var(--stone-brown);
  border-radius: var(--radius-full);
}
.form-col::-webkit-scrollbar-thumb:hover {
  background: var(--dusty-taupe);
}
.form-col-inner {
  max-width: 460px;
  margin: 0 auto;
}

.import-panel {
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}
.import-panel-head {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.import-panel-head i {
  color: var(--accent);
  font-size: var(--fs-md);
  margin-top: 2px;
  flex-shrink: 0;
}
.import-panel-head strong {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  margin-bottom: 2px;
}
.import-panel-head p {
  margin: 0;
  font-size: var(--fs-xs);
}
.import-status {
  margin: var(--space-sm) 0 0;
  font-size: var(--fs-xs);
  min-height: 1.1em;
}
.import-status.is-success {
  color: #7fb88a;
}
.import-status.is-error {
  color: #d98787;
}

.builder-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.builder-toolbar .save-status {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-3xs);
}
.builder-toolbar .save-status i {
  color: var(--accent);
}

.template-switcher {
  display: flex;
  gap: var(--space-2xs);
  overflow-x: auto;
  padding-bottom: var(--space-2xs);
  margin-bottom: var(--space-md);
}
.template-chip {
  flex-shrink: 0;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  background: var(--bg-surface);
  transition: all var(--dur-fast) var(--ease-out);
}
.template-chip.active {
  border-color: var(--accent);
  color: var(--black);
  background: var(--accent);
}

.style-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.style-field label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-3xs);
}
.style-field select {
  width: 100%;
}
.tagstyle-toggle {
  display: flex;
  gap: var(--space-2xs);
}
.tagstyle-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3xs);
  padding: 0.55rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-primary);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  transition: all var(--dur-fast) var(--ease-out);
}
.tagstyle-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-surface-raised);
}
.color-swatches {
  display: flex;
  gap: var(--space-2xs);
  flex-wrap: wrap;
  align-items: center;
}
.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
}
.color-swatch.active {
  border-color: var(--white-smoke);
  transform: scale(1.12);
}
.text-color-auto {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  background: var(--bg-primary);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.text-color-auto.active {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.12);
}
#textColorPicker,
#accentColorPicker {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  overflow: hidden;
  background: none;
  cursor: pointer;
}
#textColorPicker::-webkit-color-swatch-wrapper,
#accentColorPicker::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}
#textColorPicker::-webkit-color-swatch,
#accentColorPicker::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.accordion {
  margin-bottom: var(--space-md);
}
.reorder-hint {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin: 0 0 var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-3xs);
}
.reorder-hint i {
  color: var(--accent);
}
.accordion-section {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  background: var(--bg-surface);
  overflow: hidden;
}
.accordion-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
}
.accordion-section[draggable="true"] {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  cursor: grab;
  position: relative;
}
.accordion-section[draggable="true"] .accordion-head {
  flex: 1;
  padding-left: var(--space-2xs);
}
.accordion-section[draggable="true"] .accordion-body {
  width: 100%;
}
.drag-handle {
  flex-shrink: 0;
  width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: grab;
  touch-action: none;
}
.drag-handle:hover {
  color: var(--accent);
}
.accordion-section.dragging {
  opacity: 0.4;
}
.accordion-section.drag-over-top {
  box-shadow: inset 0 3px 0 var(--accent);
}
.accordion-section.drag-over-bottom {
  box-shadow: inset 0 -3px 0 var(--accent);
}
.accordion-head i.chevron {
  transition: transform var(--dur-base) var(--ease-out);
  color: var(--text-muted);
}
.accordion-section.open .chevron {
  transform: rotate(180deg);
}
.accordion-body {
  padding: 0 var(--space-md) var(--space-md);
  display: none;
}
.accordion-section.open .accordion-body {
  display: block;
}

.form-row {
  margin-bottom: var(--space-sm);
}
.form-row label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-3xs);
  font-weight: var(--fw-medium);
}
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="tel"],
.form-row input[type="url"],
.form-row input[type="month"],
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
  border-color: var(--accent);
  outline: none;
}
.form-row textarea {
  resize: vertical;
  min-height: 76px;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.upload-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.upload-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-surface-raised);
  border: 1px dashed var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  overflow: hidden;
  flex-shrink: 0;
}
.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-btns {
  display: flex;
  gap: var(--space-2xs);
}

.entry-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
  position: relative;
  background: var(--bg-primary);
}
.entry-card .entry-remove {
  position: absolute;
  top: var(--space-2xs);
  right: var(--space-2xs);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.entry-card .entry-remove:hover {
  color: var(--accent);
}

.add-entry-btn {
  width: 100%;
  padding: 0.7rem;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  transition:
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.add-entry-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tag-input-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  padding: 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  padding: 0.3rem 0.6rem;
  background: var(--bg-surface-raised);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
}
.tag-pill button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}
.tag-input-wrap input {
  flex: 1;
  min-width: 100px;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: var(--fs-sm);
  padding: 0.3rem;
}
.tag-input-wrap input:focus {
  outline: none;
}

.builder-actions {
  position: sticky;
  bottom: 0;
  background: var(--bg-primary);
  padding-top: var(--space-sm);
}
.builder-actions .btn {
  width: 100%;
}

/* Preview column  */
.preview-col {
  overflow-y: auto;
  background: var(--gray-800);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-xl) var(--space-md);
  scrollbar-width: thin;
  scrollbar-color: var(--dusty-taupe) var(--gray-800);
}
.preview-col::-webkit-scrollbar {
  width: 8px;
}
.preview-col::-webkit-scrollbar-track {
  background: var(--gray-800);
}
.preview-col::-webkit-scrollbar-thumb {
  background: var(--dusty-taupe);
  border-radius: var(--radius-full);
}
.preview-col::-webkit-scrollbar-thumb:hover {
  background: var(--white-smoke);
}
.preview-toolbar {
  width: 100%;
  max-width: 820px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}
.page-count-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--fs-xs);
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
}
.page-count-badge i {
  color: var(--accent);
}
.cv-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
}
.cv-page-sheet {
  width: 100%;
  max-width: 820px;
  aspect-ratio: 210 / 297;
  background: #ffffff;
  color: #1a1a1a;
  box-shadow: var(--shadow-lg);
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  padding: 3rem 3.2rem;
  flex-shrink: 0;
}
.cv-page-sheet.tpl-creative {
  background: #1c1c1a;
  color: #f2f0ec;
}
.cv-page-sheet.tpl-professional {
  padding: 0;
}
.cv-page-sheet .cv {
  height: 100%;
}
.cv-page-number {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #a39d92;
  z-index: 2;
}
.tpl-creative .cv-page-number {
  color: #8f897e;
}
.tpl-professional .cv-page-number {
  color: #c7c2b8;
}

@media (max-width: 640px) {
  .cv-page-sheet:not(.tpl-professional) {
    padding: 1.6rem 1.4rem;
  }
  .cv-page-sheet.tpl-professional .cv-sidebar,
  .cv-page-sheet.tpl-professional .cv-main {
    padding: 1.6rem 1.2rem;
  }
}

@media (max-width: 1024px) {
  .builder-shell {
    grid-template-columns: 1fr;
    height: auto;
  }
  .form-col {
    order: 1;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    max-height: none;
    width: 100%;
  }
  .form-col-inner {
    max-width: 100%;
  }
  .preview-col {
    order: 2;
    padding: var(--space-md);
  }
  .style-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .builder-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2xs);
  }
}

/* 
   CV TEMPLATE STYLES (rendered inside #cvPage)
    */
.cv-page-sheet * {
  box-sizing: border-box;
}
.cv {
  font-family: var(--cv-font, "Poppins", sans-serif);
  line-height: 1.5;
  color: var(--cv-text-color, inherit);
}
.cv h1,
.cv h2,
.cv h3 {
  font-family: var(--cv-font, "Poppins", sans-serif);
  margin: 0;
}
.cv a {
  color: inherit;
}
.cv .cv-section {
  margin-top: 1.6rem;
}
.cv .cv-section-title {
  font-size: 0.78rem;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--cv-accent, #5e503f);
  margin-bottom: 0.6rem;
}
.cv .cv-entry {
  margin-bottom: 0.9rem;
}
.cv .cv-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--cv-text-color, inherit);
}
.cv .cv-entry-sub {
  font-size: 0.82rem;
  color: var(--cv-text-color, #6b6b6b);
  margin-bottom: 0.25rem;
}
.cv .cv-entry-desc {
  font-size: 0.86rem;
  color: var(--cv-text-color, #333);
  white-space: pre-line;
}
.cv .cv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cv .cv-tag {
  display: inline-block;
  line-height: 1;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--cv-text-color, #4a453d);
  vertical-align: middle;
}
/* Bubble variant: soft filled pill */
.cv .cv-tags.tagstyle-bubble .cv-tag {
  padding: 0.36rem 0.9rem;
  border-radius: 999px;
  background: #f3f1ec;
  border: 1px solid #e6e2d8;
}
/* Rectangle variant: outlined box, echoes the site's button shape */
.cv .cv-tags.tagstyle-rect .cv-tag {
  padding: 0.32rem 0.85rem;
  border-radius: 6px;
  background: transparent;
  border: 1.5px solid var(--cv-accent, #5e503f);
  color: var(--cv-text-color, #3a352e);
}
.cv .cv-avatar {
  border-radius: 50%;
  object-fit: cover;
  background: #e7e4de;
}
.cv .cv-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  font-size: 0.82rem;
  color: var(--cv-text-color, #555);
}
.cv .cv-contact span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.cv .cv-contact a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.cv .cv-contact a:hover {
  border-bottom-color: currentColor;
}

.cv .cv-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}
.cv .cv-social-links a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  width: 56px;
}
.cv .cv-social-links .social-icon {
  width: 32px;
  height: 32px;
  line-height: 32px;
  border-radius: 50%;
  background: #f0efec;
  color: var(--cv-accent, #5e503f);
  text-align: center;
  font-size: 0.85rem;
  transition: transform 150ms ease;
}
.cv .cv-social-links a:hover .social-icon {
  transform: translateY(-2px);
}
.cv .cv-social-links .social-label {
  font-size: 0.66rem;
  color: var(--cv-text-color, #6b6b6b);
  text-align: center;
}
.cv .cv-summary-text {
  font-size: 0.88rem;
  color: var(--cv-text-color, #333);
  margin: 0;
}
.cv .cv-personal-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1.5rem;
  font-size: 0.85rem;
  color: var(--cv-text-color, #333);
}
.cv .cv-personal-details .pd-label {
  font-weight: 600;
  color: var(--cv-text-color, #555);
}

/* Modern */
.cv-modern .cv-header {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  padding-bottom: 1.4rem;
  border-bottom: 3px solid var(--cv-accent, #5e503f);
}
.cv-modern .cv-avatar {
  width: 84px;
  height: 84px;
}
.cv-modern .cv-name {
  font-size: 2rem;
  font-weight: 800;
}
.cv-modern .cv-role {
  color: var(--cv-accent, #5e503f);
  font-weight: 600;
  margin: 0.2rem 0 0.5rem;
}

/* Minimal */
.cv-minimal .cv-header {
  text-align: center;
  padding-bottom: 1.2rem;
}
.cv-minimal .cv-avatar {
  margin: 0 auto 0.8rem;
}
.cv-minimal .cv-name {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.cv-minimal .cv-role {
  color: #777;
  margin: 0.3rem 0 0.7rem;
}
.cv-minimal .cv-contact {
  justify-content: center;
}
.cv-minimal .cv-section-title {
  text-align: center;
}
.cv-minimal hr {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 1.4rem 0 0;
}

/* Classic */
.cv-classic {
  border-left: 6px solid var(--cv-accent, #5e503f);
  padding-left: 1.8rem;
}
.cv-classic .cv-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.cv-classic .cv-avatar {
  width: 76px;
  height: 76px;
  border: 2px solid var(--cv-accent, #5e503f);
}
.cv-classic .cv-name {
  font-size: 1.85rem;
  font-weight: 700;
  font-family: Georgia, "Times New Roman", serif;
}
.cv-classic .cv-role {
  color: #555;
  font-style: italic;
  margin: 0.2rem 0 0.6rem;
}
.cv-classic .cv-section-title {
  font-family: Georgia, serif;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
}

/* Compact */
.cv-compact {
  font-size: 0.92rem;
}
.cv-compact .cv-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--cv-accent, #5e503f);
}
.cv-compact .cv-avatar {
  width: 64px;
  height: 64px;
}
.cv-compact .cv-name {
  font-size: 1.5rem;
  font-weight: 700;
}
.cv-compact .cv-role {
  color: var(--cv-accent, #5e503f);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0.1rem 0 0.4rem;
}
.cv-compact .cv-section {
  margin-top: 1.1rem;
}
.cv-compact .cv-entry {
  margin-bottom: 0.6rem;
}
.cv-compact .cv-entry-head {
  font-size: 0.88rem;
}
.cv-compact .cv-entry-desc {
  font-size: 0.8rem;
}
.cv-compact .cv-contact {
  font-size: 0.76rem;
  gap: 0.6rem;
}

/* Executive */
.cv-executive .cv-header-banner {
  background: var(--cv-accent, #5e503f);
  color: #ffffff;
  margin: -3rem -3.2rem 1.7rem;
  padding: 2.2rem 3.2rem 1.5rem;
}
.cv-executive .cv-banner-inner {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1rem;
}
.cv-executive .cv-avatar {
  border: 3px solid rgba(255, 255, 255, 0.5);
}
.cv-executive .cv-name {
  font-size: 1.9rem;
  font-weight: 800;
  color: #ffffff;
}
.cv-executive .cv-role {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  letter-spacing: 0.03em;
}
.cv-executive .cv-banner-contact .cv-contact {
  color: rgba(255, 255, 255, 0.85);
}
.cv-executive .cv-section-title {
  border-bottom: 2px solid var(--cv-accent, #5e503f);
  padding-bottom: 0.35rem;
}
@media (max-width: 640px) {
  .cv-executive .cv-header-banner {
    margin: -1.6rem -1.4rem 1.3rem;
    padding: 1.4rem 1.4rem 1.1rem;
  }
}

/* Corporate */
.cv-corporate .cv-corp-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.cv-corporate .cv-corp-rule {
  height: 3px;
  background: var(--cv-accent, #5e503f);
  margin: 1rem 0 0.9rem;
  border-radius: 2px;
}
.cv-corporate .cv-contact {
  gap: 0;
}
.cv-corporate .cv-contact span {
  padding: 0 0.8rem;
  border-right: 1px solid #ddd;
}
.cv-corporate .cv-contact span:first-child {
  padding-left: 0;
}
.cv-corporate .cv-contact span:last-child {
  border-right: none;
}
.cv-corporate .cv-section-title {
  background: var(--cv-accent, #5e503f);
  color: #ffffff;
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 3px;
}

/* Elegant */
.cv-elegant .cv-header-elegant {
  text-align: center;
}
.cv-elegant .cv-avatar {
  margin: 0 auto 0.9rem;
}
.cv-elegant .cv-name {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.cv-elegant .cv-role {
  color: var(--cv-accent, #5e503f);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin: 0.35rem 0 1rem;
}
.cv-elegant .cv-elegant-rule {
  width: 56px;
  height: 2px;
  background: var(--cv-accent, #5e503f);
  margin: 0 auto 1.1rem;
}
.cv-elegant .cv-contact {
  justify-content: center;
}
.cv-elegant .cv-section-title {
  text-align: center;
  letter-spacing: 0.18em;
}

/* Creative */
.cv-creative .cv-header {
  display: flex;
  align-items: center;
  gap: 1.3rem;
}
.cv-creative .cv-avatar {
  width: 90px;
  height: 90px;
  border: 3px solid var(--cv-accent, #a9927d);
}
.cv-creative .cv-name {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--cv-text-color, #f2f0ec);
}
.cv-creative .cv-role {
  color: var(--cv-accent, #a9927d);
  font-weight: 600;
}
.cv-creative .cv-contact {
  color: var(--cv-text-color, #cfcac2);
}
.cv-creative .cv-section-title {
  color: var(--cv-accent, #a9927d);
}
.cv-creative .cv-entry-sub {
  color: var(--cv-text-color, #b8b3ac);
}
.cv-creative .cv-entry-desc {
  color: var(--cv-text-color, #dcd9d3);
}
.cv-creative .cv-entry-head {
  color: var(--cv-text-color, #f2f0ec);
}
.cv-creative .cv-summary-text {
  color: var(--cv-text-color, #dcd9d3);
}
.cv-creative .cv-tags.tagstyle-bubble .cv-tag {
  background: #2c2c28;
  border-color: #3a3a35;
  color: var(--cv-text-color, #f2f0ec);
}
.cv-creative .cv-tags.tagstyle-rect .cv-tag {
  border-color: var(--cv-accent, #a9927d);
  color: var(--cv-text-color, #f2f0ec);
}
.cv-creative .cv-personal-details {
  color: var(--cv-text-color, #dcd9d3);
}
.cv-creative .cv-personal-details .pd-label {
  color: var(--cv-text-color, #b8b3ac);
}
.cv-creative .cv-social-links .social-icon {
  background: #2c2c28;
  color: var(--cv-accent, #a9927d);
}
.cv-creative .cv-social-links .social-label {
  color: var(--cv-text-color, #b8b3ac);
}

/* Professional (sidebar) */
.cv-professional {
  display: grid;
  grid-template-columns: 32% 1fr;
  height: 100%;
}
.cv-professional .cv-sidebar {
  background: #22333b;
  color: var(--cv-text-color, #f2f4f3);
  padding: 3rem 1.6rem;
  overflow: hidden;
}
.cv-professional .cv-main {
  padding: 3rem 1.8rem;
  overflow: hidden;
}
.cv-professional .cv-avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 1rem;
}
.cv-professional .cv-name {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
}
.cv-professional .cv-role {
  text-align: center;
  color: var(--cv-accent, #a9927d);
  margin: 0.2rem 0 1.2rem;
  font-size: 0.9rem;
}
.cv-professional .cv-sidebar .cv-section-title {
  color: var(--cv-accent, #a9927d);
}
.cv-professional .cv-sidebar .cv-contact {
  flex-direction: column;
  gap: 0.5rem;
  color: var(--cv-text-color, #f2f4f3);
}
.cv-professional .cv-sidebar .cv-tags.tagstyle-bubble .cv-tag {
  background: rgba(242, 244, 243, 0.12);
  border-color: rgba(242, 244, 243, 0.18);
  color: var(--cv-text-color, #f2f4f3);
}
.cv-professional .cv-sidebar .cv-tags.tagstyle-rect .cv-tag {
  border-color: var(--cv-accent, #a9927d);
  color: var(--cv-text-color, #f2f4f3);
}
.cv-professional .cv-sidebar .cv-social-links .social-icon {
  background: rgba(242, 244, 243, 0.12);
  color: var(--cv-accent, #a9927d);
}
.cv-professional .cv-sidebar .cv-social-links .social-label {
  color: var(--cv-text-color, #cfcac2);
}
.cv-professional .cv-sidebar .cv-contact a {
  color: var(--cv-text-color, #f2f4f3);
}

@media print {
  .form-col,
  .site-header,
  .preview-toolbar {
    display: none !important;
  }
  .preview-col {
    padding: 0 !important;
    overflow: visible !important;
  }
  .cv-pages {
    gap: 0;
  }
  .cv-page-sheet {
    box-shadow: none !important;
    max-width: none !important;
    width: 210mm !important;
    height: 297mm !important;
    aspect-ratio: auto !important;
    page-break-after: always;
    break-after: page;
  }
  .cv-page-sheet:last-child {
    page-break-after: auto;
    break-after: auto;
  }
  .cv-page-number {
    display: none !important;
  }
  @page {
    size: A4;
    margin: 0;
  }
}

/* 
   PDF EXPORT MODE
   Applied only to an off-screen clone used by pdfExport.js.
   Forces the exact desktop/A4 layout (fixed px size + desktop
   padding) no matter what the real device's viewport width is,
   so exporting from a phone never captures the shrunk mobile
   layout that the @media (max-width:640px) rules above produce.
   */
.cv-page-sheet.pdf-export-mode {
  box-shadow: none !important;
  max-width: none !important;
  flex-shrink: 0 !important;
}
.cv-page-sheet.pdf-export-mode:not(.tpl-professional) {
  padding: 3rem 3.2rem !important;
}
.cv-page-sheet.pdf-export-mode.tpl-professional {
  padding: 0 !important;
}
.cv-page-sheet.pdf-export-mode.tpl-professional .cv-sidebar {
  padding: 3rem 1.6rem !important;
}
.cv-page-sheet.pdf-export-mode.tpl-professional .cv-main {
  padding: 3rem 1.8rem !important;
}

/* Icon glyphs (Font Awesome) can carry an inherited line-height taller than
   their own box, which shifts them within flex-centered pills/circles and
   is what was eating the bottom padding on skill/hobby tags and the round
   social icons once rasterized. Pinning this keeps screen and PDF in sync. */
.cv .cv-tag i,
.cv .social-icon i {
  line-height: 1;
}
