/* ==========================================================================
   PlainCV — styles
   Family palette (slate + blue) shared with pdf-local, facturas-local and
   auditor-ats, tuned into an editor-first workspace.
   ========================================================================== */

:root {
  --paper: #f8fafc;
  --paper-2: #f1f5f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --ink-3: #334155;
  --muted: #475569;
  --muted-2: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-line: #bfdbfe;
  --green: #15803d;
  --green-soft: #f0fdf4;
  --green-line: #bbf7d0;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --amber-line: #fde68a;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --red-line: #fecaca;
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(18, 23, 31, .05), 0 4px 14px rgba(18, 23, 31, .045);
  --shadow-md: 0 2px 6px rgba(18, 23, 31, .06), 0 20px 46px rgba(18, 23, 31, .1);
  --shadow-lg: 0 30px 80px rgba(10, 14, 20, .24);
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --serif: Georgia, "Times New Roman", Times, serif;
  --header-h: 64px;
  --announce-h: 38px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

[hidden] { display: none !important; }

img, svg { display: block; }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
::selection { background: #dbe5ff; color: var(--ink); }

:focus-visible {
  outline: 3px solid rgba(47, 91, 215, .42);
  outline-offset: 2px;
  border-radius: 5px;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 400;
  padding: 12px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ==========================================================================
   Announcement + header
   ========================================================================== */

.announce {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px 24px;
  flex-wrap: wrap;
  padding: 8px 20px;
  background: var(--ink);
  color: #fff;
  text-align: center;
}

.announce-main {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.005em;
}

.announce-sub {
  font-size: 12.5px;
  color: #b9c2cf;
}

.announce-sub::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 12px;
  border-radius: 50%;
  background: #55606f;
  vertical-align: 2px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: rgba(255, 255, 255, .93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1640px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  color: var(--ink);
  flex: none;
}
.brand-mark svg { width: 100%; height: 100%; }

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.brand-name span { color: var(--accent); }

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.brand-pill .icon { width: 10px; height: 10px; }

.header-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 10px;
  color: var(--muted-2);
  font-size: 12px;
  min-width: 0;
}

.save-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(21, 115, 71, .12);
  flex: none;
}
.header-status.is-failed .save-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(154, 91, 6, .13);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.license-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  text-align: left;
  transition: border-color .15s ease, background .15s ease;
}
.license-chip:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.license-chip .icon { width: 18px; height: 18px; color: var(--muted); }
.license-chip.is-licensed { border-color: var(--green-line); background: var(--green-soft); }
.license-chip.is-licensed .icon { color: var(--green); }

