/* CVee editor UI (the CV itself is styled in cv.css) */

:root {
  --brand: #8f33e8;
  --brand-700: #7322c4;
  --brand-50: #f6effd;
  --brand-100: #eee0fc;
  --ink: #290e3a;
  --text: #3d2f4b;
  --muted: #7d7189;
  --line: #ece6f3;
  --field: #e2daec;
  --bg: #f5f2fa;
  --ring: 0 0 0 3px rgba(143, 51, 232, 0.16);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }

/* ---------- top bar ---------- */
.topbar {
  flex: none;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.brand img { display: block; height: 20px; width: auto; }
.brand-tld {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.save-state { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* "My CVs" and the name of the open CV */
.mycvs-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 10px; background: var(--brand-50); color: var(--brand-700); font-size: 13.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.mycvs-btn:hover { background: var(--brand-100); }
.mycvs-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.cv-name { min-width: 0; max-width: 28vw; height: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cv-name:hover { border-color: var(--line); }
.cv-name:focus-visible { outline: none; box-shadow: var(--ring); }
.save-btn { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.save-btn:hover { background: var(--brand-700); }
.save-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.save-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
/* unsaved changes: a small dot on the Save button */
.save-btn.is-dirty::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; background: #f59f00; }

/* dialogs (Save to My CVs, unsaved changes) */
.dlg { width: min(440px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; background: #fff; color: var(--text); box-shadow: 0 24px 70px rgba(41, 14, 58, 0.3); }
.dlg::backdrop { background: rgba(41, 14, 58, 0.45); }
.dlg-body { display: grid; gap: 14px; padding: 22px 22px 20px; }
.dlg-title { margin: 0; font-size: 19px; font-weight: 700; color: var(--ink); }
.dlg-text { margin: -4px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.dlg-error { margin: -4px 0 0; font-size: 13px; font-weight: 500; color: #c2255c; }
.dlg-error[hidden] { display: none; }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.view-switch { display: none; }

/* undo / redo, top right */
.history { display: flex; gap: 4px; }
.history-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.history-btn:hover:not(:disabled) { border-color: var(--brand-100); background: var(--brand-50); color: var(--brand); }
.history-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.history-btn:disabled { opacity: 0.35; cursor: default; }
.history-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- workspace ---------- */
.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border-right: 1px solid var(--line);
}
.panel-tabs {
  flex: none;
  display: flex;
  gap: 4px;
  margin: 14px 18px 0;
  padding: 4px;
  border-radius: 12px;
  background: var(--brand-50);
}
.tab {
  flex: 1;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}
.tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(41, 14, 58, 0.1); }
.panel-body { flex: 1; min-height: 0; overflow: auto; padding: 16px 18px 48px; }
.tab-pane { display: none; }
.tab-pane.is-active { display: block; }

/* ---------- cards & fields ---------- */
.card {
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.card-title { margin: 0 0 12px; font-size: 15px; font-weight: 600; color: var(--ink); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }

/* sections grouped by the design's columns */
.col-group { margin: 22px 0 14px; padding: 12px 10px 0; border-radius: calc(var(--radius) + 4px); background: var(--bg); }
.col-group > .card:last-child { margin-bottom: 10px; }
.col-label { display: flex; align-items: center; gap: 8px; margin: 0 4px 10px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.col-label svg { width: 20px; height: 16px; fill: #fff; stroke: #c9bdd8; stroke-width: 1.2; }
.col-label svg .on { fill: var(--brand-100); stroke: var(--brand); }
.col-empty { margin: 0 4px 12px; padding: 14px; border: 1.5px dashed var(--field); border-radius: var(--radius); font-size: 12.5px; color: var(--muted); text-align: center; }
.col-empty b { color: var(--text); font-weight: 600; }
.card-tools { display: flex; gap: 2px; margin: -6px -6px 0 0; }
.card-hint { margin: -6px 0 12px; font-size: 12.5px; color: var(--muted); }

/* ---------- upload an existing CV ---------- */
.import-card { border-color: var(--brand-100); background: var(--brand-50); }
.import-head { display: flex; align-items: center; justify-content: space-between; margin: -6px -6px 6px 0; }
.import-head .card-title { margin: 0; }
.import-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 22px 16px 18px;
  border: 1.5px dashed #cfb3f3;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.import-drop:hover, .import-drop.is-over { border-color: var(--brand); background: #fdfaff; }
.import-drop:focus-visible { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.import-drop:disabled { cursor: progress; }
.import-drop > svg { width: 28px; height: 28px; fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.import-drop strong { font-size: 15px; color: var(--ink); }
.import-drop span:not(.btn):not(.spinner) { max-width: 30em; font-size: 12.5px; color: var(--muted); }
.import-drop .btn { margin-top: 6px; pointer-events: none; }
.import-note { margin: 10px 2px 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
/* switched off for now: the place stays, marked "In development" */
.import-card.is-disabled .import-drop { cursor: default; border-color: var(--field); background: #fcfbfe; }
.import-card.is-disabled .import-drop > svg { stroke: #b9aec6; }
.import-card.is-disabled .import-drop strong { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }
.soon-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.menu-pop .is-soon { color: var(--muted); cursor: default; }
.menu-pop .is-soon .soon-badge { margin-left: 6px; }
.spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--brand-100);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld--full { grid-column: 1 / -1; }
.fld + .fld { margin-top: 0; }
.stack > * + * { margin-top: 14px; }
.fld-label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.fld-label output { text-transform: none; letter-spacing: 0; color: var(--ink); }
.fld-hint { font-size: 12px; color: var(--muted); }

input[type="text"], textarea, select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--field);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: var(--ring); }
input[type="text"]:disabled { background: var(--bg); color: #b4aabd; }
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
input[type="range"] { width: 100%; accent-color: var(--brand); }

.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--brand-100); background: var(--brand-50); }
.btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { border-color: var(--brand); background: var(--brand); color: #fff; padding: 9px 16px; }
.btn-primary:hover { border-color: var(--brand-700); background: var(--brand-700); color: #fff; }
.btn-primary[aria-busy="true"] { opacity: 0.75; cursor: progress; }
.btn-icon { width: 38px; height: 38px; padding: 0; }
.btn-icon svg { fill: currentColor; stroke: none; }
.btn-small { padding: 6px 11px; font-size: 13px; }

.icon-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--brand-50); color: var(--brand); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }
.icon-btn svg, .entry-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.add-btn {
  width: 100%;
  padding: 10px;
  border: 1.5px dashed #d8c7ec;
  border-radius: 12px;
  background: #fcfaff;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
}
.add-btn:hover { border-color: var(--brand); background: var(--brand-50); }

/* ---------- photo ---------- */
.photo-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.photo-thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--brand-50) center / cover no-repeat;
  color: var(--brand);
  font-weight: 700;
  font-size: 18px;
}
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- list entries ---------- */
.entry { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.entry-head { display: flex; align-items: center; gap: 2px; padding: 5px 6px 5px 4px; }
.entry-toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.entry-toggle svg { flex: none; color: var(--muted); transition: transform 0.15s; }
.entry.is-open .entry-toggle svg { transform: rotate(90deg); }
.entry-titles { min-width: 0; display: flex; flex-direction: column; }
.entry-label { overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.entry-sub { font-size: 12px; color: var(--muted); }
.entry-body { display: none; padding: 4px 14px 14px; }
.entry.is-open .entry-body { display: block; }
.entry .entry { margin-top: 0; }

.custom-block + .custom-block { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.custom-head { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.custom-head .fld { flex: 1; }

.row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.row input[type="text"] { flex: 1; min-width: 0; }
.row select, .row .row-level { flex: none; width: 132px; }

/* ---------- design pane ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 10px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.tpl-card:hover { border-color: var(--brand-100); }
.tpl-card.is-active { border-color: var(--brand); box-shadow: var(--ring); }
.tpl-card svg { display: block; width: 100%; height: auto; border-radius: 5px; box-shadow: 0 1px 4px rgba(41, 14, 58, 0.14); }
.tpl-card .t-acc { fill: var(--tpl-acc); }
.tpl-card .t-tint { fill: var(--tpl-tint); }
.tpl-card .t-ink { fill: #3a3042; }
.tpl-card .t-line { fill: #d9d3df; }
.tpl-card .t-ol { fill: none; stroke: var(--tpl-acc); stroke-width: 0.5; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  cursor: pointer;
}
.swatch.is-active::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 2px solid var(--c);
  border-radius: 50%;
}
.swatch--custom { background: conic-gradient(#f44, #fd4, #4d6, #4cf, #64f, #e4c, #f44); }
.swatch--custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--brand-50); }
.seg button { padding: 6px 14px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.seg button.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(41, 14, 58, 0.1); }

/* ---------- preview ---------- */
.preview { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.preview-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
}
.bar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.zoom {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.zoom button {
  min-width: 30px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--ink);
  font-size: 16px;
  cursor: pointer;
}
.zoom button:hover { background: var(--brand-50); }
.zoom .zoom-label { min-width: 54px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.page-count { font-size: 13px; color: var(--muted); }
.fit-badge {
  margin-left: -4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  cursor: help;
}
.fit-badge[hidden] { display: none; }
.sample-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.sample-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.sample-toggle:has(input:checked) { border-color: var(--brand-100); background: var(--brand-50); color: var(--brand-700); }
.sample-toggle:has(input:focus-visible) { box-shadow: var(--ring); }
.fld-hint--block { margin: 8px 0 0; }

.preview-scroll { flex: 1; min-height: 0; overflow: auto; padding: 4px 32px 48px; }
.preview-holder { position: relative; margin: 0 auto; }
#cvRoot { transform-origin: 0 0; }
#cvRoot .cv-page { box-shadow: 0 1px 2px rgba(41, 14, 58, 0.06), 0 12px 32px rgba(41, 14, 58, 0.1); }
#cvRoot .cv-page + .cv-page { margin-top: 10mm; }

.menu { position: relative; }
.menu-pop {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  display: none;
  min-width: 230px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(41, 14, 58, 0.14);
}
.menu.is-open .menu-pop { display: block; }
.menu-pop button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.menu-pop button:hover { background: var(--brand-50); }

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { padding: 0; border: 0; background: none; color: #dcbdff; font-weight: 700; cursor: pointer; }

/* ---------- narrow screens: switch between editor and preview ---------- */
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .history { margin-left: auto; }
  .view-switch { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--brand-50); }
  .view-switch button { padding: 6px 12px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
  .view-switch button.is-active { background: #fff; color: var(--ink); }
  .save-state { display: none; }
  .cv-name { display: none; } /* named in the Save dialog on small screens */
  .save-btn { width: 34px; padding: 0; justify-content: center; }
  .save-btn span { display: none; }
  .mycvs-btn { width: 34px; padding: 0; justify-content: center; }
  .mycvs-btn span { display: none; }
  /* Hidden but still laid out (not display:none): pagination measures the pages even while you edit. */
  body:not(.show-preview) .preview { position: fixed; left: -200vw; top: 0; width: 100vw; height: 100vh; visibility: hidden; pointer-events: none; }
  body.show-preview .panel { display: none; }
  .panel { border-right: 0; }
  .preview-bar { flex-wrap: wrap; padding: 10px 16px; }
  .preview-scroll { padding: 4px 16px 32px; }
  .page-count { display: none; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .tpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row select, .row .row-level { width: 104px; }
  /* phone top bar: logo, undo / redo / tour and the Edit–Preview switch must fit in one row */
  .topbar { gap: 8px; padding: 0 12px; }
  .brand img { height: 18px; }
  .brand-tld { display: none; }
  .history { gap: 2px; }
  .history-btn { width: 32px; height: 32px; }
  .view-switch button { padding: 6px 9px; }
}

/* ---------- browser print fallback: print only the CV pages ---------- */
@media print {
  html, body { display: block; height: auto; background: #fff; }
  .topbar, .panel, .preview-bar, .toast { display: none !important; }
  .workspace, .preview, .preview-scroll { display: block !important; height: auto; padding: 0; overflow: visible; }
  .preview-holder { width: auto !important; height: auto !important; margin: 0; }
  #cvRoot { transform: none !important; }
  #cvRoot .cv-page { margin: 0 !important; box-shadow: none; }
}

/* ---------- editor tour (js/tour.js) ---------- */
.tour-dim { position: fixed; inset: 0; z-index: 90; background: transparent; }
.tour-dim.is-dark { background: rgba(41, 14, 58, 0.5); }
.tour-spot {
  position: fixed;
  z-index: 91;
  border-radius: 14px;
  box-shadow: 0 0 0 3px var(--brand), 0 0 0 9999px rgba(41, 14, 58, 0.5);
  pointer-events: none;
  transition: left 0.25s, top 0.25s, width 0.25s, height 0.25s;
}
.tour-bubble {
  position: fixed;
  z-index: 92;
  width: min(340px, calc(100vw - 24px));
  padding: 16px 18px 14px;
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 18px 50px rgba(41, 14, 58, 0.28);
  transition: left 0.25s, top 0.25s;
}
.tour-arrow {
  position: absolute;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  background: #fff;
  transform: rotate(45deg);
  display: none;
}
.tour-bubble.is-bottom .tour-arrow { display: block; top: -6px; }
.tour-bubble.is-top .tour-arrow { display: block; bottom: -6px; }
.tour-bubble.is-right .tour-arrow { display: block; left: -6px; margin-left: 0; margin-top: -7px; }
.tour-count { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--brand); }
.tour-title { margin: 4px 0 6px; font-size: 17px; font-weight: 700; color: var(--ink); }
.tour-text { margin: 0; font-size: 14px; line-height: 1.5; }
.tour-tip { margin: 10px 0 0; padding: 9px 11px; border-radius: 10px; background: var(--brand-50); font-size: 13px; line-height: 1.45; }
.tour-tip b { color: var(--brand-700); margin-right: 2px; }
.tour-tip[hidden] { display: none; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.tour-nav { display: flex; gap: 8px; margin-left: auto; }
.tour-nav [hidden] { display: none; }
.tour-skip { padding: 4px 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.tour-skip:hover { color: var(--ink); text-decoration: underline; }
.tour-skip[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-bubble { transition: none; } }

/* ---------- AI Writer (profile and description fields) ---------- */
.ai-wrap { position: relative; display: flex; flex-direction: column; min-width: 0; }
.ai-btn {
  position: absolute;
  top: -4px;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border: 1px solid var(--brand-100);
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.ai-btn:hover, .ai-btn[aria-expanded="true"] { border-color: var(--brand); background: #fff; }
.ai-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.ai-btn svg, .ai-title svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

.ai-panel {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(41, 14, 58, 0.1);
  overflow: hidden;
}
.ai-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 12px 10px 0 14px; }
.ai-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); }
.ai-sub { margin-top: 2px; font-size: 12px; color: var(--muted); }
.ai-out { padding: 12px 14px 4px; }
.ai-text { white-space: pre-wrap; font-size: 14px; line-height: 1.55; color: var(--ink); }
.ai-busy { display: flex; align-items: center; gap: 10px; min-height: 64px; color: var(--muted); font-size: 13.5px; }
.ai-busy .spinner { width: 20px; height: 20px; border-width: 2.5px; }
.ai-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fff3f3; color: #9b1c1c; font-size: 13px; }
.ai-demo { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--brand-50); font-size: 12px; line-height: 1.45; color: var(--text); }
.ai-demo b { margin-right: 4px; color: var(--brand-700); }
.ai-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 14px 14px; border-bottom: 1px solid var(--line); }
.ai-actions .btn { height: 42px; }
.ai-actions .btn svg { width: 16px; height: 16px; }
.ai-actions .btn:disabled { opacity: 0.55; cursor: default; }
.ai-ask { padding: 10px 14px 12px; background: #fcfbfe; }
.ai-input {
  width: 100%;
  min-height: 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  resize: none;
  font-size: 14px;
  box-shadow: none !important;
}
.ai-input::placeholder { color: #a79cb3; }
.ai-ask-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.ai-chip {
  padding: 5px 10px;
  border: 1px solid var(--field);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.ai-chip:hover:not(:disabled) { border-color: var(--brand-100); background: var(--brand-50); color: var(--brand-700); }
.ai-chip:disabled { opacity: 0.5; cursor: default; }
.ai-mic.is-on { color: #fff; background: #d6336c; }
.ai-mic.is-on:hover { color: #fff; background: #c2255c; }
.ai-send { color: var(--brand); }

/* the part of the form a link pointed to (#experience …), lit up for a moment */
.card { transition: box-shadow 0.4s; }
.card.is-focus { box-shadow: 0 0 0 3px rgba(143, 51, 232, 0.35); }

/* Small phones: everything in one row (the quick tour moves to the ⋯ menu). */
@media (max-width: 480px) {
  .topbar { gap: 6px; padding: 0 10px; }
  .brand img { height: 16px; }
  .save-btn, .mycvs-btn { flex: none; width: 32px; }
  #tourBtn { display: none; }
  .history { gap: 0; }
  .history-btn { width: 30px; }
  .view-switch button { padding: 6px 7px; }
}
@media (min-width: 481px) { .menu-pop [data-menu="tour"] { display: none; } }

/* Help: starts the help bubbles (js/tour.js) */
.help-btn { width: auto; gap: 6px; margin-left: 4px; padding: 0 12px 0 9px; display: inline-flex; align-items: center; font: inherit; font-size: 13.5px; font-weight: 600; }
.help-btn svg { flex: none; }
@media (max-width: 640px) {
  .help-btn { width: 36px; margin-left: 0; padding: 0; justify-content: center; }
  .help-btn span { display: none; }
}

/* Job match panel ("Tailor to a job", js/editor.js) – on the Content tab only */
.jm { margin-bottom: 14px; padding: 12px 14px 14px; border-radius: var(--radius); background: #fff; box-shadow: inset 0 0 0 1.5px var(--brand-100), 0 6px 18px rgba(143, 51, 232, 0.08); }
.jm[hidden], .panel-body:has(#designForm.is-active) .jm { display: none; }
.jm-head { display: flex; align-items: center; gap: 12px; }
.jm-ring {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(closest-side, #fff 72%, transparent 73% 100%), conic-gradient(var(--brand) calc(var(--p) * 1%), var(--brand-50) 0);
}
.jm-ring b { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.jm-title { flex: 1; min-width: 0; display: grid; }
.jm-title b { font-size: 14.5px; color: var(--ink); }
.jm-title span { overflow: hidden; font-size: 12.5px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.jm-btn { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.jm-btn:hover { background: var(--brand-50); color: var(--brand); }
.jm-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.jm-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.jm-btn[aria-expanded="false"] svg { transform: rotate(-90deg); }
.jm-body[hidden] { display: none; }
.jm-sub { margin: 10px 0 8px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.jm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.jm-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: #fff4e5; box-shadow: inset 0 0 0 1px #f6d4a3; color: #8a4a00; font-size: 12.5px; font-weight: 500; line-height: 1.3; }
.jm-chip:has(button) { padding-right: 4px; }
.jm-chip button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: #8a4a00; font: inherit; font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; }
.jm-chip button:hover, .jm-chip button:focus-visible { background: var(--brand); color: #fff; outline: none; }
.jm-chip.is-found { background: #e7f7ee; box-shadow: none; color: #156b3b; }
.jm-found { margin-top: 10px; }
.jm-found summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.jm-found .jm-chips { margin-top: 8px; }
.jm-foot { margin: 10px 0 0; font-size: 12.5px; }
.jm-foot a { color: var(--brand); font-weight: 600; text-decoration: none; }
.jm-foot a:hover { text-decoration: underline; }

/* Edit / Preview: words, or icons when the words don't fit (js/editor.js → fitTopbar) */
.view-switch button svg { display: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.topbar.is-tight .view-switch button { display: inline-grid; place-items: center; padding: 6px 10px; }
.topbar.is-tight .view-switch button svg { display: block; }
.topbar.is-tight .view-switch button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
