/* ==========================================================================
   MYCV — COMPLETE STYLESHEET
   Design DNA: the site blue (#007BFF, see site.css) + Electric Teal
   ========================================================================== */

:root {
  --primary: hsl(211 100% 50%);
  --primary-hover: hsl(211 100% 44%);
  --primary-light: hsl(211 100% 50% / 0.08);
  --accent: hsl(178 72% 50%);
  --accent-muted: hsl(178 72% 40%);
  --radius: 0.6rem;

  --background: hsl(238 11% 98%);
  --foreground: hsl(238 30% 12%);
  --panel-bg: hsl(0 0% 100%);
  --panel-border: hsl(238 15% 90%);
  --input-bg: hsl(238 15% 96%);
  --input-border: hsl(238 12% 85%);
  --input-focus: hsl(211 100% 50%);
  --text-main: hsl(238 30% 16%);
  --text-muted: hsl(238 10% 45%);
  --shadow-sm: 0 1px 2px hsl(238 30% 12% / 0.05);
  --shadow: 0 4px 16px hsl(238 30% 12% / 0.06);
  --shadow-lg: 0 12px 40px hsl(238 30% 12% / 0.12);
  --paper-shadow: 0 20px 60px hsl(238 30% 12% / 0.18), 0 4px 16px hsl(238 30% 12% / 0.08);
  --paper-bg: #ffffff;
  --paper-ink: hsl(238 20% 16%);
  --paper-rule: hsl(238 10% 88%);

  --font-header: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-serif: 'Lora', Georgia, serif;

  --btn-height: 36px;
  --icon-xs: 14px;
  --icon-sm: 16px;
  --icon-md: 18px;
  --icon-lg: 20px;
  --icon-xl: 40px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Kill the grey/blue flash on tap; keep keyboard focus via :focus-visible. */
html {
  -webkit-tap-highlight-color: transparent;
}
a, button, summary, [role="button"], label {
  -webkit-tap-highlight-color: transparent;
}
:focus:not(:focus-visible) {
  outline: none;
}

body {
  font-family: var(--font-body);
  background: var(--background);
  color: var(--foreground);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--input-border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Lucide icons — consistent sizing app-wide */
svg.lucide {
  width: var(--icon-sm);
  height: var(--icon-sm);
  flex-shrink: 0;
  stroke-width: 2;
  display: block;
}

/* ==========================================================================
   TOPBAR
   ========================================================================== */
.topbar {
  height: 56px;
  min-height: 56px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 100;
  flex-shrink: 0;
  gap: 1rem;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.logo-dot {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 2px 10px hsl(211 100% 50% / 0.3);
  flex-shrink: 0;
}
.logo-text {
  font-family: var(--font-header);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
}
.layout-switch {
  display: inline-flex;
  align-items: center;
  background: var(--input-bg);
  border-radius: var(--radius);
  padding: 3px;
  border: 1px solid var(--input-border);
  gap: 2px;
  height: calc(var(--btn-height) + 6px);
}
.layout-btn {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  height: var(--btn-height);
  padding: 0 0.875rem;
  border-radius: calc(var(--radius) - 2px);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.layout-btn svg.lucide {
  width: var(--icon-xs);
  height: var(--icon-xs);
}
.layout-btn.active {
  background: var(--panel-bg);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.layout-btn:hover:not(.active) {
  color: var(--foreground);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}
.topbar-divider {
  width: 1px;
  height: 20px;
  background: var(--panel-border);
  margin: 0 0.35rem;
  flex-shrink: 0;
}
.tbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: var(--btn-height);
  min-width: var(--btn-height);
  padding: 0 0.75rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.tbtn svg.lucide {
  width: var(--icon-sm);
  height: var(--icon-sm);
}
.tbtn-icon {
  width: var(--btn-height);
  min-width: var(--btn-height);
  padding: 0;
}
.tbtn-primary {
  background: var(--primary);
  color: #fff;
  padding: 0 1rem;
  box-shadow: 0 1px 3px hsl(211 100% 50% / 0.28);
}
.tbtn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 6px hsl(211 100% 50% / 0.35);
}
.tbtn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.tbtn-ghost:hover {
  background: var(--input-bg);
  color: var(--text-main);
}

/* ==========================================================================
   WORKSPACE
   ========================================================================== */
.workspace {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  display: flex; justify-content: center;
  position: relative; -webkit-overflow-scrolling: touch;
}
.preview-stage {
  width: 100%; max-width: 900px;
  padding: 2rem 1.5rem 5rem;
  display: flex; flex-direction: column; align-items: center;
}
.cv-paper-wrapper { width: 100%; display: flex; justify-content: center; }

#cv-html-rendering {
  width: fit-content; max-width: 100%;
  background: transparent; position: relative;
  transition: transform 0.15s ease; box-sizing: border-box;
  transform-origin: top center;
}

/* Multi-page Sheet */
.cv-page-sheet {
  width: 210mm; min-height: 297mm;
  background: var(--paper-bg); color: var(--paper-ink);
  padding: 18mm 17mm;
  box-shadow: var(--paper-shadow);
  border-radius: 3px;
  position: relative; overflow: hidden;
  --cv-font-scale: 1;
  font-size: calc(10.5pt * var(--cv-font-scale, 1)); line-height: 1.55;
  font-family: var(--font-serif);
  box-sizing: border-box;
  margin-bottom: 2rem;
  color: var(--cv-body-text, var(--paper-ink));
}
.cv-page-content { width: 100%; position: relative; }

/* Sidebar designs (6 / 16 / 18): the coloured rail is painted on the layout,
   not the sheet, so its width matches the flex column and never covers the
   main text. Full identity content lives on page 1 only; later pages keep an
   empty rail for the colour band. */
.cv-page-sheet.has-sidebar {
  display: flex;
  flex-direction: column;
}
.cv-page-sheet.has-sidebar > .cv-page-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.cv-page-sheet.has-sidebar .cv-t6-layout {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  /* flex-start keeps the main column at its content height so pagination
     is not fooled by a tall sidebar stretching the column. The rail colour
     still fills the page via ::before + min-height. */
  align-items: flex-start;
  min-height: 100%;
  gap: 16pt;
}
.cv-page-sheet.has-sidebar .cv-t6-layout::before {
  content: '';
  position: absolute;
  top: calc(var(--cv-pad-y, 18mm) * -1);
  bottom: calc(var(--cv-pad-y, 18mm) * -1);
  width: calc(30% + var(--cv-pad-x, 17mm));
  background: var(--cv-header-bg, hsl(220 45% 22%));
  z-index: 0;
  pointer-events: none;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.cv-page-sheet.has-sidebar.sidebar-left .cv-t6-layout::before {
  left: calc(var(--cv-pad-x, 17mm) * -1);
}
.cv-page-sheet.has-sidebar.sidebar-right .cv-t6-layout::before {
  right: calc(var(--cv-pad-x, 17mm) * -1);
  left: auto;
}
.cv-page-sheet.has-sidebar .cv-t6-sidebar,
.cv-page-sheet.has-sidebar .cv-t6-main {
  position: relative;
  z-index: 1;
}
.cv-page-sheet.has-sidebar .cv-t6-sidebar {
  flex: 0 0 calc(30% + var(--cv-pad-x, 17mm));
  max-width: calc(30% + var(--cv-pad-x, 17mm));
  box-sizing: border-box;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* Editor chrome (↑↓× / section buttons) overlays on hover — do not shrink
   rail headings to ~70px, which wrapped "Skills & Expertise" mid-word. */
.cv-t6-sidebar .cv-section-head .section-title {
  padding-right: 0;
}
.cv-page-sheet.has-sidebar .cv-t6-main {
  flex: 1 1 auto;
  min-width: 0;
}
.cv-page-sheet.has-sidebar .cv-t6-sidebar-continued {
  /* Continuation pages: keep the column so the rail paints, but no identity. */
  min-height: 1px;
  pointer-events: none;
}
/* …unless the rail overflowed page 1: pagination moves the tail of the
   skills list here, and those rows stay editable. */
.cv-page-sheet.has-sidebar .cv-t6-sidebar-continued.has-content {
  pointer-events: auto;
}

/* ==========================================================================
   CV CONTENT — INLINE EDITABLE FIELDS
   ========================================================================== */
[contenteditable="true"] {
  outline: none; cursor: text;
  border-radius: 2px;
  transition: background 0.15s, box-shadow 0.15s;
}
/* Editor: never show auto-detected or legacy link chrome — editing stays plain text.
   Real links are created only in export preview / PDF / publish. */
#cv-html-rendering a,
#cv-html-rendering .cv-inline-link {
  color: inherit !important;
  text-decoration: none !important;
  pointer-events: none;
  cursor: text;
  background: transparent !important;
}
#cv-html-rendering .cv-link-out-icon {
  display: none !important;
}
[contenteditable="true"]:hover { background: hsl(211 100% 50% / 0.04); }
[contenteditable="true"]:focus {
  background: hsl(211 100% 50% / 0.08);
  box-shadow: 0 0 0 2px var(--primary-light), 0 0 0 4px var(--primary-light);
  border-radius: 3px;
}
[contenteditable="true"]:empty:before,
[contenteditable="true"]:empty::before {
  content: attr(data-placeholder);
  /* Inherit the field's ink (white on banded headers, dark on paper)
     so placeholders stay readable instead of a fixed muted grey. */
  color: currentColor;
  opacity: 0.5;
  font-style: italic;
  /* Clicks on the hint go to its field. An empty field laid out inline (the
     one-line entry rows of Linen and Sunline) has no box but this hint, so
     with pointer-events off a click fell through and the field could not be
     edited. */
  pointer-events: auto;
  cursor: text;
}
/* Colored header bands / dark sidebars: a bit more presence so faded
   white placeholders don't disappear into the gradient. */
.has-header-band .cv-header [contenteditable="true"]:empty::before,
.cv-t6-sidebar [contenteditable="true"]:empty::before,
.template-8-style .cv-header-with-photo [contenteditable="true"]:empty::before,
.template-5-style .cv-header-with-photo [contenteditable="true"]:empty::before,
.template-11-style .cv-header [contenteditable="true"]:empty::before {
  opacity: 0.68;
}

/* CV Header */
.cv-header {
  text-align: center; margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1.5px solid var(--cv-header-rule, var(--paper-rule));
  position: relative;
}
.cv-header h1 {
  font-family: var(--font-header);
  font-size: calc(22pt * var(--cv-font-scale, 1)); font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.3rem;
  color: var(--cv-name-color, var(--cv-header-text, var(--paper-ink)));
  line-height: 1.2;
}
.cv-header .tagline {
  font-family: var(--font-body);
  font-size: calc(9.5pt * var(--cv-font-scale, 1));
  color: var(--cv-tagline-color, var(--cv-header-text, var(--text-muted)));
  font-weight: 400; letter-spacing: 0.03em;
  margin-bottom: 0.6rem;
}
.cv-contact-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 0.65rem;
  font-family: var(--font-body);
  font-size: calc(8.5pt * var(--cv-font-scale, 1));
  color: var(--cv-contact-color, var(--cv-header-text, var(--text-muted)));
  position: relative;
}
.cv-contact-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.cv-contact-sep {
  opacity: 0.35;
  user-select: none;
  pointer-events: none;
}
.cv-contact-actions {
  position: absolute;
  top: -10px;
  right: -10px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 4;
}
.cv-contact-item:hover .cv-contact-actions { opacity: 1; }
.cv-contact-actions button {
  width: 16px; height: 16px; border-radius: 3px; border: none;
  background: var(--paper-bg); color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1;
  box-shadow: var(--shadow-sm);
  padding: 0;
}
.cv-contact-actions button:hover { background: hsl(0 75% 55%); color: #fff; }
/* Editor chrome only. Zero width in the flow so a full contact line never
   pushes the + onto a lonely second row; the button floats in the gap after
   the last item instead, and spills into the page margin when the row is
   exactly full. */
.cv-contact-add-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 0;
  height: 18px;
  margin-left: 0;
  overflow: visible;
}
.cv-contact-add-btn {
  position: absolute;
  left: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 3px;
  border: 1px dashed currentColor;
  background: transparent;
  /* Buttons do not inherit `color` by default — force it so the +
     follows the contact row (white on banded headers, muted on paper). */
  color: inherit;
  opacity: 0.78;
  cursor: pointer; font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; transition: opacity 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}
.cv-contact-add-btn:hover {
  opacity: 1;
  background: hsl(211 100% 50% / 0.12);
  border-color: var(--primary);
  color: var(--primary);
}
/* Colored header bands / dark sidebars: keep the + light on the gradient */
.has-header-band .cv-header .cv-contact-add-btn,
.template-8-style .cv-header-with-photo .cv-contact-add-btn,
.template-11-style .cv-header .cv-contact-add-btn {
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.85) !important;
  opacity: 0.95;
  -webkit-text-fill-color: #fff;
}
.has-header-band .cv-header .cv-contact-add-btn:hover,
.template-8-style .cv-header-with-photo .cv-contact-add-btn:hover,
.template-11-style .cv-header .cv-contact-add-btn:hover {
  color: #fff !important;
  border-color: #fff !important;
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
  -webkit-text-fill-color: #fff;
}
/* Side columns: the + takes the column's own ink. Forced white, it vanished
   on the light rails (Linen, Meridian, Marigold), leaving no visible way to
   add a contact there. */
.cv-t6-sidebar .cv-contact-add-btn {
  color: inherit !important;
  border-color: currentColor !important;
  -webkit-text-fill-color: currentColor;
  opacity: 0.8;
}
.cv-t6-sidebar .cv-contact-add-btn:hover {
  background: color-mix(in srgb, currentColor 14%, transparent);
  opacity: 1;
}
/* Under a rail's contact list it is a labelled button, not a bare +. */
.cv-t6-contact-add-line .cv-contact-add-btn {
  width: auto;
  padding: 0 8px;
  gap: 4px;
  font-size: 11px;
  white-space: nowrap;
}
.cv-t6-contact-add-line .cv-contact-add-btn::after {
  content: 'Add contact';
  font-family: var(--font-body, inherit);
}
.cv-contact-add-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 140px;
  /* Solid paint — some templates fade contact rows with opacity, which would
     otherwise make this menu see-through over the CV body. */
  background: #ffffff;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 80;
  overflow: hidden;
  opacity: 1;
  color: #201f1e;
  -webkit-text-fill-color: #201f1e;
}
.cv-contact-add-menu.open { display: block; }
/* Floated onto <body> while open so template opacity / paper transforms
   cannot wash out or clip the options. */
.cv-contact-add-menu.is-floating {
  position: fixed;
  transform: none;
  z-index: 10050;
}
.cv-contact-add-menu button {
  display: block; width: 100%;
  padding: 0.45rem 0.75rem;
  border: none; background: #ffffff;
  text-align: left; font-family: var(--font-body);
  font-size: 0.8rem; color: #201f1e;
  -webkit-text-fill-color: #201f1e;
  cursor: pointer;
  opacity: 1;
}
.cv-contact-add-menu button:hover {
  background: #f3f2f1; color: #0078d4;
  -webkit-text-fill-color: #0078d4;
}
.cv-contact-label {
  font-weight: 600;
  font-size: 0.92em;
  outline: none;
}
.cv-contact-custom-sep { margin: 0 2px; }
.cv-contact-custom .cv-contact-label:empty::before {
  content: attr(data-placeholder);
  color: currentColor;
  opacity: 0.5;
  font-style: italic;
}
.template-6-style .cv-contact-label {
  font-weight: 600;
  margin-right: 4px;
}
.cv-contact-link {
  color: inherit;
  text-decoration: none;
  cursor: text;
}
.cv-contact-link .cv-contact-text {
  color: inherit;
}
.cv-contact-link:hover .cv-contact-text {
  text-decoration: none;
  opacity: 0.85;
}
/* cv-inline-link only exists on the export/publish clone briefly before
   activateLinksForExport turns it into a real anchor. */