.license-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.license-text strong { font-size: 12px; font-weight: 700; }
.license-text small { font-size: 10.5px; color: var(--muted-2); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(36, 72, 181, .2);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn-outline {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-outline:hover:not(:disabled) { background: var(--paper); border-color: #b9c1cb; }

.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 0 10px;
}
.btn-quiet:hover { background: var(--paper-2); color: var(--ink); }

.btn-danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn-danger:hover { background: #981b12; border-color: #981b12; }

.btn-sm { min-height: 44px; font-size: 13px; padding: 0 12px; }
.btn-lg { min-height: 50px; font-size: 15px; padding: 0 22px; }
.btn-block { width: 100%; }
.btn.is-busy { opacity: .65; }

.btn-add {
  width: 100%;
  background: var(--surface-soft);
  border: 1px dashed var(--accent-line);
  color: var(--accent-dark);
  margin-top: 2px;
}
.btn-add:hover { background: var(--accent-soft); border-color: #aebff7; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 4px;
  background: none;
  border: 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 650;
}
.link-btn .icon { width: 15px; height: 15px; transition: transform .15s ease; }
.link-btn:hover .icon { transform: translateX(2px); }

.header-cta { min-height: 44px; font-size: 13.5px; }

/* ==========================================================================
   Workspace shell
   ========================================================================== */

.workspace-tabs { display: none; }

.workspace {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 24px 72px;
  display: grid;
  grid-template-columns: minmax(400px, 480px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.col-editor {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.col-preview {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  min-width: 0;
}

.panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.kicker .icon { width: 13px; height: 13px; stroke-width: 2.2; }

.editor-head h1 {
  font-size: clamp(24px, 2.2vw, 30px);
  line-height: 1.1;
  letter-spacing: -.035em;
  font-weight: 800;
}

/* ==========================================================================
   Score card
   ========================================================================== */

.score-card {
  position: relative;
  overflow: hidden;
  padding: 24px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(380px 220px at 100% 0%, rgba(37, 99, 235, .08), transparent 68%),
    var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.score-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ring {
  position: relative;
  width: 92px;
  height: 92px;
  flex: none;
}
.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring circle {
  fill: none;
  stroke-width: 7;
}
.ring-track { stroke: var(--line); }
.ring-value {
  stroke: #93a4ba;
  stroke-linecap: round;
  transition: stroke-dashoffset .5s cubic-bezier(.22, .8, .3, 1), stroke .25s ease;
}
.ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.ring-num strong {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.04em;
}
.ring-num span {
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.score-card[data-band="ready"] .ring-value { stroke: var(--green); }
.score-card[data-band="close"] .ring-value { stroke: var(--accent); }
.score-card[data-band="work"] .ring-value { stroke: var(--amber); }
.score-card[data-band="risk"] .ring-value { stroke: var(--red); }
.score-card[data-band="draft"] .ring-value { stroke: var(--muted-2); }

.score-copy { min-width: 0; }
.score-copy .kicker { color: var(--accent-dark); }
.score-copy h2 {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 800;
}
.score-verdict {
  margin-top: 4px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.score-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.mini-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.35;
}
.mini-cat b { color: var(--ink); font-weight: 700; }
.mini-cat[data-tone="good"] { background: var(--green-soft); color: var(--green); border-color: var(--green-line); }
.mini-cat[data-tone="low"] { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }
.mini-cat[data-tone="warn"] { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }

.score-alert {
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  color: #92400e;
  font-size: 12px;
  line-height: 1.4;
}

.score-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}
.score-actions .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(36, 72, 181, .2); }
.score-actions .btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.score-actions .btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.score-actions .btn-outline:hover { background: var(--paper); border-color: #b9c1cb; }
.score-actions .btn { min-height: 44px; font-size: 13px; }
.score-actions .link-btn { color: var(--accent-dark); margin-left: auto; }

.license-line {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ==========================================================================
   Editor cards and fields
   ========================================================================== */

.panel-edit { display: grid; gap: 14px; }

#resumeForm { display: grid; gap: 14px; }

.card {
  min-inline-size: 0;
  margin: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-legend {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 0;
  margin: 0 0 14px;
}
.card-legend .step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .02em;
}
.card-legend strong {
  display: block;
  font-size: 15.5px;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.card-legend small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted-2);
  font-weight: 400;
}

.field-grid {
  display: grid;
  gap: 11px;
  margin-bottom: 11px;
}
.field-grid.two { grid-template-columns: 1fr 1fr; }
.field-grid.three { grid-template-columns: 1.15fr 1fr 1fr; }
.field-grid.two:last-child, .field-grid.three:last-child { margin-bottom: 0; }

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  margin-bottom: 11px;
}
.field-grid .field { margin-bottom: 0; }
.field > span:first-child {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-3);
}
.field em {
  font-style: normal;
  font-weight: 400;
  color: var(--muted-2);
  font-size: 11px;
}
.field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.counter {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.counter.is-over { color: var(--amber); }
.counter.is-good { color: var(--green); }

input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: #6c7683; }
input:hover, textarea:hover { border-color: #b6bec8; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 91, 215, .14);
}
textarea { resize: vertical; min-height: 92px; }

.field-hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted-2);
}
.field-hint .icon { width: 13px; height: 13px; margin-top: 2px; }
.field .field-hint { margin-top: 6px; }

.entry-list { display: grid; gap: 10px; margin-bottom: 10px; }

.entry {
  padding: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.entry .field { margin-bottom: 10px; }
.entry .field:last-child { margin-bottom: 0; }

.entry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.entry-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.entry-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -10px -10px -10px 0;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: #9aa4b1;
}
.entry-remove:hover { background: var(--red-soft); color: var(--red); }
.entry-remove .icon { width: 17px; height: 17px; }

.entry-empty {
  padding: 15px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.5;
  background: var(--surface-soft);
}

/* Template picker */

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.template-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  min-height: 132px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.template-option:hover { border-color: #b9c3d2; background: var(--surface-soft); }
.template-option[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 91, 215, .12);
}

.template-swatch {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  height: 76px;
  padding: 8px 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}
.sw-name { display: block; height: 5px; width: 55%; background: #12171f; border-radius: 1px; }
.sw-rule { display: block; height: 1px; width: 100%; background: #c3cad4; margin: 3px 0; }
.sw-line { display: block; height: 2px; width: 100%; background: #dfe3e8; border-radius: 1px; }
.sw-line.short { width: 72%; }
.sw-accent { display: block; height: 3px; width: 42%; background: var(--accent); border-radius: 1px; margin: 2px 0; }

.swatch-meridian .sw-name { height: 7px; width: 66%; }
.swatch-manuscript {
  font-family: var(--serif);
  align-items: center;
}
.swatch-manuscript .sw-name { width: 48%; height: 5px; }
.swatch-manuscript .sw-rule { width: 70%; margin: 3px auto; }
.swatch-manuscript .sw-line { width: 86%; }
.swatch-manuscript .sw-line.short { width: 62%; }

.template-copy { display: flex; flex-direction: column; line-height: 1.25; }
.template-copy strong { font-size: 12.5px; font-weight: 700; }
.template-copy small { font-size: 10.5px; color: var(--muted-2); margin-top: 2px; }

.template-check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  opacity: 0;
  transform: scale(.75);
  transition: opacity .15s ease, transform .15s ease;
}
.template-check .icon { width: 13px; height: 13px; stroke-width: 3; }
.template-option[aria-pressed="true"] .template-check { opacity: 1; transform: scale(1); }

.privacy-note {
  display: flex;
  gap: 9px;
  padding: 2px 4px;
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.55;
}
.privacy-note .icon { width: 15px; height: 15px; margin-top: 1px; color: var(--muted); }
.privacy-note strong { color: var(--ink-3); }

/* ==========================================================================
   Preview
   ========================================================================== */

.preview-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--header-h) - 36px);
  min-height: 460px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.preview-head h2 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -.02em;
  font-weight: 750;
}
.preview-head .kicker { margin-bottom: 3px; }

.preview-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 11px;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
}
.tool-btn:hover { background: #e9edf2; color: var(--ink); }
.tool-btn[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.tool-btn .icon { width: 14px; height: 14px; }
.tool-proof { border-left: 1px solid var(--line); border-radius: 0 7px 7px 0; margin-left: 2px; padding-left: 12px; }

.preview-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 10px;
  font-size: 11px;
  color: var(--muted-2);
}
.preview-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
}

.preview-stage {
  position: relative;
  flex: 1;
  min-height: 360px;
  padding: 20px;
  overflow: auto;
  background:
    linear-gradient(0deg, rgba(18, 23, 31, .025), rgba(18, 23, 31, .025)),
    #e9edf2;
  border-radius: 12px;
  border: 1px solid #dfe4ea;
  overscroll-behavior: contain;
}

.preview-frame {
  position: relative;
  margin: 0 auto;
  overflow: hidden;
}
.preview-frame.is-scrollable { margin: 0; }

.cv-sheet {
  width: 816px;
  min-height: 1056px;
  padding: 70px 76px 64px;
  background: #fff;
  color: #12171f;
  transform-origin: top left;
  box-shadow: 0 2px 10px rgba(18, 23, 31, .1), 0 18px 44px rgba(18, 23, 31, .12);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.cv-head {
  padding-bottom: 12px;
  margin-bottom: 2px;
  border-bottom: 1.5px solid #12171f;
}
.cv-name {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.025em;
  color: #12171f;
}
.cv-role {
  margin-top: 3px;
  font-size: 13.5px;
  color: #3d4653;
}
.cv-contact {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.55;
  color: #4b5563;
}
.cv-contact:empty { display: none; }

.cv-section { margin-top: 19px; }
.cv-section h2 {
  margin: 0 0 8px;
  padding-bottom: 3px;
  border-bottom: 1px solid #c7cdd6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #12171f;
}

.cv-summary p {
  margin: 0 0 5px;
  font-size: 12px;
  line-height: 1.55;
}
.cv-summary p:last-child { margin-bottom: 0; }

.cv-entry { margin-bottom: 12px; }
.cv-entry:last-child { margin-bottom: 0; }
.cv-entry-title {
  font-size: 12.5px;
  line-height: 1.35;
}
.cv-entry-title strong { font-weight: 700; }
.cv-entry-company { font-weight: 400; }
.cv-entry-meta {
  margin-top: 1px;
  font-size: 10.8px;
  line-height: 1.4;
  color: #4b5563;
}
.cv-entry-detail {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #333c48;
}
.cv-bullets { margin: 4px 0 0; }
.cv-bullets li {
  position: relative;
  padding-left: 14px;
  margin-bottom: 2.5px;
  font-size: 12px;
  line-height: 1.5;
}
.cv-bullets li::before {
  content: "\2022";
  position: absolute;
  left: 1px;
  top: 0;
  color: #12171f;
}
.cv-skills {
  font-size: 12px;
  line-height: 1.55;
}

/* Meridian */
.tpl-meridian .cv-head { border-bottom: 0; padding-bottom: 2px; }
.tpl-meridian .cv-name {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.02;
}
.tpl-meridian .cv-role {
  margin-top: 5px;
  font-size: 14px;
  font-weight: 600;
  color: #2f5bd7;
}
.tpl-meridian .cv-contact { margin-top: 6px; color: #4b5563; }
.tpl-meridian .cv-section { margin-top: 24px; }
.tpl-meridian .cv-section h2 {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 9px;
  color: #2f5bd7;
  font-size: 10.5px;
  letter-spacing: .16em;
}
.tpl-meridian .cv-entry { margin-bottom: 15px; }
.tpl-meridian .cv-entry-title { font-size: 13px; }
.tpl-meridian .cv-entry-meta { font-size: 10.5px; color: #5b6472; }
.tpl-meridian .cv-bullets li { margin-bottom: 3px; }

/* Manuscript */
.tpl-manuscript {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 12.5px;
}
.tpl-manuscript .cv-head {
  border-bottom: 0;
  padding-bottom: 0;
  text-align: center;
}
.tpl-manuscript .cv-name {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0;
}
.tpl-manuscript .cv-role {
  font-size: 13px;
  font-style: italic;
  color: #4b5563;
}
.tpl-manuscript .cv-contact { font-size: 11px; }
.tpl-manuscript .cv-section { margin-top: 22px; }
.tpl-manuscript .cv-section h2 {
  border-bottom-color: #9aa3af;
  font-size: 11px;
  letter-spacing: .11em;
}
.tpl-manuscript .cv-entry-title { font-size: 13px; }
.tpl-manuscript .cv-bullets li { font-size: 12.5px; }
.tpl-manuscript .cv-skills { font-size: 12.5px; }
.tpl-manuscript .cv-summary p { font-size: 12.5px; }

.preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 320px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
}
.preview-empty .empty-mark {
  width: 54px;
  height: 54px;
  color: #9aa4b1;
  margin-bottom: 2px;
}
.preview-empty .empty-mark svg { width: 100%; height: 100%; }
.preview-empty h3 {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -.02em;
  color: var(--ink);
}
.preview-empty p {
  max-width: 380px;
  font-size: 12.5px;
  line-height: 1.55;
}
.preview-empty .empty-price {
  margin-top: 4px;
  font-weight: 650;
  color: var(--ink-3);
}

.preview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}
.preview-foot > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--muted-2);
}
.preview-foot .icon { width: 12px; height: 12px; }
.preview-foot .link-btn { font-size: 11.5px; min-height: 44px; }

/* ==========================================================================
   ATS report
   ========================================================================== */

.score-report {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 86px;
}
.score-report .panel-head { align-items: center; }
.score-report h2 {
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.03em;
  font-weight: 800;
}
.report-score {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.panel-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted-2);
}

