/* ============================================================
   CV Builder v2, Full Rebuild
   ============================================================ */

/* ── App Shell ── */
.cv-app {
  display: flex;
  height: 100vh;
  padding-top: 110px;
  background: var(--bg);
  overflow: hidden;
}

/* ── Template Sidebar ── */
.cv-sidebar {
  width: 220px;
  min-width: 220px;
  flex-shrink: 0;
  background: var(--bg2);
  border-right: 1px solid var(--bd);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s, min-width 0.25s, opacity 0.25s;
  z-index: 30;
}
.cv-sidebar.collapsed {
  width: 0;
  min-width: 0;
  opacity: 0;
  pointer-events: none;
}
.cv-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--bd);
}
.cv-sidebar-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--t3);
}
.cv-sidebar-close {
  background: none;
  border: none;
  color: var(--t4);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  transition: all 0.2s;
}
.cv-sidebar-close:hover { color: var(--t1); background: var(--bg3); }

.cv-sidebar-templates {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
}

/* Template Cards */
.cv-tpl-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
  font-family: var(--font);
}
.cv-tpl-card:hover { border-color: var(--bd); transform: translateY(-1px); }
.cv-tpl-card.active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.cv-tpl-preview {
  width: 56px;
  height: 72px;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.cv-tpl-preview-inner {
  width: 780px;
  position: absolute;
  top: 0;
  left: 0;
  transform: scale(0.0718);
  transform-origin: top left;
  pointer-events: none;
  font-size: 12.5px;
  line-height: 1.5;
  font-family: 'DM Sans', sans-serif;
  color: #1a1614;
}

.cv-tpl-info { flex: 1; min-width: 0; }
.cv-tpl-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--t1);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cv-tpl-ats {
  font-size: 9px;
  font-weight: 700;
  background: #059669;
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  display: inline-block;
  margin-top: 2px;
}

/* Template preview: actual rendered mini-resume */

/* ── Main Area ── */
.cv-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* ── Action Bar ── */
.cv-actionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--bd);
  gap: 12px;
  flex-shrink: 0;
  z-index: 20;
}
.cv-actionbar-left,
.cv-actionbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cv-actionbar-center {
  display: flex;
  align-items: center;
}

.cv-separator {
  width: 1px;
  height: 24px;
  background: var(--bd);
  margin: 0 4px;
}

/* Icon Button */
.cv-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--bg);
  color: var(--t2);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cv-icon-btn:hover { background: var(--bg3); color: var(--t1); }

/* Color Dots */
.cv-actionbar-colors {
  display: flex;
  gap: 4px;
  align-items: center;
}
.cv-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--dot);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
}
.cv-dot:hover { transform: scale(1.2); }
.cv-dot.active { border-color: var(--t1); box-shadow: 0 0 0 2px var(--bg); }

/* Custom Dropdown */
.cv-dropdown { position: relative; }
.cv-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--bg);
  color: var(--t2);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}
.cv-dropdown-btn:hover { background: var(--bg3); }
.cv-dropdown-menu {
  display: none;
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  z-index: 200;
  min-width: 180px;
}
.cv-dropdown-menu.open { display: flex; flex-direction: column; }
.cv-dropdown-item {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--t2);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.cv-dropdown-item:hover { background: var(--bg3); }
.cv-dropdown-item.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