.cv-pdf-link {
  color: inherit;
  text-decoration: none;
}
a.cv-pdf-link,
a.cv-contact-link.cv-pdf-link {
  text-decoration: none;
}
.cv-link-out-icon {
  display: inline-block;
  vertical-align: -0.12em;
  width: 0.72em;
  height: 0.72em;
  margin-left: 0.14em;
  color: currentColor;
  flex-shrink: 0;
}
.export-preview-cv a.cv-pdf-link,
.export-preview-cv a.cv-contact-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
}
.export-preview-cv a.cv-pdf-link:hover,
.export-preview-cv a.cv-contact-link:hover {
  opacity: 0.9;
}
.contact-sep { opacity: 0.35; user-select: none; pointer-events: none; }

/* Template 2 (Modern) Overrides */
.template-2-style {
  font-family: var(--font-body);
}
.template-2-style .section-title {
  color: hsl(210 80% 45%);
  border-bottom-width: 2px;
}
.template-2-style .cv-header h1 { color: hsl(210 80% 28%); font-family: var(--font-header); }
.template-2-style .cv-entry-title { font-family: var(--font-header); }

/* Section */
.cv-section { margin-bottom: var(--cv-section-gap, 0.9rem); position: relative; }
.cv-section-head {
  position: relative;
  margin-bottom: 0.55rem;
}
.cv-section-head .section-title {
  margin-bottom: 0;
  padding-right: 112px;
}
.section-title {
  font-family: var(--font-header);
  font-size: calc(11pt * var(--cv-font-scale, 1)); font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--cv-section-title-color, var(--primary));
  border-bottom: 1.2px solid var(--cv-section-rule-color, var(--paper-rule));
  padding-bottom: 0.2rem; margin-bottom: 0.55rem;
}

/* Summary */
.cv-summary {
  font-size: calc(10pt * var(--cv-font-scale, 1)); line-height: 1.6;
  margin-bottom: 0.9rem;
  color: var(--cv-body-text, var(--paper-ink));
}

/* Entry Items */
.cv-entry-item {
  margin-bottom: 0.6rem; position: relative;
  /* Header row keeps a gutter so date and entry buttons don't collide.
     Bullets use the full column; their hover controls overlay. */
  --entry-actions-space: 108px;
}
.cv-entry-item:last-child { margin-bottom: 0; }
.cv-entry-header {
  display: flex; justify-content: space-between;
  align-items: baseline; flex-wrap: wrap;
  margin-bottom: 0.15rem;
  padding-right: var(--entry-actions-space);
}
.cv-entry-header > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.35em;
  min-width: 0;
  flex: 1 1 auto;
}
.cv-entry-header > div > .continued-tag {
  flex: 0 0 auto;
}
.cv-entry-header > div > .cv-entry-subtitle,
.cv-entry-header > div > .cv-entry-loc {
  flex: 1 1 100%;
}
.cv-entry-title {
  font-weight: 700; font-size: calc(10.5pt * var(--cv-font-scale, 1));
  color: var(--cv-entry-title-color, var(--paper-ink));
}
.cv-entry-subtitle {
  font-weight: 500; font-size: calc(10pt * var(--cv-font-scale, 1));
  color: var(--cv-entry-title-color, var(--paper-ink));
  font-style: italic;
}
.cv-entry-date {
  font-size: calc(8.5pt * var(--cv-font-scale, 1));
  color: var(--cv-muted-text, var(--text-muted));
  white-space: nowrap; font-family: var(--font-body);
  flex-shrink: 0;
}
.cv-entry-header > .cv-entry-date {
  max-width: calc(100% - 0.5rem);
}
.cv-entry-loc {
  font-size: calc(8.5pt * var(--cv-font-scale, 1));
  color: var(--cv-muted-text, var(--text-muted));
  font-family: var(--font-body);
}

.cv-bullet-list { list-style: none; padding: 0; margin: 0.3rem 0 0 0; }
.cv-bullet-list li {
  position: relative; padding-left: 1em;
  margin-bottom: 0.2rem;
  font-size: calc(10pt * var(--cv-font-scale, 1)); line-height: 1.55;
  color: var(--cv-body-text, inherit);
}
/* Don't reserve a second action column inside an entry — that stacked
   92px + 92px and made sidebar templates look like a skinny text well. */
.cv-entry-item .cv-bullet-list li:not(.add-bullet-li) {
  padding-right: 0;
}
/* Stand-alone bullet sections align with section-header controls. */
.cv-section > .cv-bullet-list li:not(.add-bullet-li),
.cv-section > .custom-bullets li:not(.add-bullet-li) {
  padding-right: 112px;
}
.cv-bullet-list li::before {
  content: '\25B8'; position: absolute; left: 0;
  color: var(--cv-accent-color, var(--primary));
  font-size: calc(7pt * var(--cv-font-scale, 1)); top: 0.35em;
}

/* Skills — two-column grid aligned with LaTeX tabular (24% / 76%) */
.skills-table { display: flex; flex-direction: column; gap: 0.45rem; }
.skill-row {
  display: grid;
  grid-template-columns: 24% 1fr;
  column-gap: 0.65rem;
  align-items: start;
  font-size: calc(10pt * var(--cv-font-scale, 1));
  line-height: 1.55;
  position: relative;
  /* ↑ ↓ × sit in .skill-actions on the right — reserve room so text never
     runs under them (especially in narrow sidebar rails). */
  --skill-actions-space: 68px;
  padding-right: var(--skill-actions-space);
}
.skill-cat {
  font-weight: 700;
  color: var(--paper-ink);
  font-family: var(--font-body);
  font-size: calc(9.5pt * var(--cv-font-scale, 1));
  line-height: 1.55;
  text-align: left;
}
.skill-cat::after { content: ':'; }
.skill-items {
  color: var(--cv-body-text, var(--paper-ink));
  min-width: 0;
  word-break: break-word;
}
/* layout.skillsFormat = "lines": category and items run on as one line
   each, no grid. Word and LaTeX print the same stacked shape, so the export
   carries no table for an ATS to scramble. */
.skills-lines .skill-row { display: block; }
.skills-lines .skill-cat { display: inline; margin-right: 0.35em; }
.skills-lines .skill-items { display: inline; }
.skills-lines .skill-row .skill-level { display: block; }

/* Awards */
.awards-table { display: flex; flex-direction: column; gap: 0.25rem; font-size: calc(10pt * var(--cv-font-scale, 1)); }
.award-row { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; padding-right: 28px; margin-bottom: 0.2rem; position: relative; }
.award-year { font-weight: 700; white-space: nowrap; min-width: 50px; font-family: var(--font-body); font-size: calc(9.5pt * var(--cv-font-scale, 1)); }
.award-body { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; min-width: 0; }
.award-desc { font-style: italic; }
.award-issuer { color: var(--cv-muted-text, var(--text-muted)); font-size: calc(9pt * var(--cv-font-scale, 1)); }
.cv-entry-meta { font-size: 0.92em; opacity: 0.85; margin-top: 0.1rem; }

/* Continued tag on page splits */
.continued-tag {
  font-style: italic; font-size: 0.8em;
  color: var(--cv-muted-text, var(--text-muted)); font-weight: normal;
  font-family: var(--font-body);
  text-transform: none; letter-spacing: normal;
  white-space: nowrap;
}
.cv-t6-sidebar .continued-tag {
  color: inherit;
  opacity: 0.72;
}

/* ==========================================================================
   HOVER CONTROLS
   ========================================================================== */