.cat-list { display: grid; gap: 10px; margin-top: 16px; }
.cat-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--ink-3);
}
.cat-points {
  font-size: 11px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.cat-points b { color: var(--ink); font-weight: 700; }
.cat-bar {
  height: 5px;
  overflow: hidden;
  background: var(--paper-2);
  border-radius: 99px;
}
.cat-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .35s ease;
}
.cat[data-tone="good"] .cat-bar i { background: var(--green); }
.cat[data-tone="warn"] .cat-bar i { background: #d08a12; }
.cat[data-tone="low"] .cat-bar i { background: var(--red); }

.issue-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 0 4px;
}
.issue-head h3 {
  font-size: 14px;
  font-weight: 750;
  letter-spacing: -.01em;
}
.issue-count { font-size: 11px; color: var(--muted-2); }

.issue-list { display: grid; }
.issue {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.issue:last-child { border-bottom: 0; }
.issue-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--muted-2);
}
.issue[data-sev="critical"] .issue-dot { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.issue[data-sev="warning"] .issue-dot { background: #c57a0d; box-shadow: 0 0 0 3px var(--amber-soft); }
.issue[data-sev="minor"] .issue-dot { background: #8190a2; box-shadow: 0 0 0 3px var(--paper-2); }

.issue-body { min-width: 0; }
.issue-body h4 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
}
.issue-body h4 em {
  flex: none;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.issue[data-sev="critical"] h4 em { color: var(--red); }
.issue[data-sev="warning"] h4 em { color: var(--amber); }
.issue-evidence {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}
.issue-fix {
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-3);
}
.issue-fix strong {
  display: inline-block;
  margin-right: 4px;
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-dark);
}
.issue-why { margin-top: 5px; }
.issue-why summary {
  cursor: pointer;
  min-height: 44px;
  padding: 8px 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-2);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.issue-why summary::-webkit-details-marker { display: none; }
.issue-why summary::before { content: "+"; font-weight: 700; }
.issue-why[open] summary::before { content: "−"; }
.issue-why p {
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}

.issue-more { margin-top: 6px; }

.issue-empty, .issue-clear {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.55;
}
.issue-empty {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-dark);
}
.issue-empty .icon { margin-top: 1px; }
.issue-clear {
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: #135f3c;
}
.issue-clear .icon { margin-top: 1px; color: var(--green); }