/* ATS Pill */
.cv-ats-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--bd);
  border-radius: 20px;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s;
}
.cv-ats-pill:hover { background: var(--bg3); }
.cv-ats-svg { transform: rotate(-90deg); }
.cv-ats-track { fill: none; stroke: var(--bd); stroke-width: 3; }
.cv-ats-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease, stroke 0.3s;
}
.cv-ats-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--t1);
  font-family: var(--mono);
  min-width: 22px;
  text-align: center;
}
.cv-ats-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--t4);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Export Button */
.cv-btn-export {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.cv-btn-export:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Workspace ── */
.cv-workspace {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Editor */
.cv-editor {
  width: 45%;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg);
}
.cv-editor-inner {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Preview */
.cv-preview {
  width: 55%;
  overflow-y: auto;
  background: var(--bg3);
  display: flex;
  justify-content: center;
  padding: 20px;
  border-left: 1px solid var(--bd);
}
.cv-preview-inner {
  width: 100%;
  max-width: 780px;
}

/* ── Section Cards ── */
.cv-sec {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.cv-sec:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.cv-sec.dragging { opacity: 0.5; box-shadow: 0 4px 20px rgba(0,0,0,0.12); }

.cv-sec-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.cv-sec-head:hover { background: var(--bg3); }

.cv-grip {
  cursor: grab;
  color: var(--t4);
  display: flex;
  padding: 2px;
}
.cv-grip:active { cursor: grabbing; }
.cv-grip svg { pointer-events: none; }

.cv-sec-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
}
.cv-sec-del {
  color: var(--t4);
  cursor: pointer;
  display: flex;
  padding: 3px;
  border-radius: 4px;
  border: none;
  background: none;
  transition: all 0.15s;
}
.cv-sec-del:hover { color: #dc2626; background: #fee2e2; }
.dark .cv-sec-del:hover { color: #f87171; background: #450a0a; }

.cv-sec-arrow {
  color: var(--t4);
  transition: transform 0.2s;
  display: flex;
}
.cv-sec-arrow.shut { transform: rotate(-90deg); }

.cv-sec-body {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cv-sec-body.shut { display: none; }

/* ── Custom Form Components ── */
.cv-input {
  padding: 8px 10px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--bg);
  color: var(--t1);
  font-size: 13px;
  font-family: var(--font);
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
  outline: none;
}
.cv-input:focus { border-color: var(--accent); }
.cv-input::placeholder { color: var(--t4); }

.cv-textarea {
  padding: 8px 10px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--bg);
  color: var(--t1);
  font-size: 13px;
  font-family: var(--font);
  resize: vertical;
  min-height: 56px;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}
.cv-textarea:focus { border-color: var(--accent); }

.cv-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cv-field { display: flex; flex-direction: column; gap: 3px; }

.cv-charcount {
  font-size: 10px;
  color: var(--t4);
  text-align: right;
  font-family: var(--mono);
}

/* Custom Photo Upload Button */
.cv-photo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cv-photo-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bd);
}
.cv-photo-empty {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px dashed var(--bd);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t4);
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.cv-photo-empty:hover { border-color: var(--accent); color: var(--accent); }
.cv-photo-btn {
  padding: 5px 10px;
  border: 1px solid var(--bd);
  border-radius: 6px;
  background: var(--bg);
  color: var(--t2);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}
.cv-photo-btn:hover { background: var(--bg3); }
.cv-photo-btn.danger { color: #dc2626; border-color: #fecaca; }
.dark .cv-photo-btn.danger { color: #f87171; border-color: #450a0a; }

/* Custom Select (proficiency etc.) */
.cv-select {
  position: relative;
}
.cv-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--bg);
  color: var(--t1);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.2s;
}
.cv-select-btn:hover { border-color: var(--t4); }
.cv-select-menu {
  display: none;
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 200;
  min-width: 140px;
}
.cv-select-menu.open { display: flex; flex-direction: column; }
.cv-select-opt {
  padding: 7px 10px;
  border: none;
  border-radius: 5px;
  background: none;
  color: var(--t2);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  text-align: left;
}
.cv-select-opt:hover { background: var(--bg3); }
.cv-select-opt.active { background: var(--accent-light); color: var(--accent); }

/* Entry Cards */
.cv-entry {
  background: var(--bg);
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cv-entry-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cv-entry-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
}
.cv-entry-rm {
  font-size: 11px;
  color: var(--t4);
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--bd);
  background: none;
  font-family: var(--font);
  transition: all 0.15s;
}
.cv-entry-rm:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.dark .cv-entry-rm:hover { color: #f87171; border-color: #450a0a; background: #450a0a; }

/* Bullets */
.cv-bullets { display: flex; flex-direction: column; gap: 4px; }
.cv-bullet-row { display: flex; gap: 4px; align-items: center; }
.cv-bullet-row .cv-input { flex: 1; }
.cv-bullet-x {
  color: var(--t4);
  cursor: pointer;
  padding: 4px;
  display: flex;
  flex-shrink: 0;
  border: none;
  background: none;
  border-radius: 4px;
}
.cv-bullet-x:hover { color: #dc2626; }

/* Skill Tags */
.cv-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  min-height: 34px;
  background: var(--bg);
  cursor: text;
}
.cv-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}
.cv-tag-x {
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  opacity: 0.6;
  border: none;
  background: none;
  color: inherit;
  padding: 0;
}
.cv-tag-x:hover { opacity: 1; }
.cv-tag-input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--t1);
  font-size: 12px;
  min-width: 60px;
  flex: 1;
  font-family: var(--font);
}

/* Add buttons */
.cv-add-link {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  font-weight: 500;
  border: none;
  background: none;
  font-family: var(--font);
}
.cv-add-link:hover { text-decoration: underline; }

