.cv-hero { position: relative; }

.cv-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(var(--text-rgb),0.5);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 20px;
  transition: color .2s;
}
.cv-back-link:hover { color: var(--text-main); }
.cv-back-link svg { width: 14px; height: 14px; }

.cv-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 80px;
  align-items: start;
}

.cv-form-col {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.cv-section {
  background: rgba(var(--text-rgb),0.04);
  border: 1px solid rgba(var(--text-rgb),0.09);
  border-radius: 16px;
  padding: 22px 20px;
}

.cv-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.cv-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(var(--text-rgb),0.4);
  margin-bottom: 16px;
}

.cv-section-head .cv-section-title { margin-bottom: 0; }

.cv-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(var(--text-rgb),0.2);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 50px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.cv-add-btn:hover { border-color: rgba(var(--text-rgb),0.5); background: rgba(var(--text-rgb),0.05); }
.cv-add-btn svg { width: 13px; height: 13px; }

.cv-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.cv-field-full { grid-column: 1 / -1; }

.cv-field { display: flex; flex-direction: column; gap: 6px; }

.cv-field label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(var(--text-rgb),0.55);
}

.cv-field input,
.cv-field select,
.cv-field textarea {
  background: rgba(var(--text-rgb),0.06);
  border: 1px solid rgba(var(--text-rgb),0.15);
  color: var(--text-main);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

.cv-field input:focus,
.cv-field select:focus,
.cv-field textarea:focus {
  outline: none;
  border-color: rgba(var(--text-rgb),0.4);
}

.cv-field-hint {
  font-size: 11px;
  color: rgba(var(--text-rgb),0.35);
}

.cv-entry {
  position: relative;
  padding: 16px 40px 4px 0;
  border-top: 1px solid rgba(var(--text-rgb),0.07);
  margin-top: 16px;
}
.cv-entry:first-child { border-top: none; margin-top: 0; padding-top: 0; }

.cv-remove-btn {
  position: absolute;
  top: 14px;
  right: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
}
.cv-entry:first-child .cv-remove-btn { top: 0; }
.cv-remove-btn svg { width: 12px; height: 12px; }

.cv-range-row { display: flex; align-items: center; gap: 10px; }
.cv-range-row input[type="range"] { flex: 1; }
.cv-range-value { font-size: 12px; font-weight: 600; color: rgba(var(--text-rgb),0.55); width: 30px; text-align: right; }

.cv-tpl-options { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }

.cv-tpl-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: rgba(var(--text-rgb),0.03);
  border: 1px solid rgba(var(--text-rgb),0.14);
  border-radius: 12px;
  padding: 10px 16px;
  color: rgba(var(--text-rgb),0.65);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.cv-tpl-option:hover { border-color: rgba(var(--text-rgb),0.35); }
.cv-tpl-option.active { border-color: var(--text-main); background: rgba(var(--text-rgb),0.08); color: var(--text-main); }

.cv-tpl-swatch { width: 38px; height: 26px; border-radius: 5px; display: block; }
.cv-tpl-swatch-classic { background: #fff; border: 1px solid #d5d5d5; }
.cv-tpl-swatch-sidebar { background: linear-gradient(90deg, #4338ca 40%, #ececec 40%); }
.cv-tpl-swatch-moderne { background: linear-gradient(180deg, #4338ca 34%, #fff 34%); }

.cv-color-label { margin: 0 0 10px; }

.cv-color-options { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.cv-color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
}
.cv-color-swatch.active { border-color: var(--text-main); }

.cv-color-custom {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(var(--text-rgb),0.2);
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: transparent;
}

.cv-photo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }

.cv-photo-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(var(--text-rgb),0.06);
  border: 1px solid rgba(var(--text-rgb),0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.cv-photo-circle img { width: 100%; height: 100%; object-fit: cover; }
.cv-photo-circle svg { width: 26px; height: 26px; color: rgba(255,255,255,0.35); }

.cv-photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cv-photo-error { width: 100%; color: var(--text-main); font-weight: 700; }

.cv-preview-col {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cv-preview-toolbar { display: flex; justify-content: flex-end; }

.cv-preview-frame {
  background: rgba(var(--text-rgb),0.03);
  border: 1px solid rgba(var(--text-rgb),0.09);
  border-radius: 16px;
  padding: 18px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.cv-preview {
  background: #fff;
  color: #1a1a1a;
  border-radius: 4px;
  padding: 36px 32px;
  font-family: Arial, sans-serif;
  min-height: 400px;
}

.cv-tpl-sidebar.cv-preview,
.cv-tpl-moderne.cv-preview {
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
}

.cv-pv-empty {
  color: #999;
  font-size: 13px;
  text-align: center;
  padding: 60px 10px;
}

.cv-pv-header { display: flex; align-items: center; gap: 16px; border-bottom: 2px solid var(--cv-accent, #1a1a1a); padding-bottom: 14px; margin-bottom: 18px; }
.cv-pv-photo { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cv-pv-header-text { flex: 1; min-width: 0; }
.cv-pv-name { font-size: 26px; font-weight: 800; margin: 0 0 4px; }
.cv-pv-title-line { font-size: 14px; color: #444; margin: 0 0 8px; }
.cv-pv-contact { font-size: 12px; color: #666; }

.cv-pv-section { margin-bottom: 18px; }
.cv-pv-section:last-child { margin-bottom: 0; }

.cv-pv-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #1a1a1a;
  border-bottom: 1px solid #ddd;
  padding-bottom: 4px;
  margin: 0 0 10px;
}

.cv-pv-text { font-size: 12.5px; line-height: 1.6; color: #333; margin: 0; }

.cv-pv-entry { margin-bottom: 12px; }
.cv-pv-entry:last-child { margin-bottom: 0; }

.cv-pv-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.cv-pv-entry-period { font-size: 11.5px; font-weight: 600; color: #777; white-space: nowrap; }
.cv-pv-entry-sub { font-size: 12px; color: #555; margin: 2px 0 4px; }
.cv-pv-entry-desc { font-size: 12px; line-height: 1.55; color: #333; margin: 0; white-space: pre-line; }

.cv-pv-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-pv-tag {
  background: #f0f0f0;
  border-radius: 50px;
  padding: 4px 12px;
  font-size: 11.5px;
  color: #333;
}

.cv-pv-lang-list { margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: #333; }
.cv-pv-lang-list li { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed #eee; }
.cv-pv-lang-list li:last-child { border-bottom: none; }

.cv-pv-ref-item { font-size: 12.5px; color: #333; margin: 0 0 6px; }
.cv-pv-ref-item:last-child { margin-bottom: 0; }
.cv-pv-ref-item b { color: #1a1a1a; }

.cv-pv-social-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #333; margin-bottom: 6px; }
.cv-pv-social-row:last-child { margin-bottom: 0; }
.cv-pv-social-row svg { width: 14px; height: 14px; color: var(--cv-accent, #4338ca); flex-shrink: 0; }

.cv-sb-header {
  background: linear-gradient(135deg, var(--cv-accent, #4338ca), #1e1b4b);
  color: #fff;
  padding: 28px 28px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cv-sb-photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255,255,255,0.18);
  border: 3px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}
.cv-sb-photo img { width: 100%; height: 100%; object-fit: cover; }

.cv-sb-name-block { flex: 1; min-width: 160px; }
.cv-sb-name { font-size: 24px; font-weight: 800; margin: 0 0 4px; }
.cv-sb-title { font-size: 13px; opacity: .85; margin: 0; }

.cv-sb-pills { display: flex; flex-direction: column; gap: 6px; }
.cv-sb-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.16);
  border-radius: 50px;
  padding: 5px 12px;
  font-size: 11.5px;
  white-space: nowrap;
}
.cv-sb-pill svg { width: 12px; height: 12px; }

.cv-sb-body { display: flex; flex-wrap: wrap; }
.cv-sb-sidebar { width: 38%; min-width: 220px; background: #f4f4f6; padding: 24px 20px; box-sizing: border-box; }
.cv-sb-main { flex: 1; min-width: 240px; padding: 24px 24px; box-sizing: border-box; }

.cv-sb-section { margin-bottom: 20px; }
.cv-sb-section:last-child { margin-bottom: 0; }
.cv-sb-section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cv-accent, #4338ca);
  margin: 0 0 10px;
}
.cv-sb-text { font-size: 12px; line-height: 1.6; color: #444; margin: 0; }

.cv-sb-skill { margin-bottom: 8px; }
.cv-sb-skill:last-child { margin-bottom: 0; }
.cv-sb-skill-name { font-size: 12px; color: #333; margin: 0 0 3px; }
.cv-sb-dots { display: flex; gap: 3px; }
.cv-sb-dot { width: 8px; height: 8px; border-radius: 50%; background: #ddd; }
.cv-sb-dot.filled { background: var(--cv-accent, #4338ca); }

.cv-sb-ref { background: #fff; border: 1px solid #e3e3e8; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 11.5px; }
.cv-sb-ref:last-child { margin-bottom: 0; }
.cv-sb-ref b { display: block; font-size: 12px; color: #1a1a1a; }
.cv-sb-ref span { color: #777; }

.cv-sb-social { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #444; margin-bottom: 6px; }
.cv-sb-social:last-child { margin-bottom: 0; }
.cv-sb-social svg { width: 13px; height: 13px; color: var(--cv-accent, #4338ca); flex-shrink: 0; }

.cv-sb-main-entry { position: relative; margin-bottom: 14px; padding-left: 14px; border-left: 2px solid #eee; }
.cv-sb-main-entry:last-child { margin-bottom: 0; }
.cv-sb-main-entry::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cv-accent, #4338ca);
}
.cv-sb-main-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; color: #1a1a1a; }
.cv-sb-main-period { font-size: 11px; font-weight: 600; color: #999; white-space: nowrap; }
.cv-sb-main-sub { font-size: 11.5px; color: #666; margin: 2px 0 4px; }
.cv-sb-main-desc { font-size: 11.5px; line-height: 1.55; color: #444; margin: 0; white-space: pre-line; }

.cv-md-header {
  background: var(--cv-accent, #4338ca);
  color: #fff;
  padding: 30px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.cv-md-header-text { flex: 1; min-width: 0; }
.cv-md-name { font-size: 26px; font-weight: 800; margin: 0 0 4px; }
.cv-md-title { font-size: 13px; opacity: .85; margin: 0 0 10px; }

.cv-md-contact { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11.5px; opacity: .92; }
.cv-md-contact span { display: flex; align-items: center; gap: 5px; }
.cv-md-contact svg { width: 13px; height: 13px; }

.cv-md-photo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}
.cv-md-photo img { width: 100%; height: 100%; object-fit: cover; }

.cv-md-body { padding: 26px 32px; }
.cv-md-section { margin-bottom: 20px; }
.cv-md-section:last-child { margin-bottom: 0; }
.cv-md-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #1a1a1a;
  border-left: 4px solid var(--cv-accent, #4338ca);
  padding-left: 10px;
  margin: 0 0 12px;
}
.cv-md-text { font-size: 12.5px; line-height: 1.6; color: #333; margin: 0; }

.cv-md-entry { margin-bottom: 14px; }
.cv-md-entry:last-child { margin-bottom: 0; }
.cv-md-entry-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; color: #1a1a1a; }
.cv-md-entry-period { font-size: 11px; font-weight: 600; color: var(--cv-accent, #4338ca); white-space: nowrap; }
.cv-md-entry-sub { font-size: 12px; color: #666; margin: 2px 0 4px; }
.cv-md-entry-desc { font-size: 12px; line-height: 1.55; color: #333; margin: 0; white-space: pre-line; }

.cv-md-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.cv-md-skills { display: flex; flex-wrap: wrap; gap: 10px; }
.cv-md-skill { flex: 0 0 100%; }
.cv-md-skill-name { display: flex; justify-content: space-between; font-size: 11.5px; color: #333; margin: 0 0 4px; }
.cv-md-bar { height: 6px; border-radius: 50px; background: #eee; overflow: hidden; }
.cv-md-bar-fill { height: 100%; border-radius: 50px; background: var(--cv-accent, #4338ca); }

.cv-md-refs { display: flex; flex-direction: column; gap: 8px; }
.cv-md-ref { background: #f8f8fa; border-radius: 8px; padding: 10px 12px; font-size: 11.5px; }
.cv-md-ref b { display: block; color: #1a1a1a; font-size: 12px; }
.cv-md-ref span { color: #777; }

.cv-md-socials { display: flex; flex-wrap: wrap; gap: 14px; }
.cv-md-social { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: #333; }
.cv-md-social svg { width: 14px; height: 14px; color: var(--cv-accent, #4338ca); }

@media (max-width: 900px) {
  .cv-layout { grid-template-columns: 1fr; }
  .cv-preview-col { position: static; }
  .cv-preview-frame { max-height: none; }
  .cv-field-grid { grid-template-columns: 1fr; }
  .cv-sb-sidebar, .cv-sb-main { width: 100%; }
}

.rb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--btn-invert-bg);
  color: var(--btn-invert-text);
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: opacity .2s;
}

.rb-btn:hover { opacity: .82; }
.rb-btn:disabled { opacity: .4; cursor: not-allowed; }
.rb-btn svg { width: 15px; height: 15px; }

.rb-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(var(--btn-invert-text-rgb),0.2);
  border-top-color: var(--btn-invert-text);
  border-radius: 50%;
  animation: rb-spin .7s linear infinite;
}

@keyframes rb-spin {
  to { transform: rotate(360deg); }
}

.rb-hidden { display: none !important; }

.cv-photo-row { flex-wrap: wrap; }

@media (max-width: 380px) {
  .cv-layout { padding: 0 14px 60px; }
  .cv-section { padding: 18px 14px; }
}