.report-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.report-stats dt {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.report-stats dd {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.report-foot {
  margin-top: 12px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}
.report-foot .muted { color: var(--muted-2); }
.report-foot + .report-foot { margin-top: 6px; }

/* ==========================================================================
   Mobile action bar
   ========================================================================== */

.mobile-bar { display: none; }

/* ==========================================================================
   Modals
   ========================================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .75);
  backdrop-filter: blur(5px);
  animation: fade-in .16s ease both;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 470px;
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 26px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: pop-in .2s cubic-bezier(.2, .8, .3, 1) both;
}
.modal-wide { max-width: 860px; padding: 22px; }
.modal-small { max-width: 440px; }

.modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: var(--muted-2);
}
.modal-x:hover { background: var(--paper-2); color: var(--ink); }
.modal-x-inline { position: static; margin: -8px -8px 0 0; flex: none; }

.modal-dialog .kicker { margin-bottom: 7px; color: var(--accent-dark); }
.modal-dialog h2 {
  font-size: 27px;
  line-height: 1.12;
  letter-spacing: -.035em;
  font-weight: 800;
}
.modal-lede {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}

.paywall-title { font-size: 30px; }

.check-list {
  display: grid;
  gap: 9px;
  margin: 18px 0;
}
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
}
.check-list .icon {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--green);
  stroke-width: 2.4;
}

.modal-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 13px 16px;
  margin-bottom: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.modal-price span {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
}
.modal-price small { font-size: 12px; color: var(--muted-2); }

.modal-fine {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted-2);
}
.modal-fine .icon { width: 14px; height: 14px; margin-top: 1px; }

.success-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green);
}
.success-mark .icon { width: 26px; height: 26px; stroke-width: 2.4; }

.license-key {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--muted-2);
}
.license-key strong {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .02em;
  color: var(--ink-3);
}

/* Proof */

.proof-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.proof-head h2 {
  font-size: 23px;
  line-height: 1.15;
  letter-spacing: -.03em;
}
.proof-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted-2);
}
.proof-pages {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
  background: #e9edf2;
  border: 1px solid #dfe4ea;
  border-radius: 12px;
  min-height: 220px;
}
.proof-page canvas {
  max-width: 100%;
  height: auto !important;
  background: #fff;
  box-shadow: 0 2px 8px rgba(18, 23, 31, .12), 0 16px 34px rgba(18, 23, 31, .12);
}
.proof-more {
  padding: 8px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}