.cv-add-section-wrap {
  padding: 0 16px 16px;
  max-width: 540px;
  margin: 0 auto;
  width: 100%;
}
.cv-add-section-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  border: 2px dashed var(--bd);
  border-radius: 10px;
  background: transparent;
  color: var(--t3);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}
.cv-add-section-btn:hover { border-color: var(--accent); color: var(--accent); }

.cv-add-menu {
  margin-top: 6px;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: 10px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cv-add-menu-item {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--t1);
  transition: background 0.15s;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
  font-family: var(--font);
}
.cv-add-menu-item:hover { background: var(--bg3); }

/* Drop indicator */
.cv-drop-line {
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: -2px 0;
}

/* ── Primary Button ── */
.cv-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}
.cv-btn-primary:hover { opacity: 0.9; }
.cv-btn-block { width: 100%; }

/* ── Drawers (ATS Tips / AI) ── */
.cv-drawer {
  position: fixed;
  right: 0;
  top: 72px;
  bottom: 0;
  width: 340px;
  background: var(--bg2);
  border-left: 1px solid var(--bd);
  z-index: 60;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  animation: slideRight 0.2s ease;
}
@keyframes slideRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.cv-drawer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bd);
}
.cv-drawer-head h3 {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
}
.cv-drawer-close {
  font-size: 20px;
  cursor: pointer;
  color: var(--t3);
  background: none;
  border: none;
  padding: 2px 6px;
  border-radius: 4px;
}
.cv-drawer-close:hover { background: var(--bg3); }

.cv-drawer-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 12px 16px;
}
.cv-score-box {
  padding: 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--bd);
  text-align: center;
}
.cv-score-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--mono);
}
.cv-score-lbl {
  font-size: 10px;
  color: var(--t3);
  margin-top: 1px;
}

.cv-drawer-tips {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cv-tip {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--bd);
  font-size: 12px;
  color: var(--t2);
  line-height: 1.4;
}
.cv-tip-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
}
.cv-tip-dot.high { background: #dc2626; }
.cv-tip-dot.medium { background: #d97706; }
.cv-tip-dot.low { background: #059669; }

/* AI Badge */
.cv-ai-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
}

.cv-ai-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.cv-ai-industry { display: flex; flex-direction: column; gap: 4px; }

/* Industry searchable dropdown, inline below button */
.cv-industry-dropdown {
  display: none;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  z-index: 200;
  overflow: hidden;
  margin-top: 4px;
}
.cv-industry-dropdown.open { display: flex; flex-direction: column; }
.cv-industry-search {
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--bd);
  background: var(--bg);
  color: var(--t1);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.cv-industry-search::placeholder { color: var(--t4); }
.cv-industry-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
}
.cv-industry-list::-webkit-scrollbar { width: 5px; }
.cv-industry-list::-webkit-scrollbar-thumb { background: var(--bd); border-radius: 3px; }
.cv-industry-list .cv-select-opt {
  display: block;
  width: 100%;
  text-align: left;
  white-space: nowrap;
}

.cv-ai-iscore { display: none; }
.cv-ai-score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cv-ai-score-item {
  padding: 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--bd);
  text-align: center;
}
.cv-ai-score-num {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--mono);
}
.cv-ai-score-lbl {
  font-size: 10px;
  color: var(--t3);
  margin-top: 2px;
}

.cv-ai-status {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.cv-ai-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--t3);
  font-size: 13px;
}
.cv-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--bd);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.cv-ai-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cv-ai-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--bg);
  color: var(--t2);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}
.cv-ai-action:hover { background: var(--bg3); border-color: var(--accent); color: var(--accent); }

.cv-ai-result {
  padding: 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--bd);
  font-size: 12px;
  color: var(--t2);
  line-height: 1.5;
  max-height: 400px;
  overflow-y: auto;
}

/* ── Modal ── */
.cv-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cv-modal {
  background: var(--bg2);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.cv-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--bd);
}
.cv-modal-head h3 { font-size: 15px; font-weight: 600; color: var(--t1); }
.cv-modal-x {
  font-size: 22px;
  cursor: pointer;
  color: var(--t3);
  background: none;
  border: none;
}
.cv-modal-body { padding: 18px; }
.cv-modal-hint { font-size: 13px; color: var(--t3); margin-bottom: 10px; }

