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

/* Chrome height = fixed nav clearance + slim editor topbar (76px + 40px). */
:root { --cv-chrome-h: 116px; }

/* ── A11y utilities ── */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 2000;
  transform: translateY(-150%);
  background: var(--accent); color: #fff;
  padding: 10px 16px; border-radius: 8px;
  font-family: var(--font); font-size: 0.9rem; font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  transition: transform 0.18s var(--ease);
}
.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid #fff; outline-offset: 2px;
}

/* ── App Shell ── */
.cv-app {
  display: flex;
  height: 100vh;
  padding-top: var(--cv-chrome-h);
  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 12px;
  background: var(--bg2);
  border-bottom: 1px solid var(--bd);
  gap: 8px;
  flex-shrink: 0;
  z-index: 20;
  flex-wrap: wrap;
  row-gap: 8px;
}
.cv-actionbar-left,
.cv-actionbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cv-actionbar-center {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

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

/* Icon Button */
.cv-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  min-height: 44px;
  box-sizing: border-box;
  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); }
.cv-icon-btn:focus-visible, .cv-btn-export:focus-visible, .cv-dropdown-btn:focus-visible, .cv-ats-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cv-icon-btn[aria-pressed="true"] { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }

/* Color Dots */
.cv-actionbar-colors {
  display: flex;
  gap: 4px;
  align-items: center;
}
.cv-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--dot);
  border: 2px solid transparent;
  /* Subtle edge so a dot whose colour ~matches the bar (e.g. Black in dark mode)
     is still visible. */
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--t1) 28%, transparent);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  padding: 0;
}
.cv-dot:hover { transform: scale(1.12); }
.cv-dot.active { border-color: transparent; box-shadow: 0 0 0 2px var(--bg2), 0 0 0 4px var(--accent); }
.cv-dot:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg2), 0 0 0 4px var(--accent); }

/* Custom Dropdown */
.cv-dropdown { position: relative; }
.cv-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  min-height: 44px;
  box-sizing: border-box;
  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;
  min-height: 44px;
  box-sizing: border-box;
  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: 8px 14px;
  min-height: 44px;
  box-sizing: border-box;
  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 { transform: translateY(-2px); box-shadow: 0 6px 18px var(--accent-glow); }

/* ── 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;
}

/* Resource chips in the editor topbar (Examples / Guides / Reviews) -> moved out
   of the global nav so the nav stays lean and these tool-specific surfaces live
   in the builder's own context. Each opens its drawer (bound by id in
   cv-discover.js / cv-reviews.js). */
.editor-topbar-lead { display: inline-flex; align-items: center; gap: 16px; min-width: 0; }
.cv-resource-chips { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.cv-resource-chip {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--t2);
  background: transparent;
  border: 1px solid var(--bd);
  border-radius: 100px;
  padding: 4px 12px;
  line-height: 1.35;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.cv-resource-chip:hover { border-color: var(--accent); color: var(--accent); }
.cv-resource-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 640px) {
  /* On phones the strip is tight; the label gives way so the chips stay usable. */
  .editor-topbar-lead .editor-topbar-left { display: none; }
}