.proof-foot {
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted-2);
  text-align: center;
}

/* ==========================================================================
   Toasts
   ========================================================================== */

.toast-region {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(440px, calc(100% - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 10px 15px;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
  animation: toast-in .2s ease both;
}
.toast-ok { background: #0f5c39; }
.toast-warn { background: #7a4a06; }
.toast.is-out { animation: toast-out .24s ease both; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(4px); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1360px) {
  .workspace { grid-template-columns: minmax(350px, 440px) minmax(0, 1fr); }
}

@media (max-width: 1179px) {
  body { padding-bottom: 82px; }

  .workspace-tabs {
    position: sticky;
    top: var(--header-h);
    z-index: 55;
    display: flex;
    gap: 4px;
    padding: 9px 16px;
    background: rgba(246, 247, 249, .96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
  }
  .workspace-tabs button {
    flex: 1;
    min-height: 44px;
    padding: 0 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 650;
    color: var(--muted);
  }
  .workspace-tabs button[aria-pressed="true"] {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 16px 20px;
    gap: 16px;
  }

  .panel-edit,
  .preview-card,
  .score-report,
  .col-editor { scroll-margin-top: 128px; }

  .workspace[data-tab="edit"] .col-preview { display: none; }
  .workspace[data-tab="edit"] #panelScore { display: none; }
  .workspace[data-tab="preview"] .col-editor { display: none; }
  .workspace[data-tab="report"] .col-preview { display: none; }
  .workspace[data-tab="report"] .score-card,
  .workspace[data-tab="report"] .editor-head,
  .workspace[data-tab="report"] #panelEdit { display: none; }

  .col-preview { position: static; }
  .preview-card { max-height: none; min-height: 0; }
  .preview-stage { min-height: 420px; max-height: 72vh; }
  .preview-head h2 { font-size: 17px; }

  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(10px);
  }
  .mobile-score {
    display: flex;
    align-items: baseline;
    gap: 5px;
    line-height: 1;
  }
  .mobile-score strong {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.04em;
  }
  .mobile-score span {
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted-2);
  }
  .mobile-bar .btn { margin-left: auto; min-height: 46px; }

  .toast-region { bottom: 92px; }
}

@media (max-width: 820px) {
  .header-status { display: none; }
  .brand-pill { display: none; }
  .header-inner { padding: 0 16px; gap: 10px; }
  .preview-tools { width: 100%; justify-content: flex-end; }
  .preview-head { flex-direction: column; }
}

@media (max-width: 640px) {
  .announce { flex-direction: column; gap: 1px; padding: 7px 14px; }
  .announce-sub { font-size: 11.5px; }
  .announce-sub::before { display: none; }

  .license-text { display: none; }
  .license-chip { padding: 0; width: 44px; justify-content: center; }
  .header-cta { font-size: 12.5px; padding: 0 12px; }
  .brand-name { font-size: 17px; }
  .brand-mark { width: 34px; height: 34px; }

  .workspace { padding: 12px 12px 16px; }
  .workspace-tabs { padding: 8px 12px; }
  .editor-head h1 { font-size: 23px; }
  .score-card { padding: 17px; }
  .ring { width: 82px; height: 82px; }
  .ring-num strong { font-size: 24px; }
  .score-copy h2 { font-size: 20px; }
  .card { padding: 15px; }
  .preview-stage { padding: 12px; }

  .modal { padding: 12px; }
  .modal-dialog { padding: 22px; max-height: calc(100vh - 24px); }
  .paywall-title { font-size: 26px; }
  .modal-actions .btn { flex: 1 1 100%; }

  .template-option { min-height: 124px; }
  .template-copy small { font-size: 9.5px; }
}

@media (max-width: 560px) {
  .field-grid.two { grid-template-columns: 1fr; }
  .field-grid.three { grid-template-columns: 1fr 1fr; }
  .field-grid.three .field:first-child { grid-column: 1 / -1; }
  .template-grid { grid-template-columns: 1fr; }
  .template-option {
    flex-direction: row;
    align-items: center;
    min-height: 0;
    padding: 9px;
  }
  .template-swatch { width: 62px; height: 48px; flex: none; gap: 2px; }
  .template-copy { flex: 1; }
  .template-check { position: static; margin-left: auto; }
  .report-stats { grid-template-columns: repeat(2, 1fr); }
  .score-actions .link-btn { margin-left: 0; width: 100%; justify-content: flex-start; }
  .preview-foot { justify-content: center; }
  .preview-foot .link-btn { min-height: 44px; }
}

@media (max-width: 400px) {
  .mobile-score span { display: none; }
}

@media (max-width: 345px) {
  .license-chip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