.cv-section-actions {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 5;
}
.cv-section:hover .cv-section-actions { opacity: 1; }
.cv-section-actions button {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: none;
  background: var(--panel-bg);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 12px;
  line-height: 1;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.cv-section-actions button:hover { background: var(--primary); color: #fff; }
.cv-section-actions button.del-btn,
.cv-section-actions button.section-del-btn { color: var(--text-muted); }
.cv-section-actions button.del-btn:hover,
.cv-section-actions button.section-del-btn:hover { background: hsl(0 75% 55%); color: #fff; }
.cv-section-actions .section-move-btn {
  font-size: 11px; line-height: 1; font-weight: 700;
}

.cv-entry-actions {
  position: absolute; top: 2px; right: 0;
  display: flex; gap: 2px; align-items: flex-start;
  opacity: 0; transition: opacity 0.2s;
  z-index: 5;
}
.cv-entry-item:hover > .cv-entry-actions,
.cv-entry-item:focus-within > .cv-entry-actions,
.cv-entry-actions:has(.entry-more.is-open) { opacity: 1; }
/* Keep the open menu above sibling hover chrome, and don't let it sit on
   bullet / skill controls underneath. */
.cv-entry-item:has(.entry-more.is-open) > .cv-entry-actions { z-index: 40; }
.cv-entry-item:has(.entry-more.is-open) .bullet-actions,
.cv-entry-item:has(.entry-more.is-open) .skill-actions,
.cv-entry-item:has(.entry-more.is-open) .bullet-improve,
.cv-entry-item:has(.entry-more.is-open) .bullet-delete,
.cv-entry-item:has(.entry-more.is-open) .bullet-move {
  opacity: 0 !important;
  pointer-events: none !important;
}
.cv-entry-actions button {
  width: 20px; height: 20px; border-radius: 3px; border: none;
  background: var(--paper-bg); color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.cv-entry-actions button:hover { background: hsl(0 75% 55%); color: #fff; }
.cv-entry-actions .entry-more-btn:hover,
.cv-entry-actions .entry-move-btn:hover,
.cv-entry-actions .dup-btn:hover { background: var(--primary); color: #fff; }
.cv-entry-actions .del-btn:hover { background: hsl(0 75% 55%); color: #fff; }
.entry-more { position: relative; }
.entry-more-btn svg { width: 14px; height: 14px; pointer-events: none; }
.entry-more-btn.has-active {
  color: var(--cv-accent-color, var(--primary));
}
/* Open beside the ⋮ (into the entry), not down over bullets below. */
.entry-more-menu {
  position: absolute; top: 0; right: calc(100% + 6px); left: auto;
  min-width: 10.5rem; padding: 0.25rem;
  background: #fff; border: 1px solid #e1dfdd; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: flex; flex-direction: column; gap: 1px;
  z-index: 30;
}
.entry-more-menu[hidden] { display: none; }
.entry-more-item {
  width: 100% !important; height: auto !important; min-height: 28px;
  justify-content: flex-start !important;
  padding: 0.35rem 0.55rem !important; border-radius: 6px !important;
  border: none !important; box-shadow: none !important;
  background: transparent !important; color: #201f1e !important;
  font: 500 0.75rem/1.3 var(--font-ui, 'Inter', system-ui, sans-serif) !important;
  text-align: left; white-space: nowrap;
}
.entry-more-item:hover {
  background: #f3f2f1 !important; color: #201f1e !important;
}
.entry-more-item.is-on {
  color: var(--primary) !important;
  background: hsl(211 100% 50% / 0.08) !important;
}

/* Custom section bullet toggle button */
.bullet-toggle-btn {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
  font-weight: 600;
}
.bullet-toggle-btn:hover {
  background: var(--primary) !important;
  color: #fff !important;
}

/* Custom entry styles */
.custom-entry {
  position: relative;
  padding: 0.3rem 0;
}
.custom-entry:last-child {
  padding-bottom: 0;
}
.custom-entry .cv-entry-title {
  font-weight: 600;
  font-size: calc(10.5pt * var(--cv-font-scale, 1));
  margin-bottom: 0.2rem;
}
.custom-entry .cv-entry-title:empty::before,
.custom-entry .cv-entry-title[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: currentColor;
  opacity: 0.5;
  font-weight: 400;
  font-style: italic;
}
/* Custom section entry subtitle/date/location row */
.cv-entry-subtitle-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem;
  margin-bottom: 0.3rem;
  font-size: calc(9.5pt * var(--cv-font-scale, 1));
}
.cv-entry-subtitle-row .cv-entry-subtitle {
  font-weight: 500;
  font-style: italic;
  color: var(--paper-ink);
  min-width: 2em;
}
.cv-entry-subtitle-row .cv-entry-date {
  font-size: calc(8.5pt * var(--cv-font-scale, 1));
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 2em;
  flex-shrink: 0;
}
.cv-entry-subtitle-row .cv-entry-location {
  font-size: calc(8.5pt * var(--cv-font-scale, 1));
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 2em;
}
.cv-entry-subtitle-row .cv-entry-subtitle-sep {
  color: var(--paper-rule);
  user-select: none;
  font-size: calc(8pt * var(--cv-font-scale, 1));
}
.cv-entry-subtitle-row [contenteditable]:empty::before {
  content: attr(data-placeholder);
  color: currentColor;
  opacity: 0.5;
  font-style: italic;
}
.cv-custom-content {
  font-size: calc(10.5pt * var(--cv-font-scale, 1));
  line-height: 1.55;
  color: var(--paper-ink);
  min-height: 1.5em;
  white-space: pre-wrap;
}
.cv-custom-content:empty::before,
.cv-custom-content[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: currentColor;
  opacity: 0.5;
  font-style: italic;
}
.custom-bullets {
  margin-top: 0.3rem;
}

/* Bullet row controls — grouped like entry/section actions, not floated
   off the page edge with negative offsets. */
.bullet-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 5;
}
.cv-bullet-list li:hover > .bullet-actions { opacity: 1; }
.bullet-actions .bullet-delete,
.bullet-actions .bullet-improve,
.bullet-actions .bullet-move {
  position: static;
  opacity: 1;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  border: none;
  background: var(--paper-bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.bullet-actions .bullet-delete { font-size: 12px; }
.bullet-actions .bullet-delete:hover { background: hsl(0 75% 55%); color: #fff; }
.bullet-actions .bullet-improve:hover { background: var(--accent); color: #fff; }
.bullet-actions .bullet-move { font-weight: 700; }
.bullet-actions .bullet-move:hover { background: var(--primary); color: #fff; }

/* Bullet delete (legacy fallback if rendered outside .bullet-actions) */
.bullet-delete {
  position: absolute; right: 0; top: 0;
  width: 18px; height: 18px; border-radius: 3px; border: none;
  background: transparent; color: var(--text-muted);
  cursor: pointer; font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: all 0.15s;
}
.cv-bullet-list li:hover > .bullet-delete { opacity: 1; }
.bullet-delete:hover { background: hsl(0 75% 55%); color: #fff; }

/* Bullet AI improve (legacy fallback) */
.bullet-improve {
  position: absolute; right: 0; top: 0;
  width: 18px; height: 18px; border-radius: 3px; border: none;
  background: transparent; color: var(--text-muted);
  cursor: pointer; font-size: 10px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: all 0.15s;
}
.cv-bullet-list li:hover > .bullet-improve { opacity: 1; }
.bullet-improve:hover { background: var(--accent); color: #fff; }

/* Add bullet button */
.add-bullet-li { list-style: none; padding-left: 0; margin-top: 0.25rem; }
.add-bullet-li::before { display: none !important; }
.add-bullet-btn {
  background: none; border: 1px dashed var(--paper-rule);
  border-radius: 3px; padding: 2px 10px;
  font-family: var(--font-body); font-size: calc(8pt * var(--cv-font-scale, 1));
  color: var(--text-muted); cursor: pointer;
  transition: all 0.15s;
}
.add-bullet-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Skill row controls — same grouped chrome as bullet-actions */
.skill-actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 5;
}
.skill-row:hover > .skill-actions { opacity: 1; }
.skill-actions .skill-del {
  position: static;
  opacity: 1;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  border: none;
  background: var(--paper-bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.skill-actions .bullet-delete.skill-del { font-size: 12px; }
.skill-actions .bullet-move.skill-del { font-weight: 700; }
.skill-actions .bullet-move.skill-del:hover { background: var(--primary); color: #fff; }
.skill-actions .bullet-delete.skill-del:hover { background: hsl(0 75% 55%); color: #fff; }

/* ==========================================================================
   FAB (FLOATING ACTION BUTTON)
   ========================================================================== */
.floating-toolbar {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 200;
  display: flex; flex-direction: column-reverse;
  align-items: flex-end; gap: 8px;
}
.fab {
  width: 48px; height: 48px; border-radius: 50%;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); transition: all 0.2s;
}
.fab-primary { background: var(--primary); color: #fff; font-size: 22px; }
.fab-primary:hover { background: var(--primary-hover); transform: scale(1.05); }
.fab-primary svg.lucide {
  width: var(--icon-lg);
  height: var(--icon-lg);
}

.fab-menu {
  background: var(--panel-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--panel-border);
  padding: 0.3rem;
  display: none; flex-direction: column; gap: 2px;
  z-index: 199;
}
.fab-menu.open { display: flex; }
.fab-menu button {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.8rem; border: none;
  background: transparent; color: var(--text-main);
  font-family: var(--font-body); font-size: 0.85rem;
  cursor: pointer; border-radius: calc(var(--radius) - 2px);
  text-align: left; transition: all 0.15s;
  white-space: nowrap;
}
.fab-menu button:hover {
  background: var(--primary-light); color: var(--primary);
}
.fab-menu-icon {
  width: var(--icon-sm);
  height: var(--icon-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fab-menu-icon svg.lucide {
  width: var(--icon-sm);
  height: var(--icon-sm);
  opacity: 0.7;
}
.fab-menu button:hover .fab-menu-icon svg.lucide { opacity: 1; }

/* ==========================================================================
   MODAL (Office-style — matches ribbon)
   ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 550;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e1dfdd;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 12px 40px rgba(0, 0, 0, 0.18);
  width: 100%; max-width: 520px;
  max-height: 85vh; overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 48px;
  min-height: 48px;
  padding: 0 0.55rem 0 1.1rem;
  margin-bottom: 0;
  background: #ebeae8;
  border-bottom: 1px solid #edebe9;
  flex-shrink: 0;
}
.modal-head h3 {
  font-family: 'Segoe UI', var(--font-body), sans-serif;
  font-size: 0.9375rem;
  font-weight: 650;
  color: #201f1e;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.01em;
}
.modal-head h3 svg.lucide,
.modal-head h3 .confirm-title-icon svg {
  width: 16px;
  height: 16px;
  color: #605e5c;
  stroke-width: 1.75;
}
.confirm-title-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #605e5c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.modal-close svg.lucide {
  width: 16px;
  height: 16px;
}
.modal-close:hover { background: #ddd9d5; color: #201f1e; }

.modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  padding: 0 0.65rem;
  background: #ffffff;
  border-bottom: 1px solid #edebe9;
  flex-shrink: 0;
}
.modal-tab {
  height: 38px;
  padding: 0 0.85rem;
  border: none;
  background: transparent;
  font-family: 'Segoe UI', var(--font-body), sans-serif;
  font-size: 0.8125rem;
  line-height: 1;
  color: #605e5c;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
  position: relative;
}
.modal-tab svg.lucide {
  width: 14px;
  height: 14px;
  stroke-width: 1.75;
}
.modal-tab:hover {
  color: #201f1e;
  background: #faf9f8;
}
.modal-tab.active {
  color: #0078d4;
  background: transparent;
  border-bottom-color: #0078d4;
  font-weight: 600;
}

.modal-card .modal-body {
  padding: 1.1rem 1.25rem 1.25rem;
  overflow-y: auto;
  background: #ffffff;
}
.modal-label {
  display: block;
  margin-bottom: 0.45rem;
  font-family: 'Segoe UI', var(--font-body), sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #323130;
}

/* Confirm dialog — compact warning card, not a full feature modal */
#confirm-modal { z-index: 600; }
#confirm-modal .confirm-card {
  max-width: 320px;
  width: calc(100% - 2rem);
}
#confirm-modal .confirm-card .modal-head {
  height: 42px;
  min-height: 42px;
  padding: 0 0.4rem 0 0.9rem;
}
#confirm-modal .confirm-card .modal-body.confirm-body {
  padding: 0.85rem 1rem 0.35rem;
}
#confirm-modal .confirm-card .modal-footer.confirm-actions {
  padding: 0.65rem 0.9rem;
}
.confirm-body {
  text-align: center;
  padding-top: 0.85rem;
}
.confirm-icon-wrap {
  margin: 0 auto 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
}
.confirm-icon-wrap.mode-new,
.confirm-icon-wrap.mode-polish {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
}
.confirm-icon-custom {
  display: none;
  flex-shrink: 0;
}
.confirm-icon-wrap:not(.mode-new):not(.mode-polish) .confirm-icon-danger {
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-icon-wrap .confirm-delete-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}
.confirm-icon-wrap.mode-polish .confirm-icon-polish {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0078d4;
}
.confirm-icon-wrap.mode-polish .confirm-polish-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}
.confirm-icon-wrap.mode-new .confirm-icon-new {
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-icon-wrap.mode-new .confirm-new-icon {
  width: 64px;
  height: 64px;
  display: block;
  object-fit: contain;
}
.confirm-icon-wrap.mode-new .confirm-icon-new svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
  display: block;
}
.confirm-message {
  font-family: 'Segoe UI', var(--font-body), sans-serif;
  font-size: 0.875rem;
  color: #605e5c;
  line-height: 1.45;
  margin: 0;
}
.confirm-polish-icon {
  width: 36px;
  height: 36px;
  display: block;
  fill: currentColor;
}
.confirm-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
}
.confirm-actions .modal-btn {
  flex: 0 0 auto;
  min-width: 0;
  justify-content: center;
  height: 32px;
  min-height: 32px;
  box-sizing: border-box;
  border-width: 1px;
  border-style: solid;
}

/* Section manager (Layout tab) */
.section-manager-hint {
  font-family: 'Segoe UI', var(--font-body), sans-serif;
  font-size: 0.8125rem;
  color: #605e5c;
  margin: 0 0 0.85rem;
  line-height: 1.5;
}
.section-manager-list { display: flex; flex-direction: column; gap: 0; border: 1px solid #edebe9; border-radius: 10px; background: #fff; overflow: hidden; }
.section-manager-list.is-empty {
  border: none;
  background: transparent;
  overflow: visible;
}
.section-manager-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  border-radius: 0;
}
.section-manager-row + .section-manager-row { border-top: 1px solid #edebe9; }
.section-manager-row:hover { background: hsl(210 40% 98%); }
.section-manager-row.is-hidden { opacity: 1; }
.section-manager-row .sm-name,
.section-manager-row .modal-option-title,
.section-manager-row .sm-name-input {
  font-family: 'Segoe UI', var(--font-body), sans-serif;
  font-size: 0.875rem;
  font-weight: 650;
  color: #201f1e;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.section-manager-row .sm-name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.section-manager-row .sm-name-row .sm-name {
  flex: 1;
  min-width: 0;
}
.section-manager-row .sm-name-input {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 0.2rem 0.45rem;
  border: 1px solid #0078d4;
  border-radius: 6px;
  background: #fff;
  color: inherit;
  line-height: 1.35;
  box-shadow: 0 0 0 1px #0078d4;
  text-overflow: clip;
}
.section-manager-row.is-hidden .sm-name,
.section-manager-row.is-hidden .modal-option-title,
.section-manager-row.is-hidden .sm-name-input { text-decoration: none; color: #605e5c; }
.sm-drag {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-left: -0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #8a8886;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.sm-drag:hover { color: #323130; background: #f3f2f1; }
.sm-drag:active { cursor: grabbing; }
.sm-drag svg.lucide { width: 16px; height: 16px; pointer-events: none; }
.sm-actions { display: inline-flex; gap: 0.25rem; flex-shrink: 0; }
.sm-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #e1dfdd;
  background: #ffffff;
  color: #605e5c;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}
.sm-btn:hover:not(:disabled) { background: #f3f2f1; border-color: #c8c6c4; color: #323130; }
.sm-btn:disabled { opacity: 0.35; cursor: default; }
.sm-btn svg.lucide { width: 14px; height: 14px; }
.sm-edit {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #8a8886;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  opacity: 0.75;
}
.sm-edit:hover {
  color: #323130;
  background: #f3f2f1;
  opacity: 1;
}
.sm-edit:focus-visible {
  outline: 2px solid #0078d4;
  outline-offset: 1px;
}
.sm-edit-icon {
  width: 14px;
  height: 14px;
  display: block;
  pointer-events: none;
}
.section-manager-row:hover .sm-edit { opacity: 1; }
.section-manager-row.is-placeholder {
  background: #faf9f8 !important;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px #edebe9;
}
.section-manager-row.is-placeholder > * { visibility: hidden; }
body.sm-dragging,
body.sm-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}
.sm-drag-ghost {
  position: fixed;
  z-index: 12000;
  box-sizing: border-box;
  margin: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid #c8c6c4;
  border-radius: 10px;
  background: #ffffff;
  color: #201f1e;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.16), 0 2px 6px rgba(16, 24, 40, 0.08);
  transform: scale(1.02) rotate(0.4deg);
  opacity: 1;
}
.sm-drag-ghost.is-returning {
  transition: left 0.18s ease, top 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  transform: scale(1) rotate(0deg);
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.08);
  opacity: 1;
}
.sm-drag-ghost .sm-name,
.sm-drag-ghost .modal-option-title {
  color: #201f1e;
  opacity: 1;
}
.sm-drag-ghost .sm-edit,
.sm-drag-ghost .sm-vis,
.sm-drag-ghost .modal-option-desc { pointer-events: none; }
.section-manager-empty {
  font-family: 'Segoe UI', var(--font-body), sans-serif;
  font-size: 0.8125rem;
  color: #605e5c;
  text-align: center;
  padding: 1.1rem 1rem;
  border: 1px solid #edebe9;
  border-radius: 10px;
  background: #fff;
  margin: 0;
}

.modal-card .btn-ghost,
.modal-card .btn-danger,
.modal-card .btn-primary.modal-btn {
  font-family: 'Segoe UI', var(--font-body), sans-serif;
  font-size: 0.8125rem;
  border-radius: 8px;
  height: 32px;
  min-height: 32px;
  padding: 0 0.9rem;
  box-shadow: none;
}
.modal-card .btn-ghost {
  border: 1px solid #8a8886;
  background: #ffffff;
  color: #323130;
}
.modal-card .btn-ghost:hover {
  background: #edebe9;
  border-color: #605e5c;
}
.modal-card .btn-danger {
  background: #d13438;
  border: 1px solid #a4262c;
}
.modal-card .btn-danger:hover { background: #a4262c; }
.modal-card .btn-primary.modal-btn {
  margin-top: 0.75rem;
  background: #0078d4;
  border: 1px solid #0078d4;
}
.modal-card .btn-primary.modal-btn:hover { background: #106ebe; border-color: #106ebe; }
.modal-card .confirm-actions .btn-primary.modal-btn { margin-top: 0; }
.modal-btn-block { width: 100%; margin-top: 0.85rem; }

.parser-pane { display: none; }
.parser-pane.active { display: block; }
.modal-card .dropzone {
  border: 1px dashed #8a8886;
  border-radius: 2px;
  padding: 1.75rem 1rem;
  display: flex; flex-direction: column;
  align-items: center; gap: 0.35rem;
  text-align: center;
  color: #605e5c;
  font-family: 'Segoe UI', var(--font-body), sans-serif;
  font-size: 0.8125rem;
  transition: border-color 0.12s, background 0.12s;
  cursor: pointer;
  background: #ffffff;
}
.modal-card .dropzone > p {
  margin: 0;
  font-weight: 600;
  color: #323130;
}
.modal-card .dropzone > span {
  font-size: 0.75rem;
  color: #a19f9d;
}
.modal-card .dropzone > svg.lucide,
.modal-card .dropzone > .dropzone-file-icon {
  width: 28px;
  height: 28px;
  color: #0078d4;
  display: block;
}
.modal-card .dropzone:hover,
.modal-card .dropzone.drag-over {
  border-color: #0078d4;
  background: #f3f9fd;
}
.modal-card .parser-status {
  margin-top: 0.65rem;
  font-family: 'Segoe UI', var(--font-body), sans-serif;
  font-size: 0.8125rem;
  padding: 0.45rem 0.6rem;
  border-radius: 2px;
  border: 1px solid transparent;
  display: none;
}
.modal-card .parser-status.success {
  display: block;
  background: #dff6dd;
  border-color: #9fd89f;
  color: #0b6a0b;
}
.modal-card .parser-status.error {
  display: block;
  background: #fde7e9;
  border-color: #f1aeb5;
  color: #a4262c;
}
.modal-card .parser-status.loading {
  display: block;
  background: #ffffff;
  border-color: #edebe9;
  color: #605e5c;
}
.parser-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem 0.75rem;
  text-align: center;
}
.parser-loading p { margin: 0; }
.parser-loading .parser-loading-ring {
  width: 28px;
  height: 28px;
  margin: 0;
  color: #0078d4;
}

.modal-card .input-field {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid #8a8886;
  border-radius: 2px;
  font-family: 'Segoe UI', var(--font-body), sans-serif;
  font-size: 0.8125rem;
  background: #ffffff;
  color: #323130;
  resize: vertical;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.modal-card .input-field:focus {
  outline: none;
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}

/* Export preview modal */
.export-preview-card {
  max-width: min(920px, 96vw);
  max-height: 92vh;
}
.export-preview-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #3b3a39;
}
.export-preview-hint {
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: #d2d0ce;
  background: #323130;
  border-bottom: 1px solid #605e5c;
}
.export-preview-scroll {
  flex: 1;
  overflow: auto;
  padding: 1.25rem 0.75rem;
  -webkit-overflow-scrolling: touch;
}
.export-preview-fit {
  margin: 0 auto;
  overflow: hidden;
}
.export-preview-cv {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  transform-origin: top left;
}
.export-preview-cv .tag-delete-btn,
.export-preview-cv .add-tag-btn-wrap,
.export-preview-cv .keyval-delete-btn,
.export-preview-cv .add-keyval-btn,
.export-preview-cv .cv-t6-contact-add-line,
.export-preview-cv .bullet-toggle-btn,
.export-preview-cv .skill-level-unset,
.export-preview-cv .cv-format-bar,
.export-preview-cv .bullet-ai-menu {
  display: none !important;
}
.export-preview-cv .cv-page-sheet {
  margin-bottom: 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}
@media (max-width: 640px) {
  .export-preview-card {
    max-width: 100%;
    max-height: min(94vh, 94dvh);
  }
  .export-preview-scroll { padding: 0.6rem 0.4rem; }
  .export-preview-hint {
    font-size: 0.72rem;
    padding: 0.4rem 0.65rem;
  }
  .export-preview-footer {
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem;
  }
  .export-preview-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
.export-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  min-height: 52px;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border-top: 1px solid #edebe9;
}
.export-preview-meta {
  font-size: 0.78rem;
  color: #605e5c;
  line-height: 1.2;
}
.export-preview-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.export-preview-actions .btn-ghost,
.export-preview-actions .btn-primary.modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0 1rem;
  line-height: 1;
  font-size: 0.8125rem;
  font-weight: 500;
  box-sizing: border-box;
  white-space: nowrap;
}
.export-preview-actions .btn-primary.modal-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Legacy modal buttons outside modal-card scope */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-height);
  padding: 0 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--input-border);
  background: transparent;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn-ghost:hover {
  background: var(--input-bg);
  border-color: var(--text-muted);
  text-decoration: none;
}
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-height);
  padding: 0 1.1rem;
  border-radius: var(--radius);
  border: none;
  background: hsl(0 72% 51%);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-danger:hover { background: hsl(0 72% 44%); text-decoration: none; }

/* Generic dropzone / parser (non-modal fallback) */
.dropzone {
  border: 2px dashed var(--input-border);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  display: flex; flex-direction: column;
  align-items: center; gap: 0.4rem;
  text-align: center; color: var(--text-muted);
  font-size: 0.85rem; transition: all 0.2s;
  cursor: pointer;
}
.dropzone > svg.lucide,
.dropzone > .dropzone-file-icon {
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  display: block;
}
.dropzone > .dropzone-clay-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
  margin: 0 auto 0.15rem;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.parser-status {
  margin-top: 0.75rem; font-size: 0.85rem;
  padding: 0.5rem; border-radius: var(--radius);
  display: none;
}
.parser-status.success { display: block; background: hsl(140 60% 95%); color: hsl(140 60% 25%); }
.parser-status.error { display: block; background: hsl(0 60% 95%); color: hsl(0 60% 30%); }
.parser-status.loading { display: block; background: var(--input-bg); color: var(--text-muted); }

.input-field {
  width: 100%; padding: 0.6rem 0.8rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  font-family: var(--font-body); font-size: 0.85rem;
  background: var(--input-bg); color: var(--text-main);
  resize: vertical; transition: border-color 0.15s;
}
.input-field:focus {
  outline: none; border-color: var(--input-focus);
  box-shadow: 0 0 0 3px hsl(211 100% 50% / 0.1);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: var(--btn-height);
  min-height: var(--btn-height);
  padding: 0 1.2rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
  box-shadow: 0 1px 3px hsl(211 100% 50% / 0.28);
}
.btn-primary svg.lucide {
  width: var(--icon-sm);
  height: var(--icon-sm);
}
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; color: #fff; }

/* ==========================================================================
   TOAST
   ========================================================================== */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--foreground); color: var(--background);
  padding: 0.6rem 1.4rem; border-radius: var(--radius);
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 500;
  z-index: 999; pointer-events: none;
  box-shadow: var(--shadow-lg);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.active { transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   PRINT
   ========================================================================== */
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff !important; overflow: visible !important; }
  .no-print, .office-shell, .toast, .modal-overlay,
  .cv-section-actions, .cv-entry-actions, .cv-contact-actions, .cv-contact-add-wrap, .bullet-actions, .bullet-delete, .bullet-improve,
  .bullet-move, .cv-empty-hint, .bullet-ai-menu,
  .add-bullet-li, .skill-actions, .skill-del, .bullet-toggle-btn, .tag-delete-btn, .add-tag-btn-wrap,
  .keyval-delete-btn, .add-keyval-btn, .cv-t6-contact-add-line, .skill-level-unset, .cv-format-bar { display: none !important; }
  .cv-entry-item,
  .cv-entry-header,
  .cv-section-head .section-title,
  .cv-bullet-list li,
  .skill-row,
  .award-row { padding-right: 0 !important; }
  .workspace { overflow: visible; display: block; }
  .preview-stage { max-width: 100%; padding: 0; }
  .cv-paper-wrapper { display: block; }
  #cv-html-rendering { width: 100%; transform: none !important; margin-bottom: 0 !important; }
  .cv-page-sheet {
    width: 100%; min-height: auto; height: auto;
    box-shadow: none; border-radius: 0; margin-bottom: 0;
    page-break-after: always;
  }
  .cv-page-sheet:last-child { page-break-after: auto; }
  /* Contact links stay clickable but look like plain contact text */
  .cv-contact-link,
  .cv-contact-link .cv-contact-text {
    color: inherit !important;
    text-decoration: none !important;
  }
  [contenteditable="true"]:empty::before,
  [contenteditable="true"]:empty:before {
    content: none !important;
  }
  .cv-contact-row a[href] {
    pointer-events: auto !important;
  }
  /* Show URL for print (optional - remove if you want clean look) */
  a[href^="mailto:"]::after,
  a[href^="http"]::after,
  a[href^="https"]::after,
  a[href^="tel:"]::after {
    content: none !important;
  }
  [contenteditable="true"] { -webkit-user-modify: read-only; }
  [contenteditable="true"]:hover, [contenteditable="true"]:focus {
    background: transparent; box-shadow: none;
  }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
/* Only the stage around the paper responds to the viewport. The sheet itself
   is a fixed 210mm page that is scaled to fit — its type, padding and grid
   must be identical on a phone, in the editor, on the published page and in
   the PDF, or the same CV paginates differently on each and "the download
   is off". The old rules here shrank the type and padding below 900px and
   480px, which is exactly what made phones disagree with the PDF. */
@media (max-width: 900px) {
  .preview-stage { padding: 1rem 0.75rem 5rem; }
}

@media (max-width: 768px) {
  .preview-stage { padding: 1rem 0.5rem 5rem; }
}

@media (max-width: 480px) {
  .preview-stage { padding: 0.5rem 0.25rem 5rem; }
}

/* ==========================================================================
   DARK / LIGHT THEME
   ========================================================================== */

/* ==========================================================================
   TEMPLATE 3 — Creative
   Studio layout. One accent colour used with intent, a left-aligned name at
   display size, sections labelled rather than boxed, and air where the old
   version had rules. Every accent mark is drawn on the element it belongs to,
   never on the section, so a section that splits across pages still looks
   right. Section spacing is left to the user's layout setting.
   ========================================================================== */
.template-3-style,
.template-3-style .cv-page-sheet {
  --cv-accent-color: hsl(266 72% 52%);
  --cv-section-title-color: var(--paper-ink);
  --cv-section-rule-color: hsl(266 28% 88%);
  --cv-muted-text: hsl(258 8% 46%);
  font-family: var(--font-body);
}

/* Header: the name carries the weight, the accent is spent on one short bar
   riding the hairline — the "gradient rule" idea, drawn as a single mark. */
.template-3-style .cv-header {
  text-align: left;
  padding-bottom: 0.8rem;
  margin-bottom: 1.3rem;
  border-bottom: 1px solid var(--cv-section-rule-color);
}
.template-3-style .cv-header::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 52pt;
  height: 3px;
  background: var(--cv-accent-color);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.template-3-style .cv-header h1 {
  font-family: var(--font-header);
  font-size: calc(29pt * var(--cv-font-scale, 1));
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.03;
  color: var(--paper-ink);
  margin-bottom: 0.3rem;
}
.template-3-style .cv-header .tagline {
  font-size: calc(8.5pt * var(--cv-font-scale, 1));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--cv-accent-color);
  margin-bottom: 0.5rem;
}
.template-3-style .cv-contact-row {
  justify-content: flex-start;
  gap: 0.2rem 0.75rem;
  font-size: calc(8.5pt * var(--cv-font-scale, 1));
  color: var(--cv-muted-text);
}

/* Sections: a tracked micro-label with its own accent tick. No full-width
   rule — the space between sections does that job. */
.template-3-style .section-title {
  font-family: var(--font-header);
  font-size: calc(8.5pt * var(--cv-font-scale, 1));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--cv-section-title-color);
  border-bottom: none;
  padding-bottom: 0.32rem;
  margin-bottom: 0;
  position: relative;
}
.template-3-style .section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 16pt;
  height: 2px;
  background: var(--cv-accent-color);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.template-3-style .cv-section-head { margin-bottom: 0.6rem; }

.template-3-style .cv-summary {
  font-size: calc(10.5pt * var(--cv-font-scale, 1));
  line-height: 1.7;
  color: var(--paper-ink);
}

/* Entries: the employer takes the accent, the date drops to a tracked caps
   micro-label so the title line reads as one thing. */
.template-3-style .cv-entry-item { margin-bottom: 0.7rem; }
.template-3-style .cv-entry-title {
  font-family: var(--font-header);
  font-weight: 700;
  font-size: calc(11pt * var(--cv-font-scale, 1));
  letter-spacing: -0.01em;
  color: var(--paper-ink);
}
.template-3-style .cv-entry-subtitle {
  font-style: normal;
  font-weight: 600;
  font-size: calc(9.5pt * var(--cv-font-scale, 1));
  color: var(--cv-accent-color);
}
.template-3-style .cv-entry-date {
  font-weight: 600;
  font-size: calc(8pt * var(--cv-font-scale, 1));
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cv-muted-text);
}
.template-3-style .cv-entry-loc {
  font-size: calc(8.5pt * var(--cv-font-scale, 1));
  color: var(--cv-muted-text);
}

/* A drawn square rather than a glyph — it keeps its weight at any font size
   and prints as a mark instead of a stray character. */
.template-3-style .cv-bullet-list li { padding-left: 1.15em; line-height: 1.6; }
.template-3-style .cv-bullet-list li::before {
  content: '';
  width: 3.5pt;
  height: 3.5pt;
  top: 0.55em;
  background: var(--cv-accent-color);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.template-3-style .skill-cat {
  font-family: var(--font-header);
  font-weight: 700;
  font-size: calc(8.5pt * var(--cv-font-scale, 1));
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cv-accent-color);
}
.template-3-style .skill-cat::after { content: ''; }
.template-3-style .award-year { color: var(--cv-accent-color); }

/* ==========================================================================
   TEMPLATE 4 — Minimal
   Airy, clean, left-aligned with delicate rules
   ========================================================================== */
.template-4-style .cv-page-sheet {
  --t4-rule: hsl(238 10% 85%);
  font-family: var(--font-body);
}
.template-4-style .cv-header {
  margin-bottom: 20pt;
  padding-bottom: 0;
  text-align: center;
}
.template-4-style .cv-header h1 {
  font-size: calc(22pt * var(--cv-font-scale, 1));
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--paper-ink);
  margin-bottom: 4pt;
  text-align: center;
}
.template-4-style .cv-header .cv-tagline,
.template-4-style .cv-header .tagline {
  font-size: calc(10pt * var(--cv-font-scale, 1));
  font-weight: 400;
  color: var(--text-muted, hsl(238 10% 45%));
  letter-spacing: 0.02em;
  margin-bottom: 10pt;
  text-align: center;
}
.template-4-style .cv-contact-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2pt 12pt;
  font-size: calc(9pt * var(--cv-font-scale, 1));
  color: var(--text-muted, hsl(238 10% 45%));
  padding-bottom: 10pt;
  border-bottom: 1px solid var(--t4-rule, hsl(238 10% 85%));
}
.template-4-style .cv-summary {
  font-size: calc(9.5pt * var(--cv-font-scale, 1));
  line-height: 1.65;
  margin-top: 10pt;
  color: hsl(238 10% 35%);
  font-weight: 400;
}
.template-4-style .section-title {
  font-size: calc(10pt * var(--cv-font-scale, 1));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted, hsl(238 10% 45%));
  border-bottom: 1px solid var(--t4-rule, hsl(238 10% 85%));
  padding-bottom: 5pt;
}
.template-4-style .cv-section-head { margin-bottom: 8pt; }
.template-4-style .cv-section {
  margin-bottom: 14pt;
}
.template-4-style .cv-entry {
  margin-bottom: 10pt;
}
.template-4-style .cv-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4pt 8pt;
}
.template-4-style .cv-entry-title {
  font-weight: 600;
  color: var(--paper-ink);
  font-size: calc(10.5pt * var(--cv-font-scale, 1));
}
.template-4-style .cv-entry-date {
  font-weight: 400;
  color: var(--text-muted, hsl(238 10% 45%));
  font-size: calc(9pt * var(--cv-font-scale, 1));
  white-space: nowrap;
}
.template-4-style .cv-entry-sub {
  font-weight: 400;
  color: var(--text-muted, hsl(238 10% 45%));
  font-size: calc(9.5pt * var(--cv-font-scale, 1));
}
.template-4-style .cv-bullet-li {
  font-size: calc(9pt * var(--cv-font-scale, 1));
  line-height: 1.6;
  color: hsl(238 10% 35%);
}
.template-4-style .skill-row {
  grid-template-columns: 28% 1fr;
  margin-bottom: 3pt;
}
.template-4-style .skill-cat {
  font-size: calc(9pt * var(--cv-font-scale, 1));
  font-weight: 600;
  color: var(--paper-ink);
}
.template-4-style .skill-items {
  font-size: calc(9pt * var(--cv-font-scale, 1));
  color: hsl(238 10% 40%);
}

/* ==========================================================================
   TEMPLATE 5 — Executive (photo left, name + contacts beside it)
   ========================================================================== */
.template-5-style .cv-header.cv-header-with-photo {
  text-align: left;
  border-bottom: none;
  padding-bottom: 0;
}
.template-5-style .cv-header-with-photo .cv-header-top {
  display: flex;
  align-items: center;
  gap: 16pt;
  margin-bottom: 10pt;
  padding-bottom: 0;
}
.template-5-style .cv-header-with-photo .cv-profile-photo-wrap {
  flex-shrink: 0;
}
.template-5-style .cv-header-with-photo .cv-header-text {
  flex: 1;
  min-width: 0;
  text-align: left;
}
.template-5-style .cv-header-with-photo .cv-header-text h1,
.template-5-style .cv-header-with-photo .cv-header-text .tagline {
  text-align: left;
}
.template-5-style .cv-header-with-photo .cv-contact-row {
  justify-content: flex-start;
  row-gap: 0.25rem;
}
.template-5-style .cv-profile-photo {
  width: 72pt;
  height: 72pt;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid hsl(210 60% 35%);
  flex-shrink: 0;
}
.template-5-style .cv-profile-photo-placeholder {
  width: 72pt;
  height: 72pt;
  border-radius: 50%;
  border: 2px dashed hsl(210 30% 70%);
  background: hsl(210 40% 97%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2pt;
  font-size: calc(7pt * var(--cv-font-scale, 1));
  color: hsl(210 20% 50%);
  cursor: pointer;
  flex-shrink: 0;
}
.template-5-style .cv-header h1 {
  font-family: var(--font-header);
  color: hsl(210 60% 28%);
  font-size: calc(20pt * var(--cv-font-scale, 1));
  margin: 0;
}
.template-5-style .section-title {
  color: var(--cv-section-title-color, hsl(210 60% 35%));
  border-bottom: 1px solid var(--cv-section-rule-color, hsl(210 40% 80%));
  padding-bottom: 2pt;
}

/* ==========================================================================
   TEMPLATE 6 — True sidebar layout (photo, contact, skills in left column)
   ========================================================================== */
.template-6-style .cv-t6-layout {
  display: flex;
  gap: 16pt;
  align-items: stretch;
  min-height: 100%;
}
.template-6-style.cv-page-sheet,
.template-6-style {
  --cv-header-bg: hsl(220 45% 22%);
  --cv-header-text: #fff;
}
.template-6-style .cv-t6-sidebar {
  /* Bleeds off the left edge; colour is painted by .cv-t6-layout::before so
     the band always reaches the bottom of the page without covering main text. */
  flex: 0 0 calc(30% + var(--cv-pad-x, 17mm));
  max-width: calc(30% + var(--cv-pad-x, 17mm));
  box-sizing: border-box;
  min-width: 0;
  background: transparent;
  color: var(--cv-header-text, #fff);
  margin: calc(var(--cv-pad-y, 18mm) * -1) 0;
  margin-left: calc(var(--cv-pad-x, 17mm) * -1);
  padding: var(--cv-pad-y, 18mm) 12pt;
  padding-left: var(--cv-pad-x, 17mm);
  position: relative;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.template-6-style .cv-t6-main {
  flex: 1;
  min-width: 0;
}
.template-6-style .cv-t6-sidebar .cv-profile-photo-wrap {
  margin: 0 0 8pt;
}
.template-6-style .cv-t6-sidebar .cv-profile-photo {
  width: 100%;
  max-width: 80pt;
  height: 80pt;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0;
  border: 2px solid rgba(255,255,255,0.35);
}
.template-6-style .cv-t6-sidebar .cv-profile-photo-placeholder {
  width: 80pt;
  height: 80pt;
  border-radius: 50%;
  margin: 0;
  border: 2px dashed rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2pt;
}
.template-6-style .cv-t6-sidebar-name {
  font-size: calc(13pt * var(--cv-font-scale, 1));
  font-weight: 700;
  text-align: left;
  margin-bottom: 4pt;
  outline: none;
  color: var(--cv-name-color, var(--cv-header-text, #fff));
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  white-space: normal;
}
.template-6-style .cv-t6-sidebar-tagline {
  font-size: calc(8.5pt * var(--cv-font-scale, 1));
  text-align: left;
  opacity: 0.85;
  margin-bottom: 10pt;
  outline: none;
  color: var(--cv-tagline-color, var(--cv-header-text, #fff));
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  white-space: normal;
}
.template-6-style .cv-t6-contact {
  font-size: calc(7.5pt * var(--cv-font-scale, 1));
  line-height: 1.6;
  margin-bottom: 10pt;
  /* Color alpha, not opacity — opacity made the add-contact menu see-through. */
  color: var(--cv-contact-color, rgba(255, 255, 255, 0.9));
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.template-6-style .cv-t6-sidebar .cv-contact-link,
.template-6-style .cv-t6-sidebar .cv-contact-link .cv-contact-text,
.template-6-style .cv-t6-sidebar .cv-pdf-link {
  color: inherit;
  -webkit-text-fill-color: currentColor;
}
.template-6-style .cv-t6-contact-line {
  margin-bottom: 3pt;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}
/* Shrink-wrap to the contact text so the × sits next to the field,
   not at the far edge of the rail (display:block stretched it full-width). */
.cv-t6-sidebar .cv-contact-item,
.template-6-style .cv-t6-sidebar .cv-contact-item {
  display: inline-flex;
  align-items: flex-start;
  width: fit-content;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.cv-t6-sidebar .cv-contact-actions {
  top: -2px;
  right: -16px;
}
.template-6-style .cv-t6-contact-add-line,
.cv-t6-sidebar .cv-t6-contact-add-line {
  margin-top: 4pt;
}
.cv-t6-sidebar .cv-contact-add-wrap {
  margin-left: 0;
}
.cv-t6-sidebar .cv-contact-add-menu {
  left: 0;
  transform: none;
}
.template-6-style .cv-t6-sidebar .cv-section {
  margin-top: 8pt;
}
.template-6-style .cv-t6-sidebar .section-title {
  color: var(--cv-section-title-color, var(--cv-header-text, #fff));
  font-size: calc(8pt * var(--cv-font-scale, 1));
  text-transform: uppercase;
  /* A long heading like "Skills & Expertise" was breaking mid-word in a rail
     this narrow, so the tracking is tighter and words stay whole. */
  letter-spacing: 0.05em;
  overflow-wrap: normal;
  word-break: normal;
  border-bottom: 1px solid var(--cv-section-rule-color, rgba(255,255,255,0.25));
  padding-bottom: 3pt;
  padding-right: 0;
  margin-bottom: 6pt;
}
/* The shared 24%/76% skills grid leaves a ~14pt first column in the rail,
   which broke category names one letter per line. Stack them instead. */
.template-6-style .cv-t6-sidebar .skill-row {
  display: block;
  padding-right: var(--skill-actions-space, 68px);
}
.template-6-style .cv-t6-sidebar .skill-cat {
  display: block;
  font-size: calc(8pt * var(--cv-font-scale, 1));
  overflow-wrap: normal;
  word-break: normal;
}
.template-6-style .cv-t6-sidebar .skill-cat,
.template-6-style .cv-t6-sidebar .skill-items {
  color: rgba(255,255,255,0.92);
  font-size: calc(7.5pt * var(--cv-font-scale, 1));
}
.template-6-style .cv-t6-sidebar .skill-cat { font-size: calc(8pt * var(--cv-font-scale, 1)); }
.template-6-style .cv-t6-main .section-title {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: calc(9pt * var(--cv-font-scale, 1));
  color: var(--cv-section-title-color, hsl(220 45% 28%));
}

/* ==========================================================================
   TEMPLATE 7 — Tech (monospace accents, dev-friendly)
   ========================================================================== */
.template-7-style .cv-header h1 {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: calc(17pt * var(--cv-font-scale, 1));
  color: hsl(145 55% 32%);
}
.template-7-style .cv-header .tagline {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: calc(9pt * var(--cv-font-scale, 1));
  color: hsl(145 30% 40%);
}
.template-7-style .section-title {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: calc(9pt * var(--cv-font-scale, 1));
  color: hsl(145 55% 32%);
  border-left: 3pt solid hsl(145 55% 42%);
  padding-left: 6pt;
}
.template-7-style .cv-entry-title {
  font-weight: 600;
  color: hsl(200 20% 22%);
}
.template-7-style .cv-tags-wrap,
.template-7-style .skill-cat {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: calc(8pt * var(--cv-font-scale, 1));
}
.template-7-style .cv-entry-subtitle {
  color: hsl(145 35% 38%);
}

/* ==========================================================================
   TEMPLATE 8 — Designer (bold header band, photo, accent color)
   ========================================================================== */
.template-8-style.cv-page-sheet,
.template-8-style {
  --cv-header-bg: linear-gradient(135deg, hsl(280 55% 48%), hsl(320 60% 52%));
  --cv-header-text: #fff;
}
.template-8-style .cv-header-with-photo .cv-header-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--cv-header-bg, linear-gradient(135deg, hsl(280 55% 48%), hsl(320 60% 52%)));
  /* Bleed by the sheet's real padding (a user setting), not a guessed 12pt. */
  margin: calc(var(--cv-pad-y, 18mm) * -1) calc(var(--cv-pad-x, 17mm) * -1) 14pt;
  padding: calc(var(--cv-pad-y, 18mm) * 0.7) var(--cv-pad-x, 17mm) 14pt;
  border-radius: 0;
  color: var(--cv-header-text, #fff);
  position: relative;
}
.template-8-style .cv-header-with-photo .cv-profile-photo-wrap {
  margin-bottom: 8pt;
}
.template-8-style .cv-header-with-photo .cv-header-text h1 {
  color: var(--cv-name-color, var(--cv-header-text, #fff));
}
.template-8-style .cv-header-with-photo .cv-header-text .tagline {
  color: var(--cv-tagline-color, var(--cv-header-text, #fff));
}
.template-8-style .cv-header-with-photo .cv-contact-row {
  color: var(--cv-contact-color, rgba(255,255,255,0.9));
}
.template-8-style .cv-header-with-photo .cv-contact-link,
.template-8-style .cv-header-with-photo .cv-contact-link .cv-contact-text,
.template-8-style .cv-header-with-photo .cv-pdf-link,
.template-8-style .cv-header-with-photo .cv-contact-sep {
  color: inherit;
  -webkit-text-fill-color: currentColor;
}
.template-8-style .cv-profile-photo {
  width: 76pt;
  height: 76pt;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.5);
}
.template-8-style .cv-profile-photo-placeholder {
  width: 76pt;
  height: 76pt;
  border-radius: 50%;
  border: 2px dashed rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2pt;
  padding: 0;
  margin: 0 auto;
  box-sizing: border-box;
}
.template-8-style .section-title {
  font-size: calc(10pt * var(--cv-font-scale, 1));
  font-weight: 700;
  color: var(--cv-section-title-color, var(--cv-accent-color, hsl(280 55% 42%)));
  letter-spacing: 0.04em;
}
.template-8-style .cv-entry-title {
  color: hsl(280 40% 28%);
}

/* ── Profile photo controls (editor only) ── */
.cv-profile-photo-wrap {
  position: relative;
  flex-shrink: 0;
  width: fit-content;
  max-width: 100%;
}
.template-8-style .cv-profile-photo-wrap {
  margin-left: auto;
  margin-right: auto;
}
button.cv-profile-photo,
button.cv-profile-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2pt;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  text-align: center;
  font-family: var(--font-body);
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.cv-profile-photo-placeholder span {
  display: block;
  width: 100%;
  text-align: center;
}
.cv-photo-change,
.cv-photo-remove {
  position: absolute;
  background: rgba(255,255,255,0.92);
  border: 1px solid hsl(238 15% 85%);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.cv-photo-change {
  bottom: 0;
  right: 0;
  overflow: visible;
}
.cv-photo-remove {
  top: -4px;
  right: -4px;
  color: hsl(0 60% 50%);
}
.cv-profile-photo-placeholder svg,
.cv-profile-photo-placeholder i[data-lucide] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
  margin: 0 auto;
}
.cv-profile-photo-wrap.is-uploading .cv-profile-photo {
  opacity: 0.82;
}
.cv-profile-photo-wrap.is-uploading .cv-photo-change::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid rgba(0, 120, 212, 0.22);
  border-top-color: #0078d4;
  border-radius: 50%;
  animation: cv-photo-spin 0.7s linear infinite;
  pointer-events: none;
}
.cv-profile-photo-wrap:not(.is-uploading) .cv-photo-change::after {
  content: none;
  animation: none;
}
@keyframes cv-photo-spin { to { transform: rotate(360deg); } }

.cv-diff-pulse {
  animation: cv-diff-pulse 1.2s ease;
  border-radius: 4px;
}
@keyframes cv-diff-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 120, 212, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(0, 120, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 120, 212, 0); }
}


/* ── Duplicate buttons + context toolbar ── */
.dup-btn, .section-dup-btn {
  background: none;
  border: none;
  color: hsl(238 10% 55%);
  cursor: pointer;
  font-size: 12px;
  padding: 0 3px;
  line-height: 1;
}
.dup-btn:hover, .section-dup-btn:hover {
  color: var(--primary);
}
.cv-context-toolbar {
  position: absolute;
  z-index: 200;
  display: flex;
  gap: 2px;
  background: #fff;
  border: 1px solid hsl(238 15% 85%);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  padding: 2px;
}
.cv-context-toolbar button {
  background: none;
  border: none;
  padding: 4px 10px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 4px;
  color: var(--paper-ink);
  white-space: nowrap;
}
.cv-context-toolbar button:hover {
  background: hsl(211 100% 50% / 0.1);
  color: var(--primary);
}

/* ==========================================================================
   CUSTOM SECTION REPRESENTATIONS — Tags, KeyVal, Text
   ========================================================================== */

/* ── Interests / tag lists: document text, not app chips.
   Inherit the sheet’s type (serif / sans / monospace / user layout pick)
   the same way summary and bullets do — never force --font-body. ── */
.cv-tags-wrap {
  display: block;
  padding: 2pt 0 1pt;
  font-size: calc(10pt * var(--cv-font-scale, 1));
  line-height: 1.55;
  color: var(--cv-body-text, var(--paper-ink));
  font-family: inherit;
}
.cv-tag-item {
  display: inline;
  position: relative;
  white-space: nowrap;
}
.cv-tag-chip {
  display: inline;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  color: inherit;
  font: inherit;
  font-family: inherit;
  outline: none;
  box-shadow: none;
  transition: background 0.15s, box-shadow 0.15s;
}
.cv-tag-chip:focus {
  background: hsl(211 100% 50% / 0.08);
  box-shadow: 0 0 0 2px var(--primary-light);
  border-radius: 2px;
}
.cv-tag-chip:empty::before {
  content: attr(data-placeholder);
  color: currentColor;
  opacity: 0.5;
  font-style: italic;
}
.cv-tag-sep {
  display: inline;
  padding: 0 0.45em;
  color: var(--cv-muted-text, var(--text-muted));
  opacity: 0.85;
  user-select: none;
  pointer-events: none;
  font-weight: 400;
  font-family: inherit;
}
.tag-delete-btn {
  background: none;
  border: none;
  color: hsl(0 5% 70%);
  font-size: calc(8.5pt * var(--cv-font-scale, 1));
  cursor: pointer;
  padding: 0 1pt 0 2pt;
  line-height: 1;
  vertical-align: super;
  opacity: 0;
  transition: opacity 0.15s;
}
.cv-tag-item:hover .tag-delete-btn,
.cv-tag-item:focus-within .tag-delete-btn { opacity: 1; }
.tag-delete-btn:hover { color: hsl(0 70% 50%); }
.add-tag-btn-wrap {
  display: inline;
  margin-left: 0.55em;
}
.add-tag-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0;
  font-size: calc(8pt * var(--cv-font-scale, 1));
  cursor: pointer;
  font-family: inherit;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.cv-section:hover .add-tag-btn,
.cv-tags-wrap:focus-within .add-tag-btn { opacity: 0.85; }
.add-tag-btn:hover { color: var(--primary); opacity: 1; }

/* Sidebar rails: same type as other rail copy; inherit colour. */
.cv-t6-sidebar .cv-tags-wrap {
  font-size: calc(7.5pt * var(--cv-font-scale, 1));
  line-height: 1.55;
  color: inherit;
  font-family: inherit;
}
.cv-t6-sidebar .cv-tag-sep { color: inherit; opacity: 0.55; }
.cv-t6-sidebar .add-tag-btn { color: inherit; }

/* ── Key-value pairs (Security Clearances, Licenses, IDs) ── */
.cv-keyval-wrap { padding: 2pt 0; }
.cv-keyval-list { list-style: none; margin: 0; padding: 0; }
.cv-keyval-row {
  display: flex;
  align-items: baseline;
  gap: 6pt;
  margin-bottom: 3pt;
  position: relative;
}
.cv-keyval-label {
  font-weight: 600;
  font-size: calc(9pt * var(--cv-font-scale, 1));
  color: var(--paper-ink);
  min-width: 80px;
  max-width: 140px;
  flex-shrink: 0;
  outline: none;
  padding: 1pt 0;
}
.cv-keyval-label:empty::before {
  content: attr(data-placeholder);
  color: currentColor;
  opacity: 0.5;
  font-style: italic;
}
.cv-keyval-value {
  font-size: calc(9pt * var(--cv-font-scale, 1));
  color: hsl(238 10% 40%);
  flex: 1;
  outline: none;
  padding: 1pt 0;
  border-bottom: 1px dotted var(--paper-rule);
}
.cv-keyval-value:empty::before {
  content: attr(data-placeholder);
  color: currentColor;
  opacity: 0.5;
  font-style: italic;
}
.keyval-delete-btn {
  background: none;
  border: none;
  color: hsl(0 5% 70%);
  font-size: calc(10pt * var(--cv-font-scale, 1));
  cursor: pointer;
  padding: 0 2pt;
  line-height: 1;
  display: none;
}
.cv-keyval-row:hover .keyval-delete-btn { display: inline; }
.keyval-delete-btn:hover { color: hsl(0 70% 50%); }
.add-keyval-btn {
  background: none;
  border: 1px dashed var(--paper-rule);
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: 2pt 8pt;
  font-size: calc(8pt * var(--cv-font-scale, 1));
  cursor: pointer;
  font-family: var(--font-body);
  margin-top: 2pt;
}
.add-keyval-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ── My Documents manager ── */
.docs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.docs-toolbar-hint { font-size: 0.8rem; color: #605e5c; }
.docs-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 52vh;
  overflow-y: auto;
  border: 1px solid #edebe9;
  border-radius: 10px;
  background: #fff;
}
.docs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  text-align: center;
  color: #605e5c;
  padding: 1.75rem 1rem;
  font-size: 0.9rem;
  min-height: 7.5rem;
  border: none;
}
.docs-empty-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: #f3f2f1;
  color: #8a8886;
}
.docs-empty-icon.is-image {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
}
.docs-empty-icon.is-image .clay-empty-img,
.clay-empty-img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  display: block;
}
.docs-empty-icon svg.lucide,
.docs-empty-icon i {
  width: 1.25rem;
  height: 1.25rem;
}
.docs-empty .ats-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto;
}
.docs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 0;
  background: transparent;
  transition: background 0.12s;
}
.docs-row + .docs-row { border-top: 1px solid #edebe9; }
.docs-row:hover { background: hsl(210 40% 98%); }
.docs-row.active { background: #f3f9fd; }
.docs-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.docs-badge {
  flex-shrink: 0;
  font-size: 0.64rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: #6b7280;
}
.docs-badge.tpl-1 { background: linear-gradient(135deg, #007bff, #7c3aed); }
.docs-badge.tpl-2 { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.docs-badge.tpl-3 { background: linear-gradient(135deg, #db2777, #f97316); }
.docs-badge.tpl-4 { background: linear-gradient(135deg, #334155, #64748b); }
.docs-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.docs-name {
  font-weight: 600;
  color: #201f1e;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.docs-name-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.docs-name-row .docs-name {
  min-width: 0;
}
.docs-pub-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex-shrink: 0;
  padding: 1px 6px 1px 5px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.5;
  text-transform: uppercase;
}
.docs-pub-tag.is-live {
  background: hsl(152 42% 30% / 0.1);
  color: #15803d;
}
.docs-pub-tag.is-hidden {
  background: hsl(220 10% 92%);
  color: #6b7280;
}
.docs-pub-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.docs-pub-tag.is-live .docs-pub-dot { background: #16a34a; }
.docs-pub-tag.is-hidden .docs-pub-dot { background: #9ca3af; }
.docs-name.editing {
  outline: 2px solid #0078d4;
  outline-offset: 2px;
  border-radius: 3px;
  overflow: visible;
  text-overflow: clip;
  cursor: text;
}
.docs-meta { font-size: 0.74rem; color: #8a8886; }
.docs-actions { display: flex; gap: 0.15rem; flex-shrink: 0; }
.docs-actions button {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: #605e5c;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.docs-actions button:hover { background: #f3f2f1; color: #201f1e; }
.docs-actions .docs-del:hover { background: #fde7e9; color: #a4262c; }
.docs-actions svg.lucide { width: 16px; height: 16px; }

/* Inline row delete confirm (My Documents, Versions, etc.) */
.docs-row .row-delete-confirm,
.ver-row .row-delete-confirm {
  display: none;
}
.row-delete-confirm {
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}
.row-delete-confirm-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fde7e9;
  color: #a4262c;
  display: flex;
  align-items: center;
  justify-content: center;
}
.row-delete-confirm-icon svg.lucide { width: 16px; height: 16px; }
.row-delete-confirm-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.row-delete-confirm-label {
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: #201f1e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-delete-confirm-sub {
  min-width: 0;
  font-size: 0.74rem;
  color: #797775;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-delete-confirm-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.row-delete-cancel,
.row-delete-ok {
  height: 32px;
  padding: 0 0.85rem;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.row-delete-cancel:focus-visible,
.row-delete-ok:focus-visible {
  outline: 2px solid #a4262c;
  outline-offset: 2px;
}
.row-delete-cancel {
  background: #fff;
  border-color: #d2d0ce;
  color: #323130;
}
.row-delete-cancel:hover { background: #f3f2f1; border-color: #c8c6c4; }
.row-delete-ok {
  background: #a4262c;
  color: #fff;
  border-color: #a4262c;
  box-shadow: 0 1px 2px rgba(164, 38, 44, 0.25);
}
.row-delete-ok:hover { background: #8b1f24; border-color: #8b1f24; }
.row-delete-ok:disabled { opacity: 0.6; cursor: not-allowed; }
.docs-row.is-delete-confirm,
.ver-row.is-delete-confirm {
  background: #fdf3f4;
}
.docs-row.is-delete-confirm .docs-main,
.docs-row.is-delete-confirm .docs-actions,
.ver-row.is-delete-confirm .ver-main,
.ver-row.is-delete-confirm .ver-actions {
  display: none !important;
}
.docs-row.is-delete-confirm .row-delete-confirm,
.ver-row.is-delete-confirm .row-delete-confirm {
  display: flex;
  animation: row-delete-confirm-in 0.16s ease;
}
@keyframes row-delete-confirm-in {
  from { opacity: 0; transform: translateX(-4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .docs-row.is-delete-confirm .row-delete-confirm,
  .ver-row.is-delete-confirm .row-delete-confirm { animation: none; }
}
@media (max-width: 560px) {
  .row-delete-confirm-icon { display: none; }
  .docs-row { padding: 0.75rem 0.85rem; gap: 0.5rem; }
  .docs-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
  .docs-info { width: 100%; }
  .docs-actions button {
    width: 34px;
    height: 34px;
  }
}

/* ── Version history ── */
.ver-create { margin-bottom: 0.75rem; }
.ver-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0.75rem;
  border: 1px solid #edebe9;
  border-radius: 10px;
  background: #fff;
}
.ver-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 0;
  background: transparent;
}
.ver-row + .ver-row { border-top: 1px solid #edebe9; }
.ver-row:hover { background: hsl(210 40% 98%); }
.ver-main { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }
.ver-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}
.ver-icon svg { width: 28px; height: 28px; display: block; }
.ver-icon.is-image {
  width: 40px;
  height: 40px;
}
.ver-icon-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}
.ver-info { display: flex; flex-direction: column; min-width: 0; }
.ver-name {
  font-weight: 600;
  color: #201f1e;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}
.ver-meta { font-size: 0.74rem; color: #8a8886; }
.ver-actions { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
.ver-restore {
  height: 30px;
  padding: 0 0.8rem;
  border: 1px solid #8a8886;
  border-radius: 6px;
  background: #fff;
  color: #323130;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.ver-restore:hover { background: #edebe9; border-color: #605e5c; }
.ver-dl {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border: none; border-radius: 4px;
  background: transparent; color: #323130; cursor: pointer;
}
.ver-dl:hover { background: #edebe9; color: #0078d4; }
.ver-dl svg.lucide { width: 16px; height: 16px; }
.ver-del {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: #605e5c;
  cursor: pointer;
}
.ver-del:hover { background: #fde7e9; color: #a4262c; }
.ver-del svg.lucide { width: 16px; height: 16px; }

/* ── Keyboard shortcuts ── */
.shortcut-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; border: 1px solid #edebe9; border-radius: 10px; background: #fff; overflow: hidden; }
.shortcut-list li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  color: #201f1e;
  padding: 0.85rem 1rem;
}
.shortcut-list li + li { border-top: 1px solid #edebe9; }
.shortcut-list li span { color: #201f1e; flex: 1; font-weight: 650; letter-spacing: -0.01em; }
.shortcut-list kbd {
  font-family: 'Segoe UI', 'Consolas', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  background: #faf9f8;
  border: 1px solid #e1dfdd;
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 7px;
  color: #323130;
  min-width: 1.6rem;
  text-align: center;
}

/* ==========================================================================
   2026 FEATURE PASS — reordering, bullet AI menu, empty state, accent colour,
   import preview. Appended as one layer so the additions read together.
   ========================================================================== */

/* ── Entry + bullet reordering ── */
.cv-entry-actions .entry-move-btn { font-size: 11px; font-weight: 700; }
.cv-entry-actions .entry-move-btn:hover { background: var(--primary); color: #fff; }

.bullet-move {
  position: absolute; top: 0;
  width: 18px; height: 18px; border-radius: 3px; border: none;
  background: transparent; color: var(--text-muted);
  cursor: pointer; font-size: 10px; line-height: 1; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: all 0.15s;
}
.cv-bullet-list li:hover > .bullet-move { opacity: 1; }
.bullet-move:hover { background: var(--primary); color: #fff; }

/* Right-rail templates: keep contact-add menus above the rail. */
.cv-page-sheet.sidebar-right .cv-t6-sidebar .cv-contact-add-wrap {
  z-index: 3;
}

/* ── Bullet AI rewrite menu ── */
.bullet-ai-menu {
  position: fixed;
  z-index: 7000;
  min-width: 228px;
  max-width: 280px;
  background: var(--panel-bg, #fff);
  border: 1px solid var(--panel-border, #e1dfdd);
  border-radius: 8px;
  box-shadow: var(--shadow-lg, 0 12px 40px hsl(238 30% 12% / 0.12));
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: 'Segoe UI', var(--font-body), system-ui, sans-serif;
  color: var(--text-main, #201f1e);
  -webkit-font-smoothing: antialiased;
}
.bullet-ai-menu button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
  color: inherit;
  -webkit-text-fill-color: currentColor;
}
.bullet-ai-menu button:hover {
  background: var(--primary-light, #f0f6fd);
}
.bullet-ai-menu button:hover .bullet-ai-menu-label {
  color: var(--primary, #007bff);
  -webkit-text-fill-color: var(--primary, #007bff);
}
.bullet-ai-menu-label {
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: var(--text-main, #201f1e);
  -webkit-text-fill-color: currentColor;
}
.bullet-ai-menu-hint {
  font-family: inherit;
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--text-muted, #605e5c);
  -webkit-text-fill-color: currentColor;
}

/* ── Empty-document hint (editor only; stripped from every export) ── */
.cv-empty-hint {
  margin: 2.2rem auto 0;
  max-width: 30rem;
  text-align: center;
  border: 1.5px dashed #c8c6c4;
  border-radius: 10px;
  padding: 1.6rem 1.4rem;
  color: #605e5c;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
}
.cv-empty-hint-art-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 0.75rem;
}
.cv-empty-hint-art {
  width: 96px;
  height: 96px;
  object-fit: contain;
  display: block;
}
.cv-empty-hint p { margin: 0 0 0.4rem; }
.cv-empty-hint strong { color: #323130; }
.cv-empty-hint-actions {
  display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap;
  margin: 0.9rem 0 0.7rem;
}
.cv-empty-hint-actions button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #c8c6c4; background: #fff; color: #323130;
  border-radius: 6px; padding: 0.45rem 0.9rem;
  font-size: 0.83rem; font-weight: 600; cursor: pointer;
}
.cv-empty-hint-actions button svg.lucide {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.cv-empty-hint-actions button:hover { border-color: #007bff; color: #007bff; }
.cv-empty-hint-actions button:first-child {
  background: #007bff; border-color: #007bff; color: #fff;
}
.cv-empty-hint-actions button:first-child:hover { background: #1b6dc2; color: #fff; }
.cv-empty-hint-sub { font-size: 0.78rem; color: #8a8886; }

/* ── Import from your AI (ChatGPT, Claude, Gemini) ── */
.ai-marks { display: inline-flex; align-items: center; gap: 4px; }
.ai-mark { display: inline-flex; width: 16px; height: 16px; }
.ai-mark svg { width: 100%; height: 100%; }
.cv-empty-hint-actions .cv-empty-hint-ai { gap: 0.5rem; }
.cv-empty-hint-actions .cv-empty-hint-ai .ai-mark { width: 15px; height: 15px; }
.ai-import-head {
  display: flex; align-items: center; gap: 0.9rem;
  margin-bottom: 0.85rem; padding: 0.75rem 0.9rem;
  border: 1px solid #edebe9; border-radius: 12px; background: #faf9f8;
}
/* The three marks as an overlapping stack of round chips. */
.ai-import-head .ai-marks { flex-shrink: 0; gap: 0; }
.ai-import-head .ai-mark {
  width: 34px; height: 34px; padding: 7px;
  border-radius: 50%; background: #fff;
  border: 1px solid #e1dfdd;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}
.ai-import-head .ai-mark + .ai-mark { margin-left: -9px; }
.ai-import-intro { min-width: 0; }
.ai-import-intro h4 {
  margin: 0 0 0.15rem; font-size: 0.92rem; font-weight: 600; color: #201f1e;
}
.ai-import-intro p { margin: 0; font-size: 0.82rem; line-height: 1.5; color: #605e5c; }
@media (max-width: 480px) {
  .ai-import-head { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
}
.ai-import-steps {
  margin: 0 0 0.75rem; padding-left: 1.2rem;
  font-size: 0.82rem; line-height: 1.6; color: #605e5c;
}
.ai-import-prompt {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.85rem; padding: 0.3rem 0.3rem 0.3rem 0.7rem;
  border: 1px solid #d2d0ce; border-radius: 8px; background: #faf9f8;
}
.ai-import-prompt-text {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 0.8rem; color: #605e5c;
}
.ai-import-prompt .modal-btn {
  flex-shrink: 0; margin: 0;
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: #fff;
}
.ai-import-reply-doc { margin-bottom: 0.85rem; }
/* Shorter than the job-description box so the whole tab fits without scrolling. */
.ai-import-reply-doc .jobsrc-doc-body,
.ai-import-reply-doc .jobsrc-doc-input { min-height: 5.5rem; height: 5.5rem; max-height: 5.5rem; }
.ai-import-reply-doc .jobsrc-doc-input { resize: none; overflow-y: auto; }
.modal-tabs { overflow-x: auto; scrollbar-width: none; }
.modal-tab { flex-shrink: 0; white-space: nowrap; }

/* ── Import preview (parser modal) ── */
.import-preview { text-align: left; }
.import-preview-summary { margin: 0 0 0.35rem; font-size: 0.9rem; color: #201f1e; line-height: 1.45; }
.import-preview-note { margin: 0; font-size: 0.78rem; color: #605e5c; line-height: 1.45; }
.modal-tabs[hidden],
#parser-compose[hidden] {
  display: none !important;
}
.parser-status.success:has(.import-preview) {
  padding: 0.85rem 0.95rem;
}
.import-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(11, 106, 11, 0.18);
}
.modal-overlay .import-preview-actions .btn-primary.modal-btn,
.modal-overlay .import-preview-actions .btn-ghost.modal-btn {
  flex: 0 0 auto;
  width: auto;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  margin: 0;
  padding: 0 1rem;
  box-sizing: border-box;
  border-width: 1px;
  border-style: solid;
  line-height: 1;
  justify-content: center;
}

/* ── Inline format toolbar (B/I/U on selection in rich fields) ── */
.cv-format-bar {
  position: fixed; z-index: 7200;
  display: flex; gap: 2px;
  background: #201f1e;
  border-radius: 7px;
  padding: 3px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
}
.cv-format-btn {
  width: 28px; height: 26px;
  border: none; border-radius: 5px;
  background: transparent; color: #f3f2f1;
  font-size: 0.82rem; cursor: pointer;
}
.cv-format-btn:hover { background: #3b3a39; }
.cv-format-btn-bold { font-weight: 800; }
.cv-format-btn-italic { font-style: italic; font-family: Georgia, serif; }
.cv-format-btn-underline { text-decoration: underline; }

/* ── Design controls: heading case, divider style ── */
.cv-page-sheet.heading-upper .section-title {
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
}
.cv-page-sheet.heading-normal .section-title {
  text-transform: none !important;
  letter-spacing: normal !important;
}
.cv-page-sheet.divider-none .section-title {
  border-bottom: none !important;
}
.cv-page-sheet.divider-none .section-title::after {
  display: none !important;
}
.cv-page-sheet.divider-line .section-title {
  border-bottom: 1px solid currentColor !important;
  padding-bottom: 2pt !important;
}
.cv-page-sheet.divider-thick .section-title {
  border-bottom: 2.5px solid currentColor !important;
  padding-bottom: 2pt !important;
}

/* ==========================================================================
   TOUCH & MOBILE EDITING
   On a phone there is no hover, so the affordances that appear on hover were
   simply unreachable. Touch devices get them always-on (dimmed), and small
   screens get bigger targets and full-width modals.
   ========================================================================== */
@media (hover: none) {
  .cv-entry-item { --entry-actions-space: 120px; }
  .cv-entry-item .cv-bullet-list li:not(.add-bullet-li) {
    padding-right: var(--entry-actions-space);
  }
  .cv-entry-actions,
  .cv-section-actions,
  .bullet-actions,
  .bullet-delete,
  .bullet-improve,
  .bullet-move,
  .skill-actions,
  .cv-contact-actions,
  .tag-delete-btn,
  .keyval-delete-btn {
    opacity: 0.45;
  }
  .cv-entry-item .cv-entry-actions,
  .cv-section-head .cv-section-actions { opacity: 0.45; }
  /* Bigger touch targets. */
  .cv-entry-actions button { width: 26px; height: 26px; }
  .bullet-actions .bullet-delete,
  .bullet-actions .bullet-improve,
  .bullet-actions .bullet-move,
  .skill-actions .skill-del,
  .bullet-delete, .bullet-improve, .bullet-move { width: 24px; height: 24px; }
}

@media (max-width: 640px) {
  .modal-card, .modal-content {
    width: calc(100vw - 16px) !important;
    max-width: none !important;
    max-height: 92vh;
    overflow-y: auto;
  }
  .cl-fields { grid-template-columns: 1fr !important; }
  .cv-agent-panel { width: calc(100vw - 20px) !important; }
  .cv-format-bar { transform: scale(1.15); transform-origin: bottom center; }
  .cv-entry-item .cv-bullet-list li:not(.add-bullet-li) {
    padding-right: var(--entry-actions-space, 84px);
  }
  .cv-section > .cv-bullet-list li:not(.add-bullet-li),
  .cv-section > .custom-bullets li:not(.add-bullet-li) {
    padding-right: 112px;
  }
}


/* ── Labelled links inside rich fields (summary, bullets) ──────────────
   A real <a> lives in the field while editing: dotted underline so it reads
   as a link, colour inherited so the design's ink is untouched, clicks place
   the caret (navigation is suppressed in app_core). Export clones turn it
   into the same .cv-pdf-link an auto-detected address gets. */
#cv-html-rendering [data-rich="1"] a {
  pointer-events: auto;
  cursor: text;
  color: var(--cv-accent-color, var(--primary)) !important;
  text-decoration: underline !important;
  text-decoration-style: dotted !important;
  text-decoration-color: currentColor !important;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  border-radius: 2px;
}
#cv-html-rendering [data-rich="1"] a:hover {
  background: hsl(211 100% 50% / 0.09) !important;
}
/* The same link on the export clone (PDF, export preview, published page):
   the design's accent, so it reads as a link. Auto-detected addresses and
   contacts keep the text colour they always had; sidebar rails re-colour
   .cv-pdf-link in templates.css, which covers this class too. */
a.cv-pdf-link.cv-text-link {
  color: var(--cv-accent-color, var(--primary));
}
.cv-format-btn-link { display: inline-flex; align-items: center; justify-content: center; }
.cv-format-btn-link svg { width: 14px; height: 14px; }

/* Caret-in-link bubble: address + Edit / Remove */
.cv-link-bubble {
  position: fixed; z-index: 7200;
  display: flex; align-items: center; gap: 4px;
  max-width: min(420px, calc(100vw - 16px));
  background: #201f1e; color: #f3f2f1;
  border-radius: 7px; padding: 4px 4px 4px 10px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
  font: 500 0.78rem/1.3 var(--font-ui, 'Inter', system-ui, sans-serif);
}
.cv-link-bubble-url {
  color: #9cc4ff; text-decoration: none;
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cv-link-bubble-url:hover { text-decoration: underline; }
.cv-link-bubble-btn {
  border: none; border-radius: 5px; padding: 4px 8px;
  background: transparent; color: #f3f2f1; cursor: pointer; font: inherit;
}
.cv-link-bubble-btn:hover { background: #3b3a39; }

/* Link editor popover */
.cv-link-pop {
  position: fixed; z-index: 7300;
  width: min(340px, calc(100vw - 16px));
  background: #fff; color: #201f1e;
  border: 1px solid #e1dfdd; border-radius: 10px;
  padding: 10px 12px 10px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
  font: 400 0.84rem/1.3 var(--font-ui, 'Inter', system-ui, sans-serif);
}
.cv-link-pop-row { display: grid; grid-template-columns: 3rem minmax(0, 1fr); align-items: center; gap: 8px; margin: 0 0 8px; }
.cv-link-pop-row span { color: #605e5c; font-size: 0.74rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
.cv-link-pop-row input {
  width: 100%; min-width: 0; box-sizing: border-box;
  border: 1px solid #d2d0ce; border-radius: 6px; padding: 6px 8px;
  font: inherit; color: inherit; background: #fff;
}
.cv-link-pop-row input:focus { outline: none; border-color: hsl(211 100% 50%); box-shadow: 0 0 0 3px hsl(211 100% 50% / 0.18); }
.cv-link-pop-err { margin: -2px 0 8px; color: #a4262c; font-size: 0.76rem; }
.cv-link-pop-actions { display: flex; align-items: center; gap: 6px; }
.cv-link-pop-spacer { flex: 1; }
.cv-link-pop-actions button {
  border: 1px solid #d2d0ce; border-radius: 6px; padding: 5px 10px;
  background: #fff; color: #201f1e; cursor: pointer; font: inherit; font-weight: 500;
}
.cv-link-pop-actions button:hover { background: #f3f2f1; }
.cv-link-pop-apply { background: hsl(211 100% 50%) !important; border-color: hsl(211 100% 50%) !important; color: #fff !important; }
.cv-link-pop-apply:hover { background: hsl(211 100% 44%) !important; }
.cv-link-pop-remove { color: #a4262c !important; border-color: transparent !important; padding-left: 4px !important; }
.export-preview-cv .cv-link-pop, .export-preview-cv .cv-link-bubble { display: none !important; }
@media print { .cv-link-pop, .cv-link-bubble { display: none !important; } }


/* ── Entry links + page breaks (editor chrome) ───────────────────────── */
/* A linked entry title reads as a link in the editor, in the design's accent. */
#cv-html-rendering [data-entry-url] {
  color: var(--cv-accent-color, var(--primary)) !important;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}
.entry-link-btn, .section-break-btn { display: inline-flex; align-items: center; justify-content: center; }
.entry-link-btn svg, .section-break-btn svg { width: 13px; height: 13px; pointer-events: none; }
.entry-link-btn.is-on, .section-break-btn.is-on {
  color: #fff !important;
  background: var(--cv-accent-color, var(--primary)) !important;
  border-color: transparent !important;
}
.cv-link-pop-hint { margin: 0 0 8px; color: #605e5c; font-size: 0.78rem; line-height: 1.35; }
/* A section that starts on a new page says so at the top of its sheet
   (editor only: exports strip the attribute in stripCvEditorChrome). */
#cv-html-rendering .cv-section[data-page-break="1"] > .cv-section-head { position: relative; }
#cv-html-rendering .cv-section[data-page-break="1"] > .cv-section-head::before {
  content: 'New page';
  position: absolute; right: 0; top: -1.1rem;
  font: 600 0.58rem/1 var(--font-ui, 'Inter', system-ui, sans-serif);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--cv-accent-color, var(--primary));
  opacity: 0.7; pointer-events: none;
}
.export-preview-cv .cv-section[data-page-break="1"] > .cv-section-head::before { display: none; }
@media print { .cv-section[data-page-break="1"] > .cv-section-head::before { display: none !important; } }
/* The same marker on an entry that starts a new page ("experience.2"). */
#cv-html-rendering .cv-entry-item[data-page-break="1"] { position: relative; }
#cv-html-rendering .cv-entry-item[data-page-break="1"]::before {
  content: 'New page';
  position: absolute; right: 0; top: -1.1rem;
  font: 600 0.58rem/1 var(--font-ui, 'Inter', system-ui, sans-serif);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--cv-accent-color, var(--primary));
  opacity: 0.7; pointer-events: none;
}
.export-preview-cv .cv-entry-item[data-page-break="1"]::before { display: none; }
@media print { .cv-entry-item[data-page-break="1"]::before { display: none !important; } }


/* ── Entry extras: description, skills row, duration ────────────────── */
.cv-entry-desc {
  margin: 2pt 0 2pt;
  font-size: calc(10pt * var(--cv-font-scale, 1));
  line-height: 1.55;
  color: var(--cv-body-text, inherit);
}
.cv-entry-desc:empty::before {
  content: attr(data-placeholder);
  color: currentColor;
  opacity: 0.45;
  font-style: italic;
}
.cv-tags-wrap.cv-entry-tags {
  padding: 1pt 0 2pt;
  font-size: calc(9pt * var(--cv-font-scale, 1));
  font-weight: 500;
  color: var(--cv-muted-text, var(--text-muted));
}
.cv-entry-duration {
  font-weight: 400;
  opacity: 0.8;
  white-space: nowrap;
  user-select: none;
}
.entry-desc-btn, .entry-tags-btn { display: inline-flex; align-items: center; justify-content: center; }
.entry-desc-btn svg, .entry-tags-btn svg { width: 13px; height: 13px; pointer-events: none; }
.entry-desc-btn.is-on, .entry-tags-btn.is-on {
  color: #fff !important;
  background: var(--cv-accent-color, var(--primary)) !important;
  border-color: transparent !important;
}


/* ── Sharing: collaborate strip, share + email modals, read-only view ── */
.collab-banner {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  align-self: center;
  gap: 0.5rem 0.75rem;
  width: 210mm;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto 0.6rem;
  padding: 0.55rem 0.85rem;
  min-height: 2.75rem;
  background: #fff;
  border: 1px solid #e1dfdd;
  border-radius: 10px;
  font: 500 0.82rem/1.35 var(--font-ui, 'Inter', system-ui, sans-serif);
  color: #201f1e;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.collab-banner[hidden] { display: none; }
.collab-pill {
  display: inline-flex; align-items: center; gap: 0.3rem; flex: 0 0 auto;
  padding: 0.22rem 0.6rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.02em; white-space: nowrap;
}
.collab-pill svg { width: 13px; height: 13px; }
.collab-pill.is-view { background: #fff4ce; color: #7a5b00; }
.collab-pill.is-edit { background: #e8f3fc; color: #0067d6; }
.collab-pill.is-owner { background: #e6f4ea; color: #1a7f4b; }
.collab-owner { display: inline-flex; align-items: center; gap: 0.3rem; vertical-align: middle; }
.collab-owner strong { color: #201f1e; }

/* ── Avatars (DiceBear, seeded by viewer key; name on hover) ─────────── */
.mycv-avatar {
  --size: 28px;
  position: relative; display: inline-flex; flex: 0 0 auto;
  width: var(--size); height: var(--size); border-radius: 50%;
  background: hsl(var(--hue, 220) 60% 90%); color: hsl(var(--hue, 220) 55% 30%);
  box-shadow: 0 0 0 2px #fff; overflow: visible; cursor: default; outline: none;
}
.mycv-avatar[data-size="sm"] { --size: 22px; }
.mycv-avatar-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--size) * 0.36); font-weight: 700; letter-spacing: 0.02em; border-radius: 50%;
}
.mycv-avatar img {
  position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; display: block;
  object-fit: cover; background: #fff;
}
.mycv-avatar.is-live::after {
  content: ''; position: absolute; right: -1px; top: -1px; width: 9px; height: 9px; border-radius: 50%;
  background: #16a34a; box-shadow: 0 0 0 2px #fff;
}
.mycv-avatar.is-away { opacity: 0.45; filter: grayscale(0.6); }
.mycv-avatar-badge {
  position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; color: #605e5c; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px #e1dfdd;
}
.mycv-avatar-badge svg { width: 9px; height: 9px; }
.mycv-avatar-badge.is-pencil { color: #0067d6; }
/* Tooltip with the person's name. */
.mycv-avatar[data-tip]:hover::before, .mycv-avatar[data-tip]:focus-visible::before {
  content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 7px); transform: translateX(-50%);
  white-space: nowrap; padding: 0.28rem 0.55rem; border-radius: 6px;
  background: #201f1e; color: #fff; font: 500 0.72rem/1.2 var(--font-ui, 'Inter', system-ui, sans-serif);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); z-index: 30; pointer-events: none;
}
.collab-avatars { display: inline-flex; align-items: center; padding: 2px 0 2px 2px; flex: 0 0 auto; }
.collab-avatars .mycv-avatar { margin-left: -6px; transition: transform 0.12s; }
.collab-avatars .mycv-avatar:first-child { margin-left: 0; }
.collab-avatars .mycv-avatar:hover { transform: translateY(-2px); z-index: 2; }
.collab-text {
  color: #605e5c;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.collab-people { display: inline-flex; align-items: center; gap: 0.4rem; color: #0f7b6c; font-weight: 600; flex: 0 0 auto; }
.collab-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18); }
.collab-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}
.collab-btn {
  display: inline-flex; align-items: center; gap: 0.35rem; flex: 0 0 auto;
  border: 1px solid #d2d0ce; border-radius: 7px; padding: 0.35rem 0.7rem;
  background: #fff; color: #201f1e; font: inherit; cursor: pointer; white-space: nowrap;
}
.collab-btn svg { width: 13px; height: 13px; }
.collab-btn:hover { background: #f3f2f1; }

.collab-count {
  display: inline-flex; min-width: 1.25em; padding: 0 0.35em; justify-content: center;
  border-radius: 999px; background: var(--primary); color: #fff; font-size: 0.68rem; font-weight: 700;
}

@media (max-width: 720px) {
  .collab-banner {
    gap: 0.35rem;
    padding: 0.45rem 0.55rem;
    min-height: 2.5rem;
  }
  .collab-label,
  .collab-text { display: none !important; }
  .collab-pill {
    padding: 0.4rem;
    gap: 0;
  }
  .collab-btn {
    padding: 0.4rem;
    gap: 0.25rem;
  }
}

/* ── Comments drawer (editor + view-only page; app_comments.js) ───── */
.comments-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 520;
  width: min(360px, 100vw);
  display: flex; flex-direction: column;
  background: #fff; border-left: 1px solid #e1dfdd;
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.08);
  font: 400 0.84rem/1.45 var(--font-ui, 'Inter', system-ui, sans-serif); color: #201f1e;
  transform: translateX(100%); transition: transform 0.18s ease;
}
.comments-panel[hidden] { display: none; }
.comments-panel.open { transform: none; }
.comments-head {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.8rem 0.9rem 0.6rem; border-bottom: 1px solid #edebe9;
}
.comments-head h3 {
  margin: 0; display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.95rem; font-weight: 700;
}
.comments-count {
  display: inline-flex; min-width: 1.4em; padding: 0 0.4em; justify-content: center;
  border-radius: 999px; background: #eef4fc; color: #0067d6; font-size: 0.72rem; font-weight: 700;
}
.comments-close {
  margin-left: auto; border: 0; background: transparent; color: #605e5c;
  font-size: 1.35rem; line-height: 1; cursor: pointer; padding: 0.1rem 0.35rem; border-radius: 6px;
}
.comments-close:hover { background: #f3f2f1; color: #201f1e; }
.comments-list { flex: 1; overflow-y: auto; padding: 0.6rem 0.9rem; display: flex; flex-direction: column; gap: 0.7rem; }
.comments-empty { color: #605e5c; padding: 1.4rem 0.4rem; text-align: center; }
.comments-empty p { margin: 0 0 0.5rem; }
.comment { display: flex; gap: 0.6rem; align-items: flex-start; }
.comment .mycv-avatar { --size: 30px; margin-top: 1px; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 0.45rem; }
.comment-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-you { color: #8a8886; font-weight: 500; }
.comment-time { color: #8a8886; font-size: 0.74rem; white-space: nowrap; }
.comment-delete {
  margin-left: auto; border: 0; background: transparent; color: #a19f9d; cursor: pointer;
  font-size: 1.05rem; line-height: 1; padding: 0 0.25rem; border-radius: 4px; opacity: 0; transition: opacity 0.12s;
}
.comment:hover .comment-delete, .comment-delete:focus-visible { opacity: 1; }
.comment-delete:hover { color: #a4262c; background: #fdf3f4; }
.comment-section {
  display: inline-flex; margin: 0.15rem 0 0.2rem; padding: 0.08rem 0.5rem; border: 0; border-radius: 999px;
  background: #f3f2f1; color: #605e5c; font: inherit; font-size: 0.72rem; font-weight: 600; cursor: pointer;
}
.comment-section:hover { background: #e8f3fc; color: #0067d6; }
.comment-body { margin: 0.15rem 0 0; white-space: normal; overflow-wrap: anywhere; }
.comments-compose {
  border-top: 1px solid #edebe9; padding: 0.6rem 0.9rem 0.8rem; display: flex; flex-direction: column; gap: 0.45rem;
  background: #faf9f8;
}
.comments-about { display: flex; align-items: center; gap: 0.45rem; font-size: 0.76rem; color: #605e5c; font-weight: 600; }
.comments-about select {
  flex: 1; min-width: 0; padding: 0.3rem 0.45rem; border: 1px solid #d2d0ce; border-radius: 6px;
  background: #fff; color: #201f1e; font: inherit; font-weight: 500;
}
.comments-compose textarea {
  width: 100%; min-height: 3.4em; max-height: 12em; resize: vertical; padding: 0.5rem 0.6rem;
  border: 1px solid #d2d0ce; border-radius: 8px; background: #fff; color: #201f1e; font: inherit; line-height: 1.4;
}
.comments-compose textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.comments-compose-row { display: flex; align-items: center; gap: 0.5rem; }
.comments-hint { color: #a19f9d; font-size: 0.72rem; }
.comments-post {
  margin-left: auto; border: 0; border-radius: 7px; padding: 0.42rem 0.95rem;
  background: var(--primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.comments-post:hover { background: var(--primary-hover); }
.comments-post[disabled] { opacity: 0.6; cursor: default; }
#comments-toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); z-index: 560;
  background: #201f1e; color: #fff; padding: 0.5rem 0.9rem; border-radius: 8px;
  font: 500 0.82rem 'Inter', system-ui, sans-serif; display: none;
}
/* Room for the drawer beside the paper on wide screens; it overlays on narrow ones. */
@media (min-width: 1100px) {
  body.comments-open .preview-stage { padding-right: 360px; }
  body.comments-open .sv-stage { padding-right: 360px; }
}
/* Ask AI shares the bottom-right corner — hide it while Comments is open
   rather than stacking the drawer above modals to cover the FAB. */
body.comments-open .cv-agent {
  visibility: hidden;
  pointer-events: none;
}
/* Count bubble on the ribbon's Comments tool. */
.ribbon-tool-count {
  position: absolute; top: 2px; right: 4px;
  min-width: 1.35em; padding: 0 0.3em; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 0.62rem; font-weight: 700; line-height: 1.5;
  text-align: center;
}
.ribbon-tool-count[hidden] { display: none; }
.ribbon-tool:has(.ribbon-tool-count) { position: relative; }
@media (max-width: 640px) {
  .comments-panel { width: 100vw; }
}

/* A viewer's editor: the page is a document, not a form. */
body.cv-readonly #cv-html-rendering [contenteditable] { cursor: default; }
body.cv-readonly #cv-html-rendering [contenteditable]:hover,
body.cv-readonly #cv-html-rendering [contenteditable]:focus { background: transparent; box-shadow: none; }
body.cv-readonly #doc-title[contenteditable] { cursor: default; outline: none; }
body.cv-readonly #cv-html-rendering .cv-section-actions,
body.cv-readonly #cv-html-rendering .cv-entry-actions,
body.cv-readonly #cv-html-rendering .cv-contact-actions,
body.cv-readonly #cv-html-rendering .cv-contact-add-wrap,
body.cv-readonly #cv-html-rendering .cv-t6-contact-add-line,
body.cv-readonly #cv-html-rendering .bullet-actions,
body.cv-readonly #cv-html-rendering .add-bullet-li,
body.cv-readonly #cv-html-rendering .skill-actions,
body.cv-readonly #cv-html-rendering .tag-delete-btn,
body.cv-readonly #cv-html-rendering .add-tag-btn-wrap,
body.cv-readonly #cv-html-rendering .keyval-delete-btn,
body.cv-readonly #cv-html-rendering .add-keyval-btn,
body.cv-readonly #cv-html-rendering .cv-photo-change,
body.cv-readonly #cv-html-rendering .cv-photo-remove,
body.cv-readonly #cv-html-rendering .cv-profile-photo-placeholder,
body.cv-readonly #cv-html-rendering .cv-empty-hint,
body.cv-readonly .cv-format-bar, body.cv-readonly .cv-link-bubble, body.cv-readonly .cv-link-pop,
body.cv-readonly .cv-agent-fab, body.cv-readonly #cv-agent-fab,
body.cv-readonly .doc-template-cycle,
body.cv-readonly .ribbon-tab[data-tab="improve"], body.cv-readonly .ribbon-tab[data-tab="build"],
body.cv-readonly .ribbon-tab[data-tab="design"], body.cv-readonly .ribbon-tab[data-tab="layout"],
body.cv-readonly #ribbon-pane-share .ribbon-group:not(:first-child) { display: none !important; }
body.cv-readonly #cv-html-rendering [data-entry-url] { text-decoration: none; }
.save-status.is-readonly { opacity: 0.85; }

/* Anonymous view-only share: brand + Preview + Sign in + CV. No editor chrome. */
body.cv-readonly-guest #ribbon-container,
body.cv-readonly-guest .title-bar-left .qa-btn,
body.cv-readonly-guest .title-bar-right .qa-btn { display: none !important; }

/* ── Share + email modals (shared field chrome) ───────────────────────── */
.share-field {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #d2d0ce;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.875rem;
  color: #201f1e;
  background: #fff;
  line-height: 1.35;
}
.share-field:focus {
  outline: none;
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}
.share-field-mono {
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  font-size: 0.78rem;
  color: #605e5c;
}
.share-field-area {
  min-height: 5.5rem;
  resize: vertical;
}
.share-field-label {
  display: block;
  margin: 0 0 0.3rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: #605e5c;
  letter-spacing: 0.01em;
}
.share-field-optional {
  font-weight: 500;
  color: #8a8886;
}
.share-role {
  height: 36px;
  min-width: 7.5rem;
  box-sizing: border-box;
  border: 1px solid #d2d0ce;
  border-radius: 8px;
  padding: 0 1.75rem 0 0.55rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #201f1e;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23605e5c' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.45rem center;
  appearance: none;
  cursor: pointer;
}
.share-role:focus {
  outline: none;
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}
.share-role:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.share-error {
  color: #a4262c;
  font-size: 0.8125rem;
  margin: 0.45rem 0 0;
  line-height: 1.4;
}

/* Share modal */
.share-section {
  padding: 1rem 0 0.35rem;
  border-top: 1px solid #edebe9;
}
.share-section:first-child {
  border-top: none;
  padding-top: 0.15rem;
}
.share-section-head { margin-bottom: 0.65rem; }
.share-section-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 650;
  color: #201f1e;
  letter-spacing: -0.01em;
}
.share-section-desc {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #605e5c;
}
.share-link-options {
  border: 1px solid #edebe9;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.share-link-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-right: 0.75rem;
}
.share-link-head .share-link-toggle {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding-right: 0;
}
.share-link-head .share-role {
  flex: 0 0 auto;
  width: 7.75rem;
  max-width: 40%;
}
.share-link-box {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  padding: 0.75rem;
  border-top: 1px solid #edebe9;
  margin-top: 0;
}
.share-link-box .share-field { flex: 1 1 auto; min-width: 0; }
.share-copy-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.share-copy-btn svg.lucide { width: 14px; height: 14px; }

.share-invite-row {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.share-invite-row .share-field {
  flex: 1 1 10rem;
  min-width: 0;
}
.share-invite-row .share-role {
  flex: 0 0 auto;
  width: 7.75rem;
}
.share-invite-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.share-people {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  border: 1px solid #edebe9;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.share-person {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.7rem;
  border-top: 1px solid #edebe9;
}
.share-person:first-child { border-top: none; }
.share-person-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.share-person-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #201f1e;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-person-email {
  display: block;
  font-size: 0.75rem;
  font-weight: 450;
  color: #605e5c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-person .share-role {
  flex: 0 0 auto;
  width: 7.5rem;
}
.share-person-remove {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #605e5c;
  cursor: pointer;
}
.share-person-remove:hover {
  background: #f3f2f1;
  color: #201f1e;
}
.share-person-remove svg.lucide { width: 15px; height: 15px; }

/* Share loading + error */
.share-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.75rem 0.75rem;
  text-align: center;
  color: #605e5c;
  font-size: 0.875rem;
}
.share-loading p { margin: 0; }
.share-loading .ats-spinner {
  width: 28px;
  height: 28px;
  margin: 0;
  color: #0078d4;
}
.share-error-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.35rem 0;
}
.share-error-msg {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #605e5c;
}

/* Email modal: sized to show whole, without a scrollbar, on a short
   laptop screen. Formats and the link share one row of toggles. */
.modal-overlay .email-cv-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 1.5rem);
  max-height: calc(100dvh - 1.5rem);
}
.modal-overlay .email-cv-card .modal-body {
  padding: 1rem 1.25rem 1.1rem;
  overflow-y: auto;
  min-height: 0;
}
.email-cv-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.email-cv-form.is-busy {
  opacity: 0.72;
  pointer-events: none;
}
.email-cv-field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.email-cv-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.email-cv-label {
  font-size: 0.8rem;
  font-weight: 650;
  color: #323130;
}
.email-cv-optional { margin-left: 0.25rem; font-weight: 450; color: #8a8886; }
.email-cv-hint { font-size: 0.72rem; color: #8a8886; white-space: nowrap; }
.email-cv-form .share-field {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}
.email-cv-form input.share-field { height: 38px; min-height: 38px; }
.email-cv-note-wrap { position: relative; }
.email-cv-form .share-field-area {
  display: block;
  height: 68px;
  min-height: 56px;
  max-height: 180px;
  padding-bottom: 1.3rem;
  resize: vertical;
}
.email-cv-count {
  position: absolute;
  right: 0.65rem;
  bottom: 0.35rem;
  font-size: 0.68rem;
  color: #a19f9d;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.email-cv-count.is-near { color: #a4262c; }

.email-cv-formats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.email-cv-formats-sep {
  width: 1px;
  height: 22px;
  margin: 0 0.15rem;
  background: #e1dfdd;
}
.email-cv-format { position: relative; margin: 0; cursor: pointer; }
.email-cv-format input { position: absolute; opacity: 0; pointer-events: none; }
.email-cv-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.75rem 0 0.5rem;
  border: 1px solid #d2d0ce;
  border-radius: 9px;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  color: #323130;
  white-space: nowrap;
  user-select: none;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.email-cv-fileicon { width: 18px; height: 21px; flex-shrink: 0; display: block; }
.email-cv-linkicon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #605e5c;
}
.email-cv-linkicon svg.lucide { width: 16px; height: 16px; }
.email-cv-format:hover .email-cv-chip { border-color: #a19f9d; }
.email-cv-format input:checked + .email-cv-chip {
  border-color: #0078d4;
  background: #eff6fc;
  color: #005a9e;
  box-shadow: inset 0 0 0 1px #0078d4;
}
.email-cv-format input:checked + .email-cv-chip .email-cv-linkicon { color: #0078d4; }
.email-cv-format input:focus-visible + .email-cv-chip { outline: 2px solid #0078d4; outline-offset: 2px; }
.email-cv-form .share-error { margin: 0; }

.email-cv-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}
.email-cv-summary {
  margin-right: auto;
  min-width: 0;
  font-size: 0.76rem;
  color: #605e5c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.email-cv-summary.is-empty { color: #a4262c; }
#email-cv-send {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
#email-cv-send .ats-spinner {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
#email-cv-send svg.lucide {
  width: 16px;
  height: 16px;
  stroke-width: 2.25;
  transition: transform 0.15s ease;
}
#email-cv-send:hover:not(:disabled) svg.lucide { transform: translateX(2px); }
#email-cv-send:disabled { opacity: 0.55; cursor: not-allowed; }
@media (max-width: 480px) {
  .email-cv-summary { display: none; }
  .email-cv-hint { display: none; }
  .email-cv-formats-sep { display: none; }
}

.docs-pub-tag.is-shared { background: #e8f3fc; color: #0067d6; }
.docs-shared-title {
  margin: 1rem 0 0.4rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a8886;
}

@media (max-width: 560px) {
  .share-link-head {
    flex-wrap: wrap;
    padding: 0 0.75rem 0.65rem;
  }
  .share-link-head .share-link-toggle {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
  }
  .share-link-head .share-role {
    width: 100%;
    max-width: none;
  }
  .share-link-box { flex-direction: column; }
  .share-copy-btn { width: 100%; justify-content: center; }
}


/* ── Opening a document from a link: no draft flashes before it arrives ── */
body.is-opening-doc #printable-cv-page { visibility: hidden; }
body.is-opening-doc #cv-paper-wrapper { position: relative; min-height: 60vh; }
body.is-opening-doc #cv-paper-wrapper::before {
  content: 'Opening CV…';
  position: absolute; left: 50%; top: 120px; transform: translateX(-50%);
  font: 500 0.9rem/1 var(--font-ui, 'Inter', system-ui, sans-serif); color: #8a8886;
}

/* A section moved into a two-column design's side column (layout.rail) takes
   the column's own ink, whatever colours the design gives its main column:
   dark entry titles on a navy rail were unreadable. A design that styles its
   rail's entries itself (templates.css, one class more specific) still wins. */
.has-sidebar .cv-t6-sidebar .cv-entry-title,
.has-sidebar .cv-t6-sidebar .cv-entry-subtitle,
.has-sidebar .cv-t6-sidebar .cv-entry-desc { color: inherit; }
.has-sidebar .cv-t6-sidebar .cv-entry-loc,
.has-sidebar .cv-t6-sidebar .cv-entry-date,
.has-sidebar .cv-t6-sidebar .award-issuer { color: inherit; opacity: 0.78; }
/* Sizes for the narrow column. Designs with a full-width header size their
   own rail entries (templates.css). */
.has-sidebar:not(.has-split-head) .cv-t6-sidebar .cv-entry-title {
  font-size: calc(9pt * var(--cv-font-scale, 1));
  line-height: 1.35;
  overflow-wrap: break-word;
  word-break: normal;
}
.has-sidebar:not(.has-split-head) .cv-t6-sidebar .cv-entry-subtitle,
.has-sidebar:not(.has-split-head) .cv-t6-sidebar .cv-entry-desc,
.has-sidebar:not(.has-split-head) .cv-t6-sidebar .cv-bullet-list li,
.has-sidebar:not(.has-split-head) .cv-t6-sidebar .award-desc {
  font-size: calc(8.5pt * var(--cv-font-scale, 1));
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: normal;
}
.has-sidebar:not(.has-split-head) .cv-t6-sidebar .cv-entry-loc,
.has-sidebar:not(.has-split-head) .cv-t6-sidebar .cv-entry-date,
.has-sidebar:not(.has-split-head) .cv-t6-sidebar .award-year,
.has-sidebar:not(.has-split-head) .cv-t6-sidebar .award-issuer {
  font-size: calc(8pt * var(--cv-font-scale, 1));
}
/* In the narrow column an entry's heading stacks (title, subtitle, place,
   date) and uses the full width. The space the main column keeps clear on
   the right for the hover controls took over half of the rail; the controls
   float over the text here instead. */
.has-sidebar:not(.has-split-head) .cv-t6-sidebar .cv-entry-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding-right: 0;
}
.has-sidebar:not(.has-split-head) .cv-t6-sidebar .cv-entry-header > * { max-width: 100%; }
.has-sidebar:not(.has-split-head) .cv-t6-sidebar .cv-entry-date { max-width: 100%; margin: 0; }
.has-sidebar:not(.has-split-head) .cv-t6-sidebar .cv-bullet-list li,
.has-sidebar:not(.has-split-head) .cv-t6-sidebar .award-row { padding-right: 0; }
/* The inner gutter of a left rail was 16px against 64px at the page edge,
   so a full-width entry ran almost into the main column. Its sections now
   stop 40px short of the inner edge, as on the right-rail designs. Skill
   rows give up the 68px they kept clear for their hover controls (which
   float over the text, and which the PDF never had). */
.has-sidebar.sidebar-left:not(.has-split-head) .cv-t6-sidebar > .cv-section { margin-right: 24px; }
.has-sidebar:not(.has-split-head) .cv-t6-sidebar .skill-row { padding-right: 0; }