.cv-jd-results { margin-top: 14px; }
.cv-jd-score {
  text-align: center;
  margin-bottom: 14px;
}
.cv-jd-num {
  font-size: 42px;
  font-weight: 700;
  font-family: var(--mono);
}
.cv-jd-pct { font-size: 13px; color: var(--t3); }
.cv-jd-kws { display: flex; flex-direction: column; gap: 10px; }
.cv-jd-kws h4 { font-size: 12px; font-weight: 600; color: var(--t1); margin-bottom: 4px; }
.cv-jd-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.cv-jd-tag {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
}
.cv-jd-tag.hit { background: #d1fae5; color: #059669; }
.cv-jd-tag.miss { background: #fee2e2; color: #dc2626; }
.dark .cv-jd-tag.hit { background: #022c22; color: #34d399; }
.dark .cv-jd-tag.miss { background: #450a0a; color: #f87171; }

/* ── Mobile Toggle ── */
.cv-mobile-toggle {
  display: none;
  padding: 6px 12px;
  gap: 6px;
  background: var(--bg2);
  border-bottom: 1px solid var(--bd);
}
.cv-mobile-tab {
  flex: 1;
  padding: 7px;
  border: 1px solid var(--bd);
  border-radius: 8px;
  background: var(--bg);
  color: var(--t3);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  font-family: var(--font);
  transition: all 0.2s;
}
.cv-mobile-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ============================================================
   Resume Page, Shared Structure
   ============================================================ */
.cv-page {
  width: 100%;
  max-width: 780px;
  min-height: 1100px;
  background: #fff;
  color: #1a1614;
  padding: 40px 32px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border-radius: 4px;
  font-family: var(--cv-font, 'DM Sans', sans-serif);
  font-size: 12.5px;
  line-height: 1.5;
  box-sizing: border-box;
}
.cv-page * { box-sizing: border-box; }

/* Header */
.cv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  gap: 14px;
}
.cv-header-text { flex: 1; }
.cv-name {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 5px;
  color: #1a1614;
  font-family: var(--cv-font-display, var(--cv-font, 'DM Sans', sans-serif));
}
.cv-contact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  font-size: 11.5px;
  color: #666;
}
.cv-contact-item a { color: var(--cv-accent, #5b5bf6); text-decoration: none; }
.cv-contact-item a:hover { text-decoration: underline; }
.cv-photo {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eee;
  flex-shrink: 0;
}

/* Sections */
.cv-section { margin-bottom: 14px; }
.cv-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--cv-accent, #5b5bf6);
  margin: 0 0 6px;
  padding-bottom: 3px;
  border-bottom: 1.5px solid var(--cv-accent, #5b5bf6);
  font-family: var(--cv-font-display, var(--cv-font, 'DM Sans', sans-serif));
}

/* Entries */
.cv-entry-item { margin-bottom: 8px; }
.cv-entry-item:last-child { margin-bottom: 0; }
.cv-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.cv-entry-left { flex: 1; }
.cv-entry-title { font-size: 12.5px; font-weight: 600; color: #1a1614; }
.cv-entry-sub { font-size: 11.5px; color: #666; margin-left: 4px; }
.cv-entry-dates {
  font-size: 10.5px;
  color: #888;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}
.cv-entry-desc { font-size: 11.5px; color: #444; margin: 2px 0 0; }
.cv-entry-bullets {
  margin: 3px 0 0;
  padding-left: 15px;
  list-style: disc;
}
.cv-entry-bullets li {
  font-size: 11.5px;
  color: #333;
  margin-bottom: 1.5px;
  line-height: 1.45;
}
.cv-entry-link { font-size: 10.5px; color: var(--cv-accent, #5b5bf6); text-decoration: none; }

.cv-tech-stack { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.cv-tech-tag { padding: 1px 5px; background: #f0f0f0; border-radius: 3px; font-size: 10px; color: #555; }

.cv-summary-text { font-size: 12px; color: #333; line-height: 1.55; margin: 0; }

.cv-skills-group { margin-bottom: 5px; display: flex; flex-wrap: wrap; gap: 3px; align-items: baseline; }
.cv-skills-label { font-size: 11.5px; font-weight: 600; color: #333; margin-right: 4px; }
.cv-skills-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.cv-skill-tag { padding: 1px 7px; background: #f0f0f0; border-radius: 9px; font-size: 10.5px; color: #444; }

.cv-lang-entry { display: flex; justify-content: space-between; font-size: 11.5px; padding: 1.5px 0; }
.cv-lang-name { font-weight: 500; color: #333; }
.cv-lang-level { color: #888; }

.cv-pub-title { font-weight: 600; font-size: 11.5px; color: #333; }
.cv-pub-venue { font-size: 11.5px; color: #666;  }
.cv-custom-entry { font-size: 11.5px; color: #333; margin-bottom: 3px; }

.cv-empty-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: #aaa;
  text-align: center;
  gap: 8px;
}
.cv-empty-preview svg { opacity: 0.25; }
.cv-empty-preview p { font-size: 14px; }

/* Two-column helpers */
.cv-sidebar-col { background: #f8f7f5; padding: 18px 14px; border-right: 1px solid #eee; }
.cv-main-col { padding: 18px 20px; }

/* ============================================================
   TEMPLATES, Famous-Inspired Designs
   ============================================================ */

/* 1. Executive, Harvard-inspired: Times, single-col, pure text, tight, conservative */
.cv-page.tpl-executive {
  font-family: 'Georgia', 'Times New Roman', serif;
  padding: 36px 40px;
  font-size: 11.5px;
  line-height: 1.4;
}
.cv-page.tpl-executive .cv-name {
  font-family: 'Georgia', serif;
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  border-bottom: 2px solid #1a1614;
  padding-bottom: 6px;
}
.cv-page.tpl-executive .cv-header { flex-direction: column; align-items: center; }
.cv-page.tpl-executive .cv-contact-line { justify-content: center; font-size: 11px; }
.cv-page.tpl-executive .cv-section-title {
  font-family: 'Georgia', serif;
  font-size: 12px;
  color: #1a1614;
  border-bottom: 1px solid #666;
  letter-spacing: 2.5px;
  padding-bottom: 2px;
  margin-bottom: 6px;
}
.cv-page.tpl-executive .cv-entry-title { font-family: 'Georgia', serif; }
.cv-page.tpl-executive .cv-skill-tag { background: transparent; padding: 0; font-size: 11px; border-radius: 0; }
.cv-page.tpl-executive .cv-skills-group { display: inline; }
.cv-page.tpl-executive .cv-section { margin-bottom: 10px; }

/* 2. Modern Pro, Awesome CV-inspired: colored section headers, bold name, spacious */
.cv-page.tpl-modern-pro { padding: 36px 30px; }
.cv-page.tpl-modern-pro .cv-name { font-size: 32px; font-weight: 700; color: var(--cv-accent, #5b5bf6); }
.cv-page.tpl-modern-pro .cv-contact-line { font-size: 11px; color: #555; }
.cv-page.tpl-modern-pro .cv-section-title {
  background: var(--cv-accent, #5b5bf6);
  color: #fff;
  border-bottom: none;
  padding: 5px 12px;
  border-radius: 3px;
  font-size: 11px;
  letter-spacing: 1px;
}
.cv-page.tpl-modern-pro .cv-entry-title { color: var(--cv-accent, #5b5bf6); font-weight: 700; }
.cv-page.tpl-modern-pro .cv-skill-tag { border: 1px solid var(--cv-accent, #5b5bf6); background: transparent; color: var(--cv-accent, #5b5bf6); }

/* 3. Minimal, Spearmint-inspired: extreme whitespace, ultra-thin, airy */
.cv-page.tpl-minimal { padding: 56px 48px; font-size: 11px; line-height: 1.6; }
.cv-page.tpl-minimal .cv-name {
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: #444;
}
.cv-page.tpl-minimal .cv-contact-line { font-size: 10px; color: #aaa; letter-spacing: 1px; }
.cv-page.tpl-minimal .cv-section-title {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 4px;
  color: #aaa;
  border-bottom: 0.5px solid #e8e8e8;
  padding-bottom: 6px;
  margin-bottom: 10px;
}
.cv-page.tpl-minimal .cv-section { margin-bottom: 20px; }
.cv-page.tpl-minimal .cv-entry-title { font-weight: 500; font-size: 12px; }
.cv-page.tpl-minimal .cv-entry-bullets { list-style: none; padding-left: 0; }
.cv-page.tpl-minimal .cv-entry-bullets li { padding-left: 16px; position: relative; }
.cv-page.tpl-minimal .cv-entry-bullets li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 1px; background: #ccc; }
.cv-page.tpl-minimal .cv-skill-tag { background: transparent; border: 1px solid #ddd; font-size: 10px; }

/* 4. Creative, Full-height colored left sidebar layout */
.cv-page.tpl-creative {
  display: grid;
  grid-template-columns: 260px 1fr;
  padding: 0;
  min-height: 1100px;
}
.cv-page.tpl-creative .cv-header { display: none; }
.cv-page.tpl-creative .cv-layout-sidebar {
  background: var(--cv-accent, #5b5bf6);
  color: #fff;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cv-page.tpl-creative .cv-sb-name {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  color: #fff;
}
.cv-page.tpl-creative .cv-sb-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.3);
  align-self: center;
}
.cv-page.tpl-creative .cv-sb-contact {
  border-top: 1px solid rgba(255,255,255,0.25);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cv-page.tpl-creative .cv-sb-item { font-size: 11px; color: rgba(255,255,255,0.85); }
.cv-page.tpl-creative .cv-sb-item a { color: #fff; text-decoration: none; }
.cv-page.tpl-creative .cv-layout-sidebar .cv-section-title {
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.25);
  font-size: 10px;
  letter-spacing: 2px;
}
.cv-page.tpl-creative .cv-layout-sidebar .cv-skill-tag {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.cv-page.tpl-creative .cv-layout-sidebar .cv-lang-name,
.cv-page.tpl-creative .cv-layout-sidebar .cv-lang-level { color: rgba(255,255,255,0.85); }
.cv-page.tpl-creative .cv-layout-main {
  padding: 32px 28px;
}
.cv-page.tpl-creative .cv-layout-main .cv-section-title {
  color: var(--cv-accent, #5b5bf6);
  border-bottom: 2px solid var(--cv-accent, #5b5bf6);
}

/* 5. Two Column, Deedy-inspired: neutral sidebar + main */
.cv-page.tpl-two-column {
  display: grid;
  grid-template-columns: 240px 1fr;
  padding: 0;
  font-size: 11.5px;
  min-height: 1100px;
}
.cv-page.tpl-two-column .cv-header { display: none; }
.cv-page.tpl-two-column .cv-layout-sidebar {
  background: #f0eeea;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 1px solid #e0dcd6;
}
.cv-page.tpl-two-column .cv-sb-name {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: #1a1614;
}
.cv-page.tpl-two-column .cv-sb-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ddd;
}
.cv-page.tpl-two-column .cv-sb-contact {
  border-top: 1px solid #ddd;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cv-page.tpl-two-column .cv-sb-item { font-size: 10.5px; color: #555; }
.cv-page.tpl-two-column .cv-sb-item a { color: var(--cv-accent, #5b5bf6); }
.cv-page.tpl-two-column .cv-layout-sidebar .cv-section-title {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #555;
  border-bottom-color: #ddd;
}
.cv-page.tpl-two-column .cv-layout-sidebar .cv-section { margin-bottom: 8px; }
.cv-page.tpl-two-column .cv-layout-sidebar .cv-skill-tag { font-size: 10px; }
.cv-page.tpl-two-column .cv-layout-main {
  padding: 28px 24px;
}
.cv-page.tpl-two-column .cv-layout-main .cv-section-title { font-size: 11px; letter-spacing: 1px; }
.cv-page.tpl-two-column .cv-layout-main .cv-section { margin-bottom: 10px; }

/* 6. Nordic, Stockholm-inspired: cool palette, left accent line, icy clean */
.cv-page.tpl-nordic {
  border-left: 6px solid #5a7d9a;
  padding: 36px 30px 36px 28px;
}
.cv-page.tpl-nordic .cv-name {
  font-weight: 300;
  font-size: 30px;
  letter-spacing: 1px;
  color: #2c3e50;
}
.cv-page.tpl-nordic .cv-contact-line { color: #7a8fa0; font-size: 11px; }
.cv-page.tpl-nordic .cv-section-title {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 10px;
  color: #5a7d9a;
  border-bottom: 2px solid #c8d6e0;
  padding-bottom: 4px;
}
.cv-page.tpl-nordic .cv-entry-title { color: #2c3e50; }
.cv-page.tpl-nordic .cv-entry-dates { color: #7a8fa0; }
.cv-page.tpl-nordic .cv-skill-tag { background: #e3ecf2; color: #3a5a78; border-radius: 4px; }
.cv-page.tpl-nordic .cv-tech-tag { background: #e3ecf2; color: #3a5a78; }

/* 7. Bold, Swiss-inspired: massive typography hierarchy, strong dividers */
.cv-page.tpl-bold { padding: 32px 28px; }
.cv-page.tpl-bold .cv-name {
  font-size: 38px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 3px;
  line-height: 1.1;
  border-bottom: 4px solid #1a1614;
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.cv-page.tpl-bold .cv-contact-line { font-size: 11px; font-weight: 500; }
.cv-page.tpl-bold .cv-section-title {
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  color: #1a1614;
  border-bottom: 3px solid var(--cv-accent, #ff9800);
  letter-spacing: 2px;
  padding-bottom: 3px;
}
.cv-page.tpl-bold .cv-entry-title { font-size: 14px; font-weight: 700; }
.cv-page.tpl-bold .cv-entry-sub { font-size: 12px; }
.cv-page.tpl-bold .cv-skill-tag { font-weight: 600; font-size: 11px; background: #f0f0f0; padding: 3px 10px; border-radius: 3px; }

/* 8. Compact, Jake's Resume-inspired: maximum density, Palatino, fits everything */
.cv-page.tpl-compact {
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  padding: 16px 16px;
  font-size: 10px;
  line-height: 1.3;
}
.cv-page.tpl-compact .cv-name { font-size: 18px; margin-bottom: 1px; font-weight: 700; }
.cv-page.tpl-compact .cv-header { margin-bottom: 8px; }
.cv-page.tpl-compact .cv-contact-line { font-size: 9px; }
.cv-page.tpl-compact .cv-section { margin-bottom: 6px; }
.cv-page.tpl-compact .cv-section-title {
  font-size: 9.5px;
  margin-bottom: 2px;
  padding-bottom: 1px;
  color: #333;
  border-bottom: 0.5px solid #888;
  font-weight: 700;
  letter-spacing: 1px;
}
.cv-page.tpl-compact .cv-entry-item { margin-bottom: 3px; }
.cv-page.tpl-compact .cv-entry-title { font-size: 10px; }
.cv-page.tpl-compact .cv-entry-sub { font-size: 9px; }
.cv-page.tpl-compact .cv-entry-dates { font-size: 9px; }
.cv-page.tpl-compact .cv-entry-bullets li { font-size: 9.5px; margin-bottom: 0; }
.cv-page.tpl-compact .cv-entry-bullets { margin-top: 1px; }
.cv-page.tpl-compact .cv-skill-tag { font-size: 9px; padding: 0 4px; }
.cv-page.tpl-compact .cv-summary-text { font-size: 9.5px; }

/* 9. Academic, Europass-inspired: institutional header, structured, serif body */
.cv-page.tpl-academic {
  font-family: 'Georgia', 'Times New Roman', serif;
  padding: 0;
}
.cv-page.tpl-academic .cv-header {
  justify-content: center;
  text-align: center;
  flex-direction: column;
  align-items: center;
  background: var(--cv-accent, #5b5bf6);
  padding: 28px 32px;
  margin: 0 0 20px;
  color: #fff;
}
.cv-page.tpl-academic .cv-name {
  font-family: 'Playfair Display', 'Georgia', serif;
  color: #fff; font-size: 26px; font-weight: 700; letter-spacing: 1px;
}
.cv-page.tpl-academic .cv-contact-line { justify-content: center; color: rgba(255,255,255,0.85); font-size: 11px; }
.cv-page.tpl-academic .cv-contact-item a { color: #fff; text-decoration: underline; }
.cv-page.tpl-academic .cv-photo { border-color: rgba(255,255,255,0.4); }
.cv-page.tpl-academic .cv-section { padding: 0 32px; }
.cv-page.tpl-academic .cv-section-title {
  background: var(--cv-accent, #5b5bf6);
  color: #fff;
  border-bottom: none;
  padding: 4px 12px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 8px;
}
.cv-page.tpl-academic .cv-entry-title { font-family: 'Georgia', serif; }
.cv-page.tpl-academic .cv-summary-text { font-family: 'Georgia', serif; font-size: 12px; padding: 0 32px; }

/* 10. Tech, Terminal-inspired: monospace throughout, dark tags, code aesthetic */
.cv-page.tpl-tech {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11px;
  padding: 28px 24px;
  border: 2px solid #e0e0e0;
}
.cv-page.tpl-tech .cv-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--cv-accent, #5b5bf6);
}
.cv-page.tpl-tech .cv-contact-line { font-family: 'JetBrains Mono', monospace; font-size: 10px; }
.cv-page.tpl-tech .cv-section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0;
  color: var(--cv-accent, #5b5bf6);
  border-bottom: 1px dashed var(--cv-accent, #5b5bf6);
  text-transform: none;
}
.cv-page.tpl-tech .cv-section-title::before { content: '> '; opacity: 0.5; }
.cv-page.tpl-tech .cv-entry-title { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.cv-page.tpl-tech .cv-entry-sub { font-family: 'JetBrains Mono', monospace; font-size: 10px; }
.cv-page.tpl-tech .cv-entry-dates { font-family: 'JetBrains Mono', monospace; font-size: 10px; }
.cv-page.tpl-tech .cv-entry-bullets li { font-size: 10.5px; }
.cv-page.tpl-tech .cv-entry-bullets li::marker { color: var(--cv-accent, #5b5bf6); }
.cv-page.tpl-tech .cv-skill-tag {
  font-family: 'JetBrains Mono', monospace;
  background: #1a1a1e;
  color: #a3e635;
  font-size: 9.5px;
  padding: 2px 8px;
  border-radius: 3px;
}
.cv-page.tpl-tech .cv-tech-tag {
  font-family: 'JetBrains Mono', monospace;
  background: #1a1a1e;
  color: #67e8f9;
  padding: 2px 6px;
}
.cv-page.tpl-tech .cv-summary-text { font-size: 11px; }

/* 11. Elegant, Playfair, double borders, drop-cap */
.cv-page.tpl-elegant .cv-name {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 600;
  font-style: italic;
}
.cv-page.tpl-elegant .cv-section-title {
  font-family: 'Playfair Display', serif;
  text-transform: none;
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: #333;
  border-bottom: double 3px #ccc;
}
.cv-page.tpl-elegant .cv-header {
  border-top: double 3px var(--cv-accent, #5b5bf6);
  padding-top: 14px;
}
.cv-page.tpl-elegant .cv-summary-text::first-letter {
  font-size: 22px;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  float: left;
  margin-right: 3px;
  line-height: 1;
  color: var(--cv-accent, #5b5bf6);
}

/* 12. Startup, Modern Writer-inspired: color blocks, pill tags, friendly */
.cv-page.tpl-startup .cv-name { font-size: 24px; font-weight: 600; }
.cv-page.tpl-startup .cv-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  background: var(--cv-accent, #5b5bf6);
  color: #fff;
  border-bottom: none;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 8px;
}
.cv-page.tpl-startup .cv-skill-tag {
  border-radius: 20px;
  padding: 2px 10px;
  background: var(--cv-accent, #5b5bf6);
  color: #fff;
  font-size: 10.5px;
  font-weight: 500;
}
.cv-page.tpl-startup .cv-tech-tag { border-radius: 20px; padding: 1px 7px; }

/* ── Template Eye (Preview) Button ── */
.cv-tpl-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.cv-tpl-eye {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--bd);
  background: var(--bg2);
  color: var(--t4);
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}
.cv-tpl-eye:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-light); }

/* ── Template Preview Modal ── */
.cv-modal-wide { max-width: 860px; }
.cv-modal-scroll {
  max-height: 70vh;
  overflow-y: auto;
  padding: 20px;
}
.cv-tpl-fullpreview {
  max-width: 780px;
  margin: 0 auto;
}
.cv-modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--bd);
  display: flex;
  justify-content: flex-end;
}

/* ── Section Navigate Button ── */
.cv-sec-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--bd);
  background: none;
  color: var(--t4);
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
  flex-shrink: 0;
}
.cv-sec-nav:hover { color: var(--accent); border-color: var(--accent); }


/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .cv-sidebar { position: fixed; left: 0; top: 72px; bottom: 0; z-index: 50; box-shadow: 4px 0 20px rgba(0,0,0,0.1); }
  .cv-sidebar.collapsed { transform: translateX(-100%); width: 220px; min-width: 220px; opacity: 1; }
}

@media (max-width: 900px) {
  .cv-mobile-toggle { display: flex; }
  .cv-actionbar { flex-wrap: wrap; }
  .cv-actionbar-colors { display: none; }
  .cv-workspace { flex-direction: column; }
  .cv-editor { width: 100%; }
  .cv-preview { width: 100%; display: none; border-left: none; }
  .cv-preview.mobile-on { display: flex; }
  .cv-editor.mobile-off { display: none; }
  .cv-drawer { width: 100%; }
}

@media (max-width: 600px) {
  .cv-page { padding: 18px 14px; min-height: auto; }
  .cv-row { grid-template-columns: 1fr; }
  .cv-actionbar-right { gap: 3px; }
  .cv-icon-btn span { display: none; }
}

/* ============================================================
   Print
   ============================================================ */
@media print {
  .nav, .cv-actionbar, .cv-editor, .cv-mobile-toggle,
  .cv-drawer, .cv-modal-bg, .dark-fab, .cv-sidebar,
  .cv-add-section-wrap { display: none !important; }
  .cv-app { padding-top: 0; }
  .cv-main { width: 100%; }
  .cv-workspace { display: block; }
  .cv-preview { width: 100%; padding: 0; background: #fff; overflow: visible; border-left: none; }
  .cv-page { box-shadow: none; border-radius: 0; max-width: 100%; }
}

/* ── Save indicator animation ── */
@keyframes fadeOut {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}