/* ── 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;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  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;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  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: 14px;
  line-height: 1;
  opacity: 0.6;
  border: none;
  background: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  border-radius: 4px;
}
.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: var(--cv-chrome-h);
  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-family: 'Playfair Display', Georgia, serif;
  font-size: 17px;
  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-family: 'Playfair Display', Georgia, serif; font-size: 18px; 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-mpdf-link {
  display: block; width: 100%; margin-top: 10px; padding: 8px; min-height: 36px;
  background: none; border: none; color: var(--t3); font-family: var(--font);
  font-size: 13px; text-decoration: underline; cursor: pointer;
}
.cv-mpdf-link:hover { color: var(--accent); }

.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: transparent;
  color: var(--cv-accent, #5b5bf6);
  border-left: 3px solid var(--cv-accent, #5b5bf6);
  border-bottom: none;
  padding: 1px 0 2px 10px;
  border-radius: 0;
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 700;
}
.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: #fff;
  color: #1a1614;
  font-weight: 500;
}
.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: transparent;
  padding: 32px 32px 14px;
  margin: 0 0 16px;
  color: #1a1614;
  border-bottom: 2px solid #1a1614;
}
.cv-page.tpl-academic .cv-name {
  font-family: 'Playfair Display', 'Georgia', serif;
  color: #1a1614; font-size: 26px; font-weight: 700; letter-spacing: 1px;
}
.cv-page.tpl-academic .cv-contact-line { justify-content: center; color: #555; font-size: 11px; }
.cv-page.tpl-academic .cv-contact-item a { color: var(--cv-accent, #5b5bf6); text-decoration: none; }
.cv-page.tpl-academic .cv-photo { border-color: #ddd; }
.cv-page.tpl-academic .cv-section { padding: 0 32px; }
.cv-page.tpl-academic .cv-section-title {
  background: transparent;
  color: #1a1614;
  border-bottom: 1px solid rgba(26,22,20,0.35);
  padding: 0 0 3px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  display: 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;
}

/* ── Secret stats panel (5-click logo easter egg) ── */
.cv-stats-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  margin-bottom: 16px;
  border: 1px solid var(--bd);
  border-radius: 999px;
  background: var(--bg3);
  font-size: 12px;
  color: var(--t2);
}
.cv-stats-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.18);
}
.cv-stats-gate { padding: 14px 2px 6px; }
.cv-stats-gate-label {
  display: block;
  font-size: 13px;
  color: var(--t2);
  margin-bottom: 10px;
}
.cv-stats-gate-row { display: flex; gap: 8px; align-items: center; }
.cv-stats-pin {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  background: var(--bg2);
  color: var(--t1);
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: 0.3em;
}
.cv-stats-pin:focus { outline: 2px solid var(--emerald); outline-offset: 1px; }
.cv-stats-gate .cv-btn-primary { white-space: nowrap; }
.cv-stats-gate-error {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--rose);
}
.cv-stats-loading,
.cv-stats-error {
  padding: 32px 8px;
  text-align: center;
  color: var(--t3);
  font-size: 14px;
}
.cv-stats-group { margin-bottom: 18px; }
.cv-stats-group-head {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 9px;
}
.cv-stats-group-head h4 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--t1);
}
.cv-stats-swatch {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  align-self: center;
}
.cv-stats-sub {
  font-size: 11px;
  color: var(--t4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cv-stats-cells {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 8px;
}
.cv-stats-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 10px;
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  background: var(--bg2);
}
.cv-stats-num {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--t1);
  line-height: 1.1;
}
.cv-stats-label {
  font-size: 10.5px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cv-stats-chart-block { margin-top: 20px; }
.cv-stats-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.cv-stats-chart-head h4 {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
}
.cv-stats-busiest { font-size: 11px; color: var(--t4); }
.cv-stats-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 92px;
}
.cv-stats-bars-month { gap: 6px; margin-bottom: 18px; }
.cv-stats-bar {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  /* faint baseline so the axis reads even on quiet days */
  background: linear-gradient(var(--bd2), var(--bd2)) bottom / 100% 2px no-repeat;
}
.cv-stats-bar-fill {
  width: 100%;
  background: var(--emerald);
  border-radius: 3px 3px 0 0;
  transition: height 0.4s var(--ease);
}
.cv-stats-bar-x {
  position: absolute;
  bottom: -15px;
  left: -2px;
  right: -2px;
  text-align: center;
  font-size: 9px;
  color: var(--t4);
}
.cv-stats-foot {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--bd);
  font-size: 11px;
  color: var(--t4);
}

/* ── 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
   ============================================================ */
/* When the templates panel is docked open it takes 220px from the action bar. On
   anything narrower than a wide desktop that pushes the action buttons onto a second
   row, so collapse them to icon-only (the labels stay as title/aria-label tooltips)
   to keep the bar a single row. Panel closed -> bar gets full width -> labels return. */
