/* ResumeHardener — product layer. Forge chassis (forge-base.css) loads first;
   --coral overrides --accent below, plus RH-only UI (templates, refine bar, dl-bar). */
:root {
  --accent: #E85D24;
  --accent-soft: #fdece4;
  --accent-ink: #b54818;
  /* Light theme (default) */
  --navy: #1a1a2e;
  --coral: #E85D24;
  --coral-hover: #d44e18;
  --coral-soft: #fdece4;
  --bg: #FAF8F5;
  --bg-2: #f3efe8;
  --bg-card: #ffffff;
  --line: #ebe7e0;
  --line-strong: #d8d3ca;
  --ink: #1a1a2e;
  --ink-2: #4a4a5e;
  --ink-3: #666675;
  --ok: #1f7a4d;
  --ok-soft: #e3f3eb;
  --warn: #b25e10;
  --warn-soft: #fbeede;
  --bad: #a3261c;
  --bad-soft: #fbe6e3;
  --shadow-sm: 0 1px 2px rgba(26,26,46,0.06), 0 0 0 1px rgba(26,26,46,0.04);
  --shadow-md: 0 4px 12px rgba(26,26,46,0.08), 0 0 0 1px rgba(26,26,46,0.05);
  --shadow-lg: 0 12px 40px rgba(26,26,46,0.12), 0 0 0 1px rgba(26,26,46,0.05);
  --topbar-bg: rgba(250, 248, 245, 0.85);
  --doc-bg: #ffffff;
  --doc-ink: #1a1a2e;

  --radius: 8px;
  --radius-lg: 12px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --accent: #ff7240;
  --accent-soft: rgba(255, 114, 64, 0.14);
  --accent-ink: #ff8758;
  --navy: #0d0d18;
  --coral: #ff7240;
  --coral-hover: #ff8758;
  --coral-soft: rgba(255, 114, 64, 0.14);
  --bg: #0f0f17;
  --bg-2: #15151f;
  --bg-card: #1a1a26;
  --line: #2a2a38;
  --line-strong: #3a3a4a;
  --ink: #f0eee8;
  --ink-2: #b8b6b0;
  --ink-3: #7a7886;
  --ok: #4ade80;
  --ok-soft: rgba(74, 222, 128, 0.14);
  --warn: #f5b056;
  --warn-soft: rgba(245, 176, 86, 0.14);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.14);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
  --topbar-bg: rgba(15, 15, 23, 0.85);
  --doc-bg: #ffffff;
  --doc-ink: #1a1a2e;
}

/* Reset, body baseline, .btn (base + sm/lg/xl/block), .btn-primary, .btn-ghost,
   .btn-outline, .btn-link, .theme-toggle now in forge-base.css. RH adds
   primary brand glow + extra Inter font features below. */
body {
  font-feature-settings: "ss01", "cv11";
}
.btn-primary {
  /* #C34714: deepened coral so white button text clears WCAG AA (4.95:1). The bright brand
     coral (--coral / --accent) stays on text accents like the hero "reformatted". */
  background: #C34714; color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.18);
}
.btn-primary:hover { background: #a83c10; }

/* ---------- Layout primitives ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* ---------- Topbar ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: saturate(140%) blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: -0.02em; color: var(--ink);
  font-size: 17px; text-decoration: none; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--navy); position: relative; display: inline-block;
}
[data-theme="dark"] .logo-mark { background: var(--coral); }
.logo-mark::before, .logo-mark::after, .logo-mark > span {
  content: ""; position: absolute; background: #fff;
}
.logo-mark::before { left: 6px; top: 7px; width: 14px; height: 2px; background: var(--coral); }
[data-theme="dark"] .logo-mark::before { background: var(--navy); }
.logo-mark::after { left: 6px; top: 12px; width: 9px; height: 2px; }
.logo-mark > span { left: 6px; top: 17px; width: 11px; height: 2px; display: block; }

.topbar-meta { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 12px; }
.topbar-meta .status-pill { display: inline-flex; align-items: center; gap: 6px; }
.topbar-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); display: inline-block; box-shadow: 0 0 0 3px var(--ok-soft); }

/* .theme-toggle base in forge-base.css. .lang-toggle keeps RH-specific shape. */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; color: var(--ink-2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.lang-toggle:hover { border-color: var(--ink-3); color: var(--ink); }
.lang-toggle .flag { font-size: 14px; line-height: 1; }
.lang-toggle .chev { color: var(--ink-3); }

/* Lang dropdown */
.lang-wrap { position: relative; }
.lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-md);
  padding: 4px; min-width: 160px; z-index: 20;
  display: flex; flex-direction: column; gap: 1px;
}
.lang-menu button {
  background: transparent; border: none; padding: 8px 10px;
  text-align: left; font-size: 13px; color: var(--ink-2);
  border-radius: 6px; display: flex; align-items: center; gap: 10px;
  font-family: inherit;
}
.lang-menu button:hover { background: var(--bg-2); color: var(--ink); }
.lang-menu button.active { color: var(--coral); font-weight: 600; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0; margin-top: 80px;
  font-size: 13px; color: var(--ink-3); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--ink); }
.footer-links { display: flex; gap: 20px; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 64px; text-align: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px 6px 10px; margin-bottom: 28px;
}
.hero-eyebrow .badge-dot { width: 6px; height: 6px; border-radius: 50%;
  background: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
.hero h1 {
  font-size: 68px; line-height: 1.02; letter-spacing: -0.035em;
  font-weight: 700; margin: 0 0 24px; color: var(--ink);
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--coral); }
.hero p.subline {
  font-size: 19px; color: var(--ink-2); max-width: 620px;
  margin: 0 auto 36px; text-wrap: pretty; line-height: 1.5;
}
.hero-cta-row { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero-cta-meta { font-size: 13px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Trust signals ---------- */
.trust-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 64px; }
.trust-item {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px;
  display: flex; gap: 14px; align-items: flex-start;
}
.trust-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--navy); color: #fff;
  display: grid; place-items: center; flex: 0 0 36px;
}
[data-theme="dark"] .trust-icon { background: var(--coral); }
.trust-text .trust-title { margin: 0 0 4px; font-size: 14px; font-weight: 600; letter-spacing: -0.005em; color: var(--ink); }
.trust-text p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }

/* ---------- Section heading ---------- */
.section { padding: 88px 0; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-ink); margin-bottom: 12px; }
.section h2 { font-size: 38px; line-height: 1.1; letter-spacing: -0.025em; font-weight: 700; color: var(--ink); margin: 0 0 12px; }
.section h2 + p { font-size: 17px; color: var(--ink-2); max-width: 580px; margin: 0 auto; }

/* ---------- Before/After cards (landing) ---------- */
.compare-grid {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 0;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.compare-side { padding: 28px 32px; display: flex; flex-direction: column; gap: 14px; }
.compare-label { display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.compare-label.before { color: var(--bad); }
.compare-label.after { color: var(--ok); }
.compare-label .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.compare-bullet { font-size: 16px; line-height: 1.55; color: var(--ink);
  font-weight: 500; letter-spacing: -0.005em; position: relative; padding-left: 18px; }
.compare-bullet::before { content: "•"; position: absolute; left: 4px; color: var(--ink-3); }
.compare-bullet mark { background: var(--ok-soft); color: var(--ok);
  padding: 0 3px; border-radius: 3px; font-weight: 600; }
.compare-arrow { width: 56px; display: grid; place-items: center;
  background: var(--bg); border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  color: var(--ink-3); }
.compare-meta { display: flex; gap: 16px; font-size: 12px; color: var(--ink-3); margin-top: auto; flex-wrap: wrap; }
.compare-meta span strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; position: relative; }
.steps::before {
  content: ""; position: absolute; top: 22px; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(to right, transparent, var(--line-strong) 8%, var(--line-strong) 92%, transparent); z-index: 0;
}
.step { position: relative; text-align: center; z-index: 1; }
.step-num {
  width: 44px; height: 44px; margin: 0 auto 18px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--line);
  display: grid; place-items: center; font-weight: 600; font-size: 15px;
  color: var(--ink); letter-spacing: -0.01em;
}
.step h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.step p { margin: 0 auto; font-size: 14px; color: var(--ink-2); line-height: 1.5; max-width: 240px; }

/* ---------- Upload page ---------- */
.upload-page { padding: 56px 0 80px; }
.upload-page h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.025em; margin: 0 0 8px; color: var(--ink); }
.upload-page .lead { font-size: 16px; color: var(--ink-2); margin: 0 0 36px; }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }

.upload-zone {
  background: var(--bg-card); border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg); padding: 32px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; min-height: 460px;
  transition: border-color 0.15s ease, background 0.15s ease; cursor: pointer;
}
.upload-zone:hover { border-color: var(--ink-3); }
.upload-zone.dragging { border-color: var(--coral); background: var(--coral-soft); }
.upload-zone.has-file { border-style: solid; cursor: default; padding: 24px; align-items: stretch; justify-content: flex-start; }
.upload-zone.error { border-color: var(--bad); background: var(--bad-soft); }
.upload-icon {
  width: 56px; height: 56px; border-radius: 12px;
  background: var(--bg-2); display: grid; place-items: center;
  color: var(--ink); margin-bottom: 18px;
}
.upload-zone h3 { font-size: 17px; font-weight: 600; margin: 0 0 6px; color: var(--ink); }
.upload-zone .hint { font-size: 13px; color: var(--ink-3); margin: 0; }
.upload-zone .hint strong { color: var(--coral); font-weight: 600; }
.upload-zone .filehint { margin-top: 18px; font-size: 12px; color: var(--ink-3);
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: center; }
.upload-zone .filehint span { display: inline-flex; align-items: center; gap: 6px; }

/* Inline error in upload zone */
.upload-error {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; padding: 16px; max-width: 320px;
}
.upload-error .err-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bad-soft); color: var(--bad);
  display: grid; place-items: center;
}
.upload-error h4 { margin: 6px 0 0; font-size: 15px; color: var(--ink); }
.upload-error p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }

/* PDF preview card */
.pdf-preview-card { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.pdf-preview-head { display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); gap: 8px; flex-wrap: wrap; }
.pdf-preview-head .filename { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink); }
.pdf-preview-head .filemeta { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pdf-thumbnail-wrap {
  flex: 1; background: var(--bg-2); border-radius: 8px; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  position: relative; overflow: hidden; min-height: 280px;
}
.pdf-thumbnail {
  width: 220px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-md);
  aspect-ratio: 8.5 / 11; padding: 16px 18px;
  font-size: 5.5px; line-height: 1.4; color: var(--doc-ink); overflow: hidden;
}
.pdf-thumbnail .name { font-size: 12px; font-weight: 700; margin-bottom: 1px; }
.pdf-thumbnail .role { font-size: 7px; color: #4a4a5e; margin-bottom: 6px; }
.pdf-thumbnail .contact { font-size: 5px; color: #7a7a8a; margin-bottom: 8px;
  border-bottom: 0.5px solid #ebe7e0; padding-bottom: 4px; }
.pdf-thumbnail .sec { font-size: 6.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin: 6px 0 3px; color: var(--doc-ink); }
.pdf-thumbnail .job-h { display: flex; justify-content: space-between; font-size: 6px; font-weight: 600; margin-bottom: 1px; }
.pdf-thumbnail .job-sub { font-size: 5px; color: #7a7a8a; margin-bottom: 2px; }
.pdf-thumbnail .b { font-size: 5px; color: #4a4a5e; padding-left: 6px; margin-bottom: 1px; position: relative; }
.pdf-thumbnail .b::before { content: "•"; position: absolute; left: 0; color: #7a7a8a; }

/* Template picker */
.picker-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.picker-head h3 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -0.01em; color: var(--ink); }
.picker-head .req { font-size: 12px; color: var(--ink-3); }
.template-list { display: flex; flex-direction: column; gap: 12px; }
.tpl-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px;
  display: grid; grid-template-columns: 80px 1fr auto; gap: 16px;
  align-items: center; cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tpl-card:hover { border-color: var(--ink-3); }
.tpl-card.selected { border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
.tpl-mini {
  width: 80px; height: 100px; background: #fff;
  border: 1px solid #ebe7e0; border-radius: 4px; padding: 8px;
  font-size: 3.5px; line-height: 1.5; overflow: hidden; flex-shrink: 0; color: #1a1a2e;
}
.tpl-mini.classic .head { font-family: Georgia, serif; font-size: 7px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.tpl-mini.classic .sub { font-size: 4px; text-align: center; color: #7a7a8a; border-bottom: 0.5px solid #ebe7e0; padding-bottom: 3px; margin-bottom: 4px; }
.tpl-mini.classic .h { font-family: Georgia, serif; font-size: 5px; font-weight: 700; margin: 4px 0 1px; }
.tpl-mini.classic .l { font-size: 3px; height: 2.5px; background: #7a7a8a; opacity: 0.4; margin-bottom: 1px; border-radius: 1px; }
.tpl-mini.classic .l.short { width: 70%; }
.tpl-mini.modern { display: grid; grid-template-columns: 30% 1fr; gap: 4px; padding: 0; }
.tpl-mini.modern .side { background: #1a1a2e; padding: 6px 4px; height: 100%; }
.tpl-mini.modern .side .name { color: #fff; font-size: 5px; font-weight: 700; margin-bottom: 4px; }
.tpl-mini.modern .side .l { background: rgba(255,255,255,0.4); height: 1.5px; margin-bottom: 1.5px; border-radius: 1px; }
.tpl-mini.modern .side .l.short { width: 60%; }
.tpl-mini.modern .main { padding: 6px 6px 6px 0; }
.tpl-mini.modern .h { font-size: 4.5px; font-weight: 700; margin-bottom: 1.5px; color: #1a1a2e; }
.tpl-mini.modern .l { background: #7a7a8a; opacity: 0.4; height: 1.5px; border-radius: 1px; margin-bottom: 1.5px; }
.tpl-mini.modern .l.short { width: 65%; }
.tpl-mini.minimal { padding: 12px 10px; }
.tpl-mini.minimal .name { font-size: 6px; font-weight: 600; letter-spacing: 0.04em; margin-bottom: 6px; }
.tpl-mini.minimal .h { font-size: 4px; text-transform: uppercase; letter-spacing: 0.1em; color: #7a7a8a; margin: 4px 0 1.5px; }
.tpl-mini.minimal .l { background: #7a7a8a; opacity: 0.35; height: 1.5px; border-radius: 1px; margin-bottom: 1.5px; }
.tpl-mini.minimal .l.short { width: 55%; }

.tpl-info h4 { margin: 0 0 2px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.tpl-info p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.tpl-info .tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tpl-info .tag { font-size: 11px; color: var(--ink-3); background: var(--bg);
  border-radius: 4px; padding: 2px 6px; border: 1px solid var(--line); }
.tpl-radio { width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); position: relative; flex-shrink: 0;
  transition: border-color 0.15s ease, border-width 0.15s ease; }
.tpl-card.selected .tpl-radio { border-color: var(--coral); border-width: 6px; }

.upload-cta-row { margin-top: 28px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.upload-cta-row .btn-primary { width: 100%; }
.upload-cta-meta { font-size: 12px; color: var(--ink-3); text-align: center;
  display: inline-flex; justify-content: center; gap: 6px; align-items: center; }

/* Inline error banner */
.error-banner {
  background: var(--bad-soft); border: 1px solid rgba(163, 38, 28, 0.2);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
  display: flex; gap: 10px; align-items: flex-start; color: var(--ink);
}
.error-banner .err-icon { color: var(--bad); flex-shrink: 0; margin-top: 1px; }
.error-banner h4 { margin: 0 0 2px; font-size: 14px; font-weight: 600; color: var(--bad); }
.error-banner p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.error-banner button { margin-left: auto; flex-shrink: 0; }

/* ---------- Processing page ---------- */
.processing-page { flex: 1; display: flex; align-items: center; justify-content: center; padding: 60px 24px; }
.processing-card {
  width: 100%; max-width: 520px; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 40px 36px; box-shadow: var(--shadow-md); text-align: center;
}
.processing-card.error { border-color: rgba(163, 38, 28, 0.3); }
.processing-card h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 6px; }
.processing-card .lead { font-size: 14px; color: var(--ink-3); margin: 0 0 32px; }
.processing-progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 32px; }
.processing-progress .fill { height: 100%; background: var(--coral); border-radius: 2px; transition: width 0.4s ease; }
.proc-steps { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.proc-step {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 10px; border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease; opacity: 0.4;
}
.proc-step.active { background: var(--coral-soft); border-color: rgba(232, 93, 36, 0.2); opacity: 1; }
.proc-step.done { opacity: 1; }
.proc-icon {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--bg-2); border: 1.5px solid var(--line-strong); color: var(--ink-3);
}
.proc-step.active .proc-icon { background: var(--coral); border-color: var(--coral); color: #fff; position: relative; }
.proc-step.active .proc-icon::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--coral); opacity: 0.4;
  animation: pulse 1.4s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(0.9); opacity: 0.5; } 100% { transform: scale(1.4); opacity: 0; } }
.proc-step.done .proc-icon { background: var(--ok); border-color: var(--ok); color: #fff; }
.proc-text { flex: 1; font-size: 14px; font-weight: 500; color: var(--ink); letter-spacing: -0.005em; }
.proc-step:not(.active):not(.done) .proc-text { color: var(--ink-3); font-weight: 400; }
.proc-time { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.processing-meta { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-3); display: flex; justify-content: center; gap: 6px; align-items: center; flex-wrap: wrap; }
.proc-spinner { width: 12px; height: 12px; border: 1.5px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Error block on processing page */
.proc-error-icon {
  width: 56px; height: 56px; border-radius: 50%; background: var(--bad-soft);
  color: var(--bad); display: grid; place-items: center; margin: 0 auto 18px;
}

/* ---------- Result page ---------- */
.result-page { padding: 40px 0 80px; }
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.result-head .left h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; color: var(--ink); display: flex; align-items: center; gap: 12px; }
.result-head .left h1 svg { color: var(--ok); }
.result-head .left p { margin: 0; font-size: 14px; color: var(--ink-2); }
.result-head .timer {
  background: var(--warn-soft); border: 1px solid rgba(178, 94, 16, 0.2);
  border-radius: 8px; padding: 10px 14px; font-size: 13px; color: var(--warn);
  display: flex; align-items: center; gap: 8px;
  font-variant-numeric: tabular-nums; font-weight: 500;
}
[data-theme="dark"] .result-head .timer { color: #f5b056; }

.improvements { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.imp-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ok-soft); color: var(--ok);
  border: 1px solid rgba(31, 122, 77, 0.2); border-radius: 999px;
  padding: 6px 12px 6px 10px; font-size: 13px; font-weight: 500;
}
.imp-badge.score { background: var(--navy); color: #fff; border-color: var(--navy); }
[data-theme="dark"] .imp-badge.score { background: var(--coral); border-color: var(--coral); color: #fff; }
.imp-badge.score strong { font-weight: 700; font-variant-numeric: tabular-nums; }
.imp-badge .num { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ── Referrer banner (marketing variants) ────────────────────────────── */
.referrer-banner {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 8px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  animation: referrer-slide-in 0.5s ease-out;
}
@keyframes referrer-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.referrer-flag {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  background: var(--ink); color: #fff;
  border-radius: 50%;
  font-weight: 700; font-size: 11px;
  font-family: var(--font);
  letter-spacing: -0.02em;
}
[data-theme="dark"] .referrer-flag { background: var(--coral); }
.referrer-text {
  font-weight: 600; color: var(--ink); letter-spacing: -0.005em;
}
.referrer-divider {
  width: 1px; height: 14px;
  background: var(--line-strong);
}
.referrer-msg {
  color: var(--ink-3); font-weight: 500;
}
@media (max-width: 480px) {
  .referrer-divider, .referrer-msg { display: none; }
}

/* ── Download button success state ───────────────────────────────────── */
.btn-download-cta.is-loading .btn-download-icon { animation: dl-spin 0.9s linear infinite; }
.btn-download-cta.is-success .btn-download-content {
  background: linear-gradient(135deg, #1f7a4d 0%, #2a9c64 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 6px 16px rgba(31,122,77,0.4);
}
.btn-download-cta.is-success .btn-download-glow {
  background: radial-gradient(ellipse at center, #2a9c64 0%, transparent 70%);
  animation: none;
  opacity: 0.55;
}
.btn-download-cta.is-success .btn-download-icon {
  animation: dl-success-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.btn-download-cta.is-success .btn-download-content::after { display: none; }
.btn-download-cta.is-success .btn-download-arrow { display: none; }
.btn-download-cta.is-success { animation: none; }
.btn-download-cta.is-success:hover { transform: none; }

@keyframes dl-spin {
  to { transform: rotate(360deg); }
}
@keyframes dl-success-pop {
  0% { transform: scale(0.4); }
  60% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* When the parent dl-bar is in success state, kill the attention bob */
.dl-bar.is-success { animation: none; }
.dl-bar.is-success::before { opacity: 0.08; }
.dl-bar.is-success .dl-bar-shimmer { display: none; }
.dl-bar.is-success .dl-bar-icon-ring { animation: none; opacity: 0; }
.dl-bar.is-success .dl-bar-warn {
  color: #58c896;
}
.dl-bar.is-success .dl-bar-dot {
  background: #58c896;
  animation: none;
  box-shadow: 0 0 0 4px rgba(88,200,150,0.18);
}

/* Loading spinner glyph */
.dl-spinner {
  width: 18px; height: 18px;
  border: 2.4px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: dl-spin 0.8s linear infinite;
}
.dl-bar {
  position: relative;
  background: var(--ink);
  color: #fff;
  border-radius: 18px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(26,26,46,0.18), 0 1px 0 rgba(255,255,255,0.04) inset;
  isolation: isolate;
  animation: dl-bar-attention 4s ease-in-out 0.6s infinite;
}
[data-theme="dark"] .dl-bar {
  background: #2a2a44;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.06) inset;
}
@keyframes dl-bar-attention {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
/* Soft coral wash in the upper-right */
.dl-bar::before {
  content: ""; position: absolute; pointer-events: none;
  top: -50%; right: -10%; width: 360px; height: 360px;
  background: radial-gradient(circle, var(--coral) 0%, transparent 65%);
  opacity: 0.22; filter: blur(4px);
  z-index: 0;
}
/* Sweeping shimmer */
.dl-bar-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,0.08) 50%, transparent 65%);
  background-size: 250% 100%;
  background-position: 150% 0;
  animation: dl-shimmer 4.5s ease-in-out infinite;
  z-index: 1; pointer-events: none;
}
@keyframes dl-shimmer {
  0% { background-position: 150% 0; }
  60%, 100% { background-position: -50% 0; }
}
.dl-bar-inner {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 20px 22px;
}

/* Left side: icon + filename + warning */
.dl-bar-meta {
  display: flex; align-items: center; gap: 16px; min-width: 0;
}
.dl-bar-icon-wrap {
  position: relative; flex-shrink: 0;
  width: 52px; height: 52px;
}
.dl-bar-icon {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff; z-index: 2;
  backdrop-filter: blur(4px);
}
.dl-bar-icon-ring {
  position: absolute; inset: -3px; border-radius: 14px;
  border: 2px solid var(--coral); opacity: 0.6;
  animation: dl-icon-ring 2.4s ease-out infinite;
}
@keyframes dl-icon-ring {
  0% { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.18); opacity: 0; }
}
.dl-bar-text { min-width: 0; }
.dl-bar-filename {
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.dl-bar-size { color: rgba(255,255,255,0.55); font-weight: 500; }
.dl-bar-warn {
  margin-top: 4px;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--coral);
  font-weight: 500; font-variant-numeric: tabular-nums;
}
.dl-bar-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 0 var(--coral);
  animation: dl-dot-pulse 1.6s ease-out infinite;
}
@keyframes dl-dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(232,93,36,0.7); }
  70% { box-shadow: 0 0 0 8px rgba(232,93,36,0); }
  100% { box-shadow: 0 0 0 0 rgba(232,93,36,0); }
}

/* Right side: actions */
.dl-bar-actions {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.dl-secondary {
  background: transparent !important;
  color: rgba(255,255,255,0.85) !important;
  border-color: rgba(255,255,255,0.18) !important;
}
.dl-secondary:hover {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.30) !important;
  color: #fff !important;
}

/* Primary download CTA — large, glowing, animated */
.btn-download-cta {
  position: relative;
  border: none; padding: 0; background: transparent;
  cursor: pointer; font-family: inherit;
  border-radius: 14px;
  isolation: isolate;
  transition: transform 0.12s ease;
}
.btn-download-cta:hover { transform: translateY(-1px); }
.btn-download-cta:active { transform: translateY(0); }
.btn-download-glow {
  position: absolute; inset: -2px;
  border-radius: 16px;
  background: radial-gradient(ellipse at center, var(--coral) 0%, transparent 70%);
  opacity: 0.6; filter: blur(12px);
  z-index: 0;
  animation: dl-cta-glow 2.2s ease-in-out infinite;
}
@keyframes dl-cta-glow {
  0%, 100% { opacity: 0.45; transform: scale(0.96); }
  50% { opacity: 0.75; transform: scale(1.04); }
}
.btn-download-content {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 14px;
  padding: 12px 18px 12px 16px;
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-hover) 100%);
  border-radius: 14px;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 6px 16px rgba(232,93,36,0.4);
}
.btn-download-content::after {
  /* light-sweep across the button */
  content: ""; position: absolute; inset: 0;
  border-radius: 14px;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.30) 50%, transparent 70%);
  background-size: 220% 100%;
  background-position: 150% 0;
  animation: dl-cta-sweep 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes dl-cta-sweep {
  0% { background-position: 150% 0; }
  55%, 100% { background-position: -60% 0; }
}
.btn-download-icon {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.18);
  border-radius: 8px;
  flex-shrink: 0;
  animation: dl-icon-bob 2s ease-in-out infinite;
}
@keyframes dl-icon-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.btn-download-label {
  display: flex; flex-direction: column; align-items: flex-start;
  line-height: 1.15; text-align: left;
}
.btn-download-main {
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
}
.btn-download-sub {
  font-size: 11px; font-weight: 500;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-top: 2px;
}
.btn-download-arrow {
  display: inline-flex;
  margin-left: 2px;
  opacity: 0.85;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.btn-download-cta:hover .btn-download-arrow { transform: translateX(4px); opacity: 1; }
.btn-download-cta:hover .btn-download-glow { opacity: 0.9; }

/* Mobile */
@media (max-width: 880px) {
  .dl-bar-inner { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
  .dl-bar-actions { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .dl-bar-actions .btn-download-cta { width: 100%; }
  .dl-bar-actions .btn-download-content { justify-content: center; padding: 14px 18px; }
  .dl-secondary { width: 100%; justify-content: center; }
  .dl-bar-icon-wrap { width: 44px; height: 44px; }
  .dl-bar-filename { font-size: 14px; white-space: normal; }
  .dl-bar-warn { font-size: 12px; }
}
@media (max-width: 480px) {
  .btn-download-sub { display: none; }
}

/* ── Refinement card (refreshed) ────────────────────────────────────── */
.refine-card {
  position: relative;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card) 60%, var(--coral-soft) 200%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.refine-card:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
[data-theme="dark"] .refine-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card) 55%, rgba(255,114,64,0.18) 200%);
}
.refine-card.depleted {
  background: var(--bg-card);
  border-color: var(--line);
}
.refine-glow {
  position: absolute; pointer-events: none;
  top: -40%; right: -10%; width: 320px; height: 320px;
  background: radial-gradient(circle, var(--coral) 0%, transparent 65%);
  opacity: 0.10; filter: blur(8px);
  transition: opacity 0.3s ease;
}
.refine-card.depleted .refine-glow { display: none; }
.refine-card-inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
}

/* Animated icon */
.refine-icon-wrap { position: relative; flex-shrink: 0; width: 44px; height: 44px; }
.refine-icon {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--coral), var(--coral-hover));
  border-radius: 12px; color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(232,93,36,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
  z-index: 2;
  animation: refine-shimmer 4s ease-in-out infinite;
}
.refine-card.depleted .refine-icon {
  background: var(--bg-2); color: var(--ink-3);
  box-shadow: none; animation: none;
  border: 1px solid var(--line);
}
.refine-icon-pulse {
  position: absolute; inset: -2px; border-radius: 14px;
  border: 2px solid var(--coral); opacity: 0.4;
  animation: refine-pulse 2.2s ease-out infinite;
}
@keyframes refine-pulse {
  0% { transform: scale(0.95); opacity: 0.5; }
  100% { transform: scale(1.25); opacity: 0; }
}
@keyframes refine-shimmer {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(8deg); }
}

/* Text */
.refine-text { min-width: 0; }
.refine-text h4 {
  margin: 0 0 3px; font-size: 15px; font-weight: 700;
  letter-spacing: -0.01em; color: var(--ink);
}
.refine-text p {
  margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.45;
}
.refine-card.depleted .refine-text h4 { color: var(--ink-2); }
.refine-card.depleted .refine-text p { color: var(--ink-3); }

/* Meter */
.refine-meter {
  display: flex; flex-direction: column; gap: 6px;
  padding: 0 18px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  align-self: stretch;
  justify-content: center;
  min-width: 110px;
}
.refine-meter-head {
  display: inline-flex; align-items: baseline; gap: 2px;
  font-variant-numeric: tabular-nums;
}
.refine-meter-num {
  font-size: 26px; font-weight: 700; color: var(--coral);
  letter-spacing: -0.03em; line-height: 1;
}
.refine-card.depleted .refine-meter-num { color: var(--ink-3); }
.refine-meter-denom {
  font-size: 14px; font-weight: 600; color: var(--ink-3);
}
.refine-meter-label {
  font-size: 11px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}
.refine-bars {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 3px; margin-top: 4px;
}
.refine-bar {
  height: 4px; border-radius: 2px;
  background: var(--line-strong);
  transition: background 0.3s ease, transform 0.2s ease;
}
.refine-bar.used { background: var(--coral); }
.refine-bar.next {
  background: linear-gradient(90deg, var(--coral) 50%, var(--line-strong) 50%);
  background-size: 200% 100%;
  animation: refine-bar-shift 1.6s ease-in-out infinite;
}
@keyframes refine-bar-shift {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0% 0; }
}

/* Refine button — quiet, confident, navy-on-warm */
.btn-refine {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 16px 11px 14px;
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px; font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 1px 2px rgba(0,0,0,0.10);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.btn-refine:hover {
  background: #25253f;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 4px 12px rgba(26,26,46,0.25);
}
.btn-refine:active { transform: translateY(0.5px); }
[data-theme="dark"] .btn-refine {
  background: #fff; color: var(--ink); border-color: #fff;
}
[data-theme="dark"] .btn-refine:hover { background: #f0eee8; }

.btn-refine-content {
  display: inline-flex; align-items: center; gap: 10px;
}
.btn-refine-spark {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: var(--coral);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08), 0 1px 2px rgba(232,93,36,0.4);
}
.btn-refine-arrow {
  display: inline-flex;
  transition: transform 0.2s ease;
  opacity: 0.7;
}
.btn-refine:hover .btn-refine-arrow { transform: translateX(3px); opacity: 1; }

/* Mobile */
@media (max-width: 880px) {
  .refine-card-inner {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "icon text"
      "meter meter"
      "btn btn";
    gap: 14px;
    padding: 16px;
  }
  .refine-icon-wrap { grid-area: icon; }
  .refine-text { grid-area: text; }
  .refine-meter {
    grid-area: meter;
    flex-direction: row; align-items: center;
    justify-content: space-between;
    padding: 12px 14px; min-width: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
    gap: 14px;
  }
  .refine-meter-head, .refine-meter-label { display: inline-flex; }
  .refine-bars { flex: 1; margin-top: 0; max-width: 140px; }
  .btn-refine { grid-area: btn; width: 100%; justify-content: center; padding: 14px 18px; font-size: 15px; }
  .btn-refine-content { justify-content: center; flex: 1; }
}

.compare-pdfs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 32px; }
.pdf-pane {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  display: flex; flex-direction: column;
}
.pdf-pane-head { padding: 14px 18px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pdf-pane-head .label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: -0.005em; color: var(--ink); }
.pdf-pane-head .label .pill { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 4px; }
.pdf-pane-head .label .pill.before { background: var(--bad-soft); color: var(--bad); }
.pdf-pane-head .label .pill.after { background: var(--ok-soft); color: var(--ok); }
.pdf-pane-head .meta { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pdf-pane-body {
  flex: 1; background: var(--bg-2); padding: 24px;
  max-height: 720px; overflow-y: auto;
}
.pdf-doc {
  background: var(--doc-bg); border: 1px solid #ebe7e0; box-shadow: var(--shadow-md);
  aspect-ratio: 8.5 / 11; padding: 36px 40px;
  font-size: 9px; line-height: 1.45; color: var(--doc-ink);
  margin: 0 auto; max-width: 100%; position: relative;
}
.pdf-doc.before .name { font-size: 18px; font-weight: 600; margin-bottom: 2px; }
.pdf-doc.before .role { font-size: 10px; color: #7a7a8a; margin-bottom: 4px; }
.pdf-doc.before .contact { font-size: 8px; color: #7a7a8a; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid #ebe7e0; }
.pdf-doc.before .sec { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin: 12px 0 6px; }
.pdf-doc.before .job-h { display: flex; justify-content: space-between; font-size: 9px; font-weight: 600; margin-bottom: 1px; }
.pdf-doc.before .job-sub { font-size: 8px; color: #7a7a8a; margin-bottom: 4px; font-style: italic; }
.pdf-doc.before .b { font-size: 8.5px; padding-left: 10px; margin-bottom: 3px; position: relative; color: #2a2a42; }
.pdf-doc.before .b::before { content: "•"; position: absolute; left: 2px; }
.pdf-doc.before .b.weak { background: rgba(163, 38, 28, 0.06); border-radius: 2px; padding-left: 12px; }

.pdf-doc.after { display: grid; grid-template-columns: 30% 1fr; gap: 16px; padding: 0; min-height: 100%; }
.pdf-doc.after .sidebar { background: #1a1a2e; color: #fff; padding: 32px 18px; }
.pdf-doc.after .sidebar .name { font-size: 13px; font-weight: 700; margin-bottom: 2px; letter-spacing: -0.01em; }
.pdf-doc.after .sidebar .role { font-size: 8px; color: rgba(255,255,255,0.7); margin-bottom: 14px; }
.pdf-doc.after .sidebar .sec { font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #E85D24; margin: 14px 0 5px; padding-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,0.15); }
.pdf-doc.after .sidebar .item { font-size: 7.5px; line-height: 1.5; margin-bottom: 2px; color: rgba(255,255,255,0.85); }
.pdf-doc.after .sidebar .skill { display: flex; justify-content: space-between; font-size: 7.5px; margin-bottom: 3px; color: rgba(255,255,255,0.85); }
.pdf-doc.after .main { padding: 32px 36px 32px 8px; }
.pdf-doc.after .main .sec { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin: 10px 0 5px; color: #1a1a2e; }
.pdf-doc.after .main .sec:first-child { margin-top: 0; }
.pdf-doc.after .main .job-h { display: flex; justify-content: space-between; font-size: 9px; font-weight: 600; margin-bottom: 1px; }
.pdf-doc.after .main .job-sub { font-size: 8px; color: #7a7a8a; margin-bottom: 4px; }
.pdf-doc.after .main .b { font-size: 8.5px; padding-left: 10px; margin-bottom: 3px; position: relative; }
.pdf-doc.after .main .b::before { content: "■"; position: absolute; left: 2px; color: #E85D24; font-size: 5px; top: 4px; }
.pdf-doc.after .main .b mark { background: rgba(31, 122, 77, 0.12); color: #1f7a4d; padding: 0 2px; border-radius: 2px; font-weight: 600; }
.pdf-doc.after .main .summary { font-size: 8.5px; color: #4a4a5e; margin-bottom: 8px; line-height: 1.5; }

/* Single-column preview shared by Classic + Minimal — kills the two-column
   grid the .pdf-doc.after default applies, then templates differ on
   typography below. The PDF renderer uses serif Times for Classic and a
   spacious sans for Minimal; the preview echoes that with web fonts. */
.pdf-doc.after.classic, .pdf-doc.after.minimal { display: block; padding: 28px 32px; }
.pdf-doc.after .single .hdr { margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #ebe7e0; }
.pdf-doc.after .single .hdr .name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; color: #1a1a2e; margin-bottom: 2px; }
.pdf-doc.after .single .hdr .role { font-size: 10px; color: #4a4a5e; margin-bottom: 4px; }
.pdf-doc.after .single .hdr .contact { font-size: 8px; color: #7a7a8a; }
.pdf-doc.after .single .sec {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: #1a1a2e; margin: 12px 0 4px;
}
.pdf-doc.after .single .summary { font-size: 8.5px; color: #4a4a5e; margin-bottom: 6px; line-height: 1.5; }
.pdf-doc.after .single .job-h { display: flex; justify-content: space-between; font-size: 9px; font-weight: 600; margin-bottom: 1px; }
.pdf-doc.after .single .b { font-size: 8.5px; padding-left: 10px; margin-bottom: 3px; position: relative; color: #2a2a42; }
.pdf-doc.after .single .b::before { content: "•"; position: absolute; left: 2px; color: #4a4a5e; }

/* Classic: serif headings, traditional rule under header. */
.pdf-doc.after.classic { font-family: "Times New Roman", Times, serif; }
.pdf-doc.after.classic .single .hdr .name { font-family: "Times New Roman", Times, serif; }
.pdf-doc.after.classic .single .sec { font-family: "Times New Roman", Times, serif; letter-spacing: 0.1em; }

/* Minimal: airier whitespace, thinner rules, wider tracking on section heads. */
.pdf-doc.after.minimal { padding: 36px 40px; }
.pdf-doc.after.minimal .single .hdr { border-bottom: none; padding-bottom: 0; margin-bottom: 18px; }
.pdf-doc.after.minimal .single .hdr .name { font-weight: 600; }
.pdf-doc.after.minimal .single .sec {
  font-weight: 600; letter-spacing: 0.15em; color: #6a6a7e;
  margin: 18px 0 6px; border-bottom: 1px solid #ebe7e0; padding-bottom: 4px;
}
.pdf-doc.after.minimal .single .b::before { content: "—"; color: #8a8a9e; }

.result-actions {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 20px 24px;
}
.result-actions .primary { flex: 0 0 auto; }
.result-actions .secondary { display: flex; gap: 8px; align-items: center; }
.result-actions .spacer { flex: 1; }
.result-actions .filemeta { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }

/* ---------- Refine modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(13, 13, 24, 0.55);
  backdrop-filter: blur(4px); z-index: 50;
  display: grid; place-items: center; padding: 20px;
  animation: fadein 0.2s ease;
}
/* The HTML `hidden` attribute is silently overridden by `display: grid`
   above, leaving the backdrop intercepting clicks across the page even
   when the modal isn't on screen. Restore the intent. */
.modal-backdrop[hidden] { display: none; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 16px; width: 100%; max-width: 520px;
  box-shadow: var(--shadow-lg); padding: 28px 28px 24px;
  animation: pop 0.2s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { margin: 0 0 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }
.modal .modal-lead { font-size: 14px; color: var(--ink-2); margin: 0 0 18px; line-height: 1.5; }
.modal textarea {
  width: 100%; min-height: 120px; resize: vertical;
  background: var(--bg); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 12px 14px; font-family: inherit;
  font-size: 14px; color: var(--ink); line-height: 1.5;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.modal textarea:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
.modal-meta { margin-top: 8px; font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; align-items: center; }
.modal-actions { margin-top: 20px; display: flex; gap: 10px; justify-content: flex-end; }

/* Suggestion chips */
.refine-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.refine-chip {
  font-size: 12px; color: var(--ink-2); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 10px; cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.refine-chip:hover { border-color: var(--ink-3); color: var(--ink); }

/* Out-of-attempts */
.refine-banner.depleted { border-color: var(--line); opacity: 0.8; }
.refine-banner.depleted h4 { color: var(--ink-3); }

/* ---------- Dev nav ---------- */
.devnav {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff;
  border-radius: 999px; padding: 6px;
  display: flex; gap: 2px; z-index: 100;
  box-shadow: var(--shadow-lg); font-size: 12px; font-weight: 500;
}
[data-theme="dark"] .devnav { background: #232333; border: 1px solid var(--line); }
.devnav button {
  background: transparent; color: rgba(255,255,255,0.6); border: none;
  padding: 7px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 500; letter-spacing: -0.005em;
  font-family: inherit; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.devnav button:hover { color: #fff; }
.devnav button.active { background: var(--coral); color: #fff; }

/* ---------- Mobile responsive ---------- */
@media (max-width: 880px) {
  .container { padding: 0 20px; }
  .topbar-meta .status-pill { display: none; }
  .hero { padding: 56px 0 40px; }
  .hero h1 { font-size: 40px !important; line-height: 1.04; }
  .hero p.subline { font-size: 16px; margin-bottom: 28px; }
  .hero-eyebrow { font-size: 12px; margin-bottom: 20px; }
  .btn-primary.btn-xl { padding: 16px 24px; font-size: 15px; width: 100%; }
  .hero-cta-row { width: 100%; }
  .hero-cta-row .btn-primary { width: 100%; }
  .trust-row { grid-template-columns: 1fr; margin-top: 40px; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-arrow { width: 100%; height: 40px; border-left: none; border-right: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .compare-arrow svg { transform: rotate(90deg); }
  .steps { grid-template-columns: 1fr; gap: 28px; }
  .steps::before { display: none; }
  .upload-grid { grid-template-columns: 1fr; }
  .compare-pdfs { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .section h2 { font-size: 26px; }
  .pdf-pane-body { max-height: 480px; padding: 16px; }
  .upload-zone { min-height: 320px; padding: 24px; }
  .result-head .timer { font-size: 12px; padding: 8px 12px; }
  .result-actions { padding: 16px; }
  .result-actions .primary, .result-actions .primary .btn { width: 100%; }
  .result-actions .primary { width: 100%; }
  .result-actions .secondary { width: 100%; justify-content: stretch; }
  .result-actions .secondary .btn { flex: 1; }
  .result-actions .spacer, .result-actions .filemeta { display: none; }
  .footer { margin-top: 48px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .devnav { font-size: 11px; bottom: 12px; }
  .devnav button { padding: 6px 10px; font-size: 11px; }
  .processing-card { padding: 28px 20px; }
  .processing-card h1 { font-size: 22px; }
  .modal { padding: 22px 20px 18px; }
  .refine-banner { padding: 12px; }
  .refine-banner .left { width: 100%; }
}

@media (max-width: 480px) {
  .topbar-inner { height: 56px; }
  .logo { font-size: 15px; }
  .lang-toggle .label { display: none; }
  .lang-toggle { padding: 6px 8px; }
  .hero h1 { font-size: 34px !important; }
  .pdf-thumbnail { width: 180px; }
  .compare-side { padding: 22px 18px; }
  .upload-page h1 { font-size: 26px; }
}

/* ── Print stylesheet ───────────────────────────────────────────────
   When the user prints /result the deliverable is the in-page resume
   preview, not the navbar + refine chrome. Audit 2026-06-21 T5-48
   caught nav/header bleeding into prints. Keep this rule list tight —
   anything not explicitly hidden here prints by default. */
@media print {
    .topbar, .footer, .result-actions,
    .improvements, .refine-card, .dl-bar,
    .modal-backdrop, #rh-expiry-warn, .theme-toggle,
    .status-pill {
        display: none !important;
    }
    body { background: #fff !important; }
    .result-head .timer { display: none; }
    /* Keep the preview pane visible and span both columns when printing. */
    .compare-pdfs { grid-template-columns: 1fr !important; }
    .compare-pdfs .pdf-pane:first-child { display: none; }
}

/* ── Secondary "Download as Word (.docx)" CTA ──────────────────────
   Promoted from a faded right-aligned text link to a visible
   secondary button per user feedback. Blue palette so it doesn't
   compete with the orange PDF primary CTA; subtle pulse-glow
   animation so it's discoverable without being tacky. */
.dl-bar-secondary {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
}
.btn-docx-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2c5cff 0%, #4a8bff 60%, #1f9bff 100%);
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    letter-spacing: 0.1px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(44, 92, 255, 0.32),
                0 1px 2px rgba(44, 92, 255, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-position 0.4s ease;
}
.btn-docx-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 20px rgba(44, 92, 255, 0.45),
                0 2px 4px rgba(44, 92, 255, 0.22);
    background: linear-gradient(135deg, #1f44e6 0%, #2c5cff 60%, #0a87f5 100%);
}
.btn-docx-cta:active { transform: translateY(0); }
.btn-docx-cta:focus-visible {
    outline: 3px solid rgba(74, 139, 255, 0.45);
    outline-offset: 2px;
}
.btn-docx-cta .btn-docx-content {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.btn-docx-cta .btn-docx-icon,
.btn-docx-cta .btn-docx-arrow {
    display: inline-flex;
    align-items: center;
}
.btn-docx-cta .btn-docx-arrow { opacity: 0.85; }

/* Pulse-glow ring — sits behind the button content and breathes. */
.btn-docx-cta .btn-docx-pulse {
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    background: radial-gradient(60% 80% at 50% 50%,
                rgba(120, 170, 255, 0.55) 0%,
                rgba(44, 92, 255, 0.0) 70%);
    z-index: 1;
    pointer-events: none;
    animation: btn-docx-breathe 2.4s ease-in-out infinite;
}
@keyframes btn-docx-breathe {
    0%, 100% { opacity: 0.4; transform: scale(0.96); }
    50%      { opacity: 0.95; transform: scale(1.06); }
}

/* Subtle sheen swipe across the surface every few seconds. */
.btn-docx-cta::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    left: -40%;
    width: 30%;
    background: linear-gradient(120deg,
                rgba(255, 255, 255, 0.0) 0%,
                rgba(255, 255, 255, 0.35) 50%,
                rgba(255, 255, 255, 0.0) 100%);
    transform: skewX(-15deg);
    z-index: 1;
    pointer-events: none;
    animation: btn-docx-sheen 5s ease-in-out infinite;
}
@keyframes btn-docx-sheen {
    0%    { left: -40%; }
    35%   { left: 130%; }
    100%  { left: 130%; }
}

/* Reduced-motion users — disable the animations, keep the gradient. */
@media (prefers-reduced-motion: reduce) {
    .btn-docx-cta .btn-docx-pulse,
    .btn-docx-cta::after {
        animation: none;
    }
    .btn-docx-cta .btn-docx-pulse { opacity: 0.5; }
}

/* Print: hide entirely with the rest of the chrome. */
@media print {
    .btn-docx-cta, .dl-bar-secondary { display: none !important; }
}

/* ── ATS compatibility badges (tier-colored) ──────────────────────
   Surfaced on /result by the AtsScoring pass. Tier classes:
     ats-high      85-100  green
     ats-compliant 65-84   blue
     ats-friendly  45-64   amber
     ats-low       0-44    neutral
   The badge inherits .imp-badge layout; these classes only change
   the palette so the claim is honest and the tier is at-a-glance. */
.ats-badge { font-weight: 600; }
.ats-badge .ats-badge-score {
    font-weight: 500;
    opacity: 0.78;
    margin-left: 2px;
}
.ats-badge.ats-high {
    background: linear-gradient(135deg, #d6f7e3 0%, #b9f0d0 100%);
    color: #0f5d34;
    border: 1px solid #82e0a9;
}
.ats-badge.ats-compliant {
    background: linear-gradient(135deg, #e0ecff 0%, #c8dcff 100%);
    color: #1b3a8a;
    border: 1px solid #8eb4ff;
}
.ats-badge.ats-friendly {
    background: linear-gradient(135deg, #fff2d6 0%, #ffe6b0 100%);
    color: #6b4400;
    border: 1px solid #f3c87a;
}
.ats-badge.ats-low {
    background: linear-gradient(135deg, #efeff3 0%, #e3e3eb 100%);
    color: #4a4a55;
    border: 1px solid #c4c4cf;
}

/* ── Template picker polish (Jun 2026) ──────────────────────────────
   Upload-page picker was showing raw enum names + a generic "general"
   tag → unhelpful. Subtitle + tag treatment cleaned up to read as a
   product-facing card not an internal config dump. */
.tpl-layout-hint {
    font-size: 12px !important;
    color: var(--ink-secondary, #586374) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.4;
    margin: 2px 0 6px;
}
.tpl-card .tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.tpl-card .tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f3f7;
    color: #3a4250;
    border: 1px solid #e3e6ed;
    text-transform: capitalize;
}
.tpl-card .tag.tag-font {
    background: #fef2e6;
    color: #8a4b00;
    border-color: #f5c987;
    font-family: ui-monospace, "Geist Mono", monospace;
    text-transform: lowercase;
}
.tpl-swatch {
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.5);
}

/* ── Credit-pack picker (tokenized; replaces the inline-styled version) ───────── */
.plans { border: 1px solid var(--line); background: var(--bg-card); border-radius: var(--radius-md); padding: 16px 18px; margin: 0 0 24px; }
.plans-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.plans-head h3 { margin: 0; font-size: 16px; color: var(--ink); }
.plans-head p { margin: 0; color: var(--ink-3); font-size: 13px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.plan-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.plan-name { font-weight: 600; font-size: 15px; color: var(--ink); }
.plan-credits { color: var(--ink-3); font-size: 13px; }
.plan-price { font-size: 20px; font-weight: 700; margin: 2px 0; color: var(--ink); }
.plans .rh-buy { width: 100%; justify-content: center; min-height: 44px; }
.plans-empty, .plans-noscript { color: var(--ink-3); font-size: 13px; margin: 8px 0 0; }
.plans-error { margin-top: 10px; color: var(--bad); font-size: 13px; }

/* Credits balance chip in the topbar (links to the buy page) */
.credits-pill { text-decoration: none; color: var(--ink); font-weight: 600; }
.credits-pill:hover { border-color: var(--accent); }
/* Keep the credits chip visible on mobile even though the status pill hides (same specificity, later = wins) */
.topbar-meta .credits-pill { display: inline-flex; }