@media (max-width: 1400px) {
  #cv-sidebar:not(.collapsed) ~ .cv-main .cv-actionbar-right .cv-icon-btn span { display: none; }
  #cv-sidebar:not(.collapsed) ~ .cv-main .cv-actionbar-right .cv-icon-btn { padding: 8px; }
}

@media (max-width: 1024px) {
  .cv-sidebar { position: fixed; left: 0; top: var(--cv-chrome-h); 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: flex; }
  .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%; }
  /* Let the toolbar groups wrap so no action button overflows off-screen. */
  .cv-actionbar-left,
  .cv-actionbar-right { flex-wrap: wrap; flex-shrink: 1; row-gap: 6px; }
}

@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 {
  /* White everything so the app's cream background never bleeds onto pages. */
  html, body { background: #fff !important; }
  /* Force accent fills / coloured bars to print even when the user hasn't ticked
     "Background graphics" -> otherwise design-led templates lose their colour. */
  .cv-page, .cv-page * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body::before, body::after { display: none !important; }
  .nav, .cv-actionbar, .cv-editor, .cv-mobile-toggle,
  .cv-drawer, .cv-modal-bg, .dark-fab, .cv-sidebar, .skip-link,
  .cv-add-section-wrap, .cv-seo, .editor-topbar, .cv-toast,
  .help-backdrop, .help-drawer, .footer, .cv-pdf-loader { display: none !important; }
  .cv-app, .cv-main, .cv-workspace, .cv-preview, .cv-preview-inner { background: #fff !important; }
  /* Unclip the app shell so the whole resume prints, not just one viewport. */
  .cv-app { padding-top: 0; height: auto; overflow: visible; display: block; }
  .cv-main { width: 100%; height: auto; overflow: visible; }
  .cv-workspace { display: block; height: auto; min-height: 0; }
  .cv-preview { width: 100%; padding: 0; overflow: visible; border-left: none; height: auto; display: block; }
  .cv-preview-inner { max-width: 100%; }
  /* Export = one clean PORTRAIT page. @page margin:0 forces portrait (no
     landscape) and lets colour-led templates (creative sidebar, two-column
     panel, nordic accent bar) bleed to the paper edge instead of sitting inside
     a white frame / outline; each template keeps its own padding so the text
     stays inset. min-height:100vh fills exactly one page (safe now the page
     margin is 0) so colour panels reach the bottom edge instead of stopping at
     the content height. box-shadow/radius forced off so no card frame prints. */
  @page { size: portrait; margin: 0; }
  .cv-page { box-shadow: none !important; border-radius: 0 !important; max-width: 100%; margin: 0; min-height: 100vh !important; }
  .cv-page .cv-layout-sidebar { min-height: 100vh !important; }
  /* Cover letter prints with the same margin:0 page, so give the letter sheet
     its own inset (it has no colour to bleed). */
  body.printing-letter .cv-letter-sheet { padding: 18mm 16mm !important; }

  /* Cover-letter print mode: hide the resume app, show only the letter sheet. */
  body.printing-letter .cv-app { display: none !important; }
  body.printing-letter .cv-letter-sheet {
    display: block !important;
    max-width: 100%;
    color: #1a1614;
    font-family: var(--font, 'DM Sans', sans-serif);
  }
}

/* ── Cover letter print sheet ── (hidden on screen; revealed only in print) */
.cv-letter-sheet { display: none; }
.cv-letter-head { margin: 0 0 30px; padding-bottom: 14px; border-bottom: 1px solid #d9d4cc; }
.cv-letter-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px; font-weight: 600; color: #1a1614; letter-spacing: -0.01em;
}
.cv-letter-contact { font-size: 12.5px; color: #6e6862; margin-top: 6px; }
.cv-letter-body p { font-size: 14px; line-height: 1.7; color: #2b2723; margin: 0 0 14px; }
.cv-letter-body p:last-child { margin-bottom: 0; }

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

/* ============================================================
   SEO landing content (server-rendered, below the tool)
   ============================================================ */
.cv-seo {
  background: var(--bg);
  border-top: 1px solid var(--bd);
  padding: 80px 24px 104px;
  color: var(--t2);
}
.cv-seo-inner { max-width: 1040px; margin: 0 auto; }
.cv-seo-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin: 0 0 14px;
}
.cv-seo-h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.1;
  font-weight: 600;
  color: var(--t1);
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}
.cv-seo-lead {
  font-size: 19px;
  line-height: 1.6;
  color: var(--t2);
  margin: 0 0 16px;
  max-width: 720px;
}
.cv-seo-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--t2);
  margin: 0 0 44px;
  max-width: 720px;
}
.cv-seo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 0 0 56px;
}
.cv-seo-card {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: 14px;
  padding: 24px 22px;
}
.cv-seo-card h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--t1);
  margin: 0 0 8px;
}
.cv-seo-card p { font-size: 14.5px; line-height: 1.6; color: var(--t2); margin: 0; }
.cv-seo-subhead {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--t1);
  margin: 0 0 20px;
}
.cv-seo-steps {
  margin: 0 0 56px;
  padding: 0;
  list-style: none;
  counter-reset: cvstep;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 44px;
}
.cv-seo-steps li {
  counter-increment: cvstep;
  position: relative;
  padding: 2px 0 2px 48px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--t2);
}
.cv-seo-steps li::before {
  content: counter(cvstep);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cv-seo-steps li strong { color: var(--t1); }
.cv-seo-faq { display: flex; flex-direction: column; gap: 10px; }
.cv-seo-faq details {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: 12px;
  padding: 4px 18px;
}
.cv-seo-faq summary {
  font-size: 16px;
  font-weight: 600;
  color: var(--t1);
  cursor: pointer;
  padding: 14px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.cv-seo-faq summary::-webkit-details-marker { display: none; }
.cv-seo-faq summary::after {
  content: "+";
  font-size: 20px;
  line-height: 1;
  color: var(--accent);
  font-weight: 400;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}
.cv-seo-faq details[open] summary::after { transform: rotate(45deg); }
.cv-seo-faq details p {
  margin: 0;
  padding: 0 0 16px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--t2);
}
.cv-seo-links {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cv-seo-links li { margin: 0; }
.cv-seo-links a {
  display: block;
  padding: 12px 2px;
  font-size: 16px;
  color: var(--t1);
  text-decoration: none;
  border-bottom: 1px solid var(--bd);
  transition: color 0.18s var(--ease), padding-left 0.18s var(--ease);
}
.cv-seo-links li:last-child a { border-bottom: none; }
.cv-seo-links a:hover { color: var(--accent); padding-left: 8px; }
.cv-seo-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; align-items: start; }
.cv-seo-faqcol { min-width: 0; }
.cv-seo-rail { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 28px; }
.cv-seo-rail .cv-seo-subhead { font-size: 19px; margin: 0 0 6px; }
.cv-seo-rail .cv-seo-links { margin: 0; }
@media (max-width: 860px) {
  .cv-seo-cols { grid-template-columns: 1fr; gap: 36px; }
  .cv-seo-rail { position: static; }
  .cv-seo-steps { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .cv-seo { padding: 56px 18px 72px; }
  .cv-seo-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Toast notifications
   ============================================================ */
.cv-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: var(--t1);
  color: var(--bg);
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  z-index: 400;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.cv-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.cv-toast[data-kind="error"] { background: #e11d48; color: #fff; }
.cv-toast[data-kind="success"] { background: #059669; color: #fff; }

/* ============================================================
   Accessibility: visible keyboard focus
   ============================================================ */
:where(.nav, .editor-topbar, .cv-app, .cv-seo, .help-drawer, .cv-drawer, .cv-modal-bg)
  :is(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Cover-letter modal actions */
.cv-cl-actions { gap: 8px; margin-top: 10px; }

/* LinkedIn import guide */
.cv-li-steps { margin: 4px 0 18px; padding-left: 22px; display: flex; flex-direction: column; gap: 9px; }
.cv-li-steps li { font-size: 14px; line-height: 1.5; color: var(--t2); }
.cv-li-steps li strong { color: var(--t1); font-weight: 600; }
.cv-li-privacy { font-size: 12.5px; color: var(--t3); margin: 10px 0 0; text-align: center; }

/* On-device AI output */
.cv-ai-block strong { display: block; font-size: 13px; color: var(--t1); margin-bottom: 8px; }
.cv-ai-pre { white-space: pre-wrap; font-size: 13px; line-height: 1.5; color: var(--t2); background: var(--bg); border: 1px solid var(--bd); border-radius: 8px; padding: 10px 12px; margin: 0; font-family: var(--font); }
.cv-ai-note { font-size: 12px; color: var(--t3); margin: 8px 0 0; }
/* Per-bullet on-device rewrite cards (original -> suggested, with Apply) */
.cv-ai-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cv-ai-apply-all { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--accent); background: transparent; color: var(--accent); cursor: pointer; }
.cv-ai-apply-all:hover:not(:disabled) { background: var(--accent); color: #fff; }
.cv-ai-apply-all:disabled { opacity: 0.5; cursor: default; border-color: var(--bd); color: var(--t3); }
.cv-ai-card { border: 1px solid var(--bd); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: var(--bg); }
.cv-ai-card.applied { opacity: 0.6; }
.cv-ai-old { font-size: 12.5px; line-height: 1.45; color: var(--t3); text-decoration: line-through; margin-bottom: 4px; }
.cv-ai-new { font-size: 13.5px; line-height: 1.5; color: var(--t1); font-weight: 500; }
.cv-ai-apply-btn { margin-top: 8px; font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 6px; border: none; background: var(--accent); color: #fff; cursor: pointer; }
.cv-ai-apply-btn:hover:not(:disabled) { background: var(--acc-hover, var(--accent)); filter: brightness(0.95); }
.cv-ai-apply-btn:disabled { background: var(--green, #059669); cursor: default; }

/* Subtle A4 page-break guide in the on-screen preview (screen only, never prints).
   A faint neutral line marks ~where each printed page ends. */
@media screen {
  .cv-preview .cv-page {
    background-image: repeating-linear-gradient(
      to bottom,
      transparent 0, transparent 1099px,
      rgba(120, 120, 130, 0.22) 1099px, rgba(120, 120, 130, 0.22) 1100px);
  }
}

/* Dark mode: lift editor cards/inputs off the near-black editor background so the
   working column doesn't read as a featureless slab. */
.dark .cv-sec { background: #211b18; border-color: rgba(240, 237, 230, 0.14); }
.dark .cv-sec:hover { border-color: rgba(240, 237, 230, 0.24); }
.dark .cv-input,
.dark .cv-textarea,
.dark .cv-dropdown-btn,
.dark .cv-icon-btn { border-color: rgba(240, 237, 230, 0.16); }
.dark .cv-actionbar { border-bottom-color: rgba(240, 237, 230, 0.12); }

/* Multiple-resume switcher menu */
.cv-resume-item { display: flex; align-items: center; gap: 2px; border-radius: 6px; }
.cv-resume-item.active { background: var(--accent-light); }
.cv-resume-pick {
  flex: 1; text-align: left; background: none; border: none; cursor: pointer;
  padding: 8px 10px; font-size: 13px; color: var(--t1); font-family: var(--font);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
.cv-resume-item.active .cv-resume-pick { color: var(--accent); font-weight: 600; }
.cv-resume-act {
  background: none; border: none; cursor: pointer; color: var(--t4);
  padding: 4px 7px; border-radius: 5px; font-size: 13px; line-height: 1;
}
.cv-resume-act:hover { color: var(--t1); background: var(--bg3); }
#resume-dropdown-label { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Destructive "remove all saved data" entry at the bottom of the resume menu. */
.cv-resume-clear { color: #dc2626; border-top: 1px solid var(--bd); margin-top: 4px; }
.cv-resume-clear:hover { background: rgba(220, 38, 38, 0.08); }

/* Keyboard-accessible section reorder buttons */
.cv-sec-move {
  background: none;
  border: none;
  color: var(--t4);
  cursor: pointer;
  padding: 2px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
}
.cv-sec-move:hover:not(:disabled) { color: var(--t1); background: var(--bg3); }
.cv-sec-move:disabled { opacity: 0.3; cursor: default; }

/* ============================================================
   3D PDF export loader
   Shown for a beat when the user hits "Download PDF", while the
   browser's print dialog spins up. A resume sheet rotates in real
   3D (perspective + preserve-3d), front face is a mini resume, back
   face is the paper underside. Warm-tinted shadow, no neon glow.
   Hidden in @media print so it never lands on the page.
   Accent comes in live via --cv-loader-accent (set by the builder JS).
   ============================================================ */
.cv-pdf-loader {
  --cv-loader-accent: var(--accent);
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.34s var(--ease), visibility 0s linear 0.34s;
}
.cv-pdf-loader.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.34s var(--ease), visibility 0s;
}
.cv-pdf-loader__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(240, 237, 230, 0.82);   /* frosted cream */
  -webkit-backdrop-filter: blur(14px) saturate(118%);
  backdrop-filter: blur(14px) saturate(118%);
}
.dark .cv-pdf-loader__backdrop { background: rgba(15, 13, 12, 0.86); }

.cv-pdf-loader__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateY(10px) scale(0.97);
  transition: transform 0.42s var(--ease);
}
.cv-pdf-loader.show .cv-pdf-loader__inner { transform: translateY(0) scale(1); }

/* ── 3D stage ── */
.cv-pdf-loader__stage {
  position: relative;
  width: 230px;
  height: 270px;
  margin-bottom: 30px;
  perspective: 1150px;
  perspective-origin: 50% 42%;
}
/* Restrained warm-accent wash behind the sheet -> depth, not a neon orb. */
.cv-pdf-loader__glow {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 240px;
  height: 240px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    color-mix(in srgb, var(--cv-loader-accent) 26%, transparent) 0%,
    transparent 68%);
  filter: blur(6px);
  opacity: 0.55;
  animation: cv-pdf-glow 3.4s ease-in-out infinite;
}
.dark .cv-pdf-loader__glow { opacity: 0.7; }

/* Soft contact shadow that narrows as the sheet turns edge-on. Warm ink, not black. */
.cv-pdf-loader__shadow {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 150px;
  height: 22px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center,
    rgba(26, 22, 20, 0.26) 0%, rgba(26, 22, 20, 0) 70%);
  filter: blur(3px);
  animation: cv-pdf-shadow 2.6s linear infinite;
}
.dark .cv-pdf-loader__shadow {
  background: radial-gradient(ellipse at center,
    rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 70%);
}

/* Float + tilt wrapper (keeps the bob/tilt off the spin axis). */
.cv-pdf-loader__doc {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 176px;
  height: 234px;
  margin: -117px 0 0 -88px;
  transform-style: preserve-3d;
  animation: cv-pdf-float 3.4s ease-in-out infinite;
}
/* Inner spinner (full 360 on Y). */
.cv-pdf-loader__sheet {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  animation: cv-pdf-spin 2.6s linear infinite;
}
.cv-pdf-loader__face {
  position: absolute;
  inset: 0;
  border-radius: 7px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(26, 22, 20, 0.22),
              0 2px 6px rgba(26, 22, 20, 0.12);
}
.cv-pdf-loader__face--front {
  background: #fff;
  /* faint top-down sheen for paper realism */
  background-image: linear-gradient(160deg, rgba(255,255,255,1) 0%, rgba(248,245,239,1) 100%);
  border: 1px solid rgba(26, 22, 20, 0.06);
}
.cv-pdf-loader__face--back {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, #f6f2ea 0%, #ece6db 100%);
  border: 1px solid rgba(26, 22, 20, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cv-pdf-loader__face--back::before {
  /* bound-edge accent stripe */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 7px;
  background: var(--cv-loader-accent);
  opacity: 0.85;
}
.cv-pdf-loader__mark {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: color-mix(in srgb, var(--cv-loader-accent) 70%, #5b534b);
  opacity: 0.78;
}

/* ── Mini resume on the front face ── */
.cv-pdf-loader__band {
  display: block;
  width: 100%;
  height: 30px;
  background: var(--cv-loader-accent);
}
.cv-pdf-loader__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 15px 16px 16px;
}
.cv-pdf-loader__bar {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: rgba(26, 22, 20, 0.11);
}
.cv-pdf-loader__bar--name {
  height: 9px;
  width: 64%;
  background: rgba(26, 22, 20, 0.7);
  margin-top: 2px;
}
.cv-pdf-loader__bar--sub {
  height: 5px;
  width: 42%;
  background: rgba(26, 22, 20, 0.28);
  margin-bottom: 4px;
}
.cv-pdf-loader__bar--line { width: 100%; }
.cv-pdf-loader__bar--short { width: 72%; }
.cv-pdf-loader__rule {
  display: block;
  height: 1px;
  background: rgba(26, 22, 20, 0.1);
  margin: 3px 0 2px;
}
.cv-pdf-loader__head {
  display: block;
  height: 5px;
  width: 34%;
  border-radius: 3px;
  background: color-mix(in srgb, var(--cv-loader-accent) 80%, transparent);
  margin: 6px 0 2px;
}

/* ── Caption + progress ── */
.cv-pdf-loader__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--t1);
  margin: 0 0 7px;
}
.cv-pdf-loader__sub {
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--t3);
  margin: 0 0 20px;
  min-height: 19px;
}
.cv-pdf-loader__progress {
  position: relative;
  width: 188px;
  height: 4px;
  border-radius: 4px;
  background: rgba(26, 22, 20, 0.1);
  overflow: hidden;
}
.dark .cv-pdf-loader__progress { background: rgba(240, 237, 230, 0.12); }
.cv-pdf-loader__progress span {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 42%;
  border-radius: 4px;
  background: linear-gradient(90deg,
    transparent,
    var(--cv-loader-accent),
    color-mix(in srgb, var(--cv-loader-accent) 40%, transparent));
  animation: cv-pdf-track 1.5s var(--ease) infinite;
}

@keyframes cv-pdf-spin {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(360deg); }
}
@keyframes cv-pdf-float {
  0%, 100% { transform: translateY(0) rotateX(8deg) rotateZ(-1deg); }
  50%      { transform: translateY(-12px) rotateX(8deg) rotateZ(1deg); }
}
@keyframes cv-pdf-shadow {
  0%, 50%, 100% { transform: translateX(-50%) scaleX(1); opacity: 0.85; }
  25%, 75%      { transform: translateX(-50%) scaleX(0.42); opacity: 0.45; }
}
@keyframes cv-pdf-glow {
  0%, 100% { opacity: 0.45; transform: translate(-50%, -50%) scale(0.94); }
  50%      { opacity: 0.62; transform: translate(-50%, -50%) scale(1.04); }
}
@keyframes cv-pdf-track {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(360%); }
}

/* Motion-sensitive users: hold a static 3D angle, just breathe the progress. */
@media (prefers-reduced-motion: reduce) {
  .cv-pdf-loader__sheet { animation: none; transform: rotateY(-20deg); }
  .cv-pdf-loader__doc { animation: none; transform: rotateX(7deg); }
  .cv-pdf-loader__shadow,
  .cv-pdf-loader__glow { animation: none; }
  .cv-pdf-loader__progress span {
    animation: cv-pdf-pulse 1.6s ease-in-out infinite;
    width: 100%;
    background: var(--cv-loader-accent);
  }
}
@keyframes cv-pdf-pulse {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.9; }
}
