:root {
  --navy: #132c67;
  --blue: #214f9b;
  --blue-light: #eaf1ff;
  --ink: #192235;
  --muted: #687287;
  --line: #dce3ef;
  --page: #f5f7fb;
  --white: #ffffff;
  --green: #1e7d53;
  --green-bg: #eaf7f0;
  --amber: #9b5a00;
  --amber-bg: #fff3df;
  --red: #a23838;
  --red-bg: #fff0f0;
  --purple: #6a45a7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
  line-height: 1.5;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.site-header {
  background: linear-gradient(135deg, #10265d 0%, #214f9b 100%);
  color: white;
  padding: 28px 20px;
  border-bottom: 4px solid #f0c45c;
}
.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}
.site-header h1 { margin: 2px 0 4px; font-size: clamp(1.75rem, 4vw, 2.45rem); line-height: 1.12; }
.tagline { margin: 0; color: #e5ebfa; max-width: 720px; }
.eyebrow { margin: 0 0 4px; font-size: .73rem; letter-spacing: .14em; font-weight: 800; color: var(--blue); }
.site-header .eyebrow { color: #f4d37b; }
.privacy-pill { white-space: nowrap; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1); border-radius: 999px; padding: 8px 13px; font-size: .78rem; }

.container { max-width: 1120px; margin: 0 auto; padding: 22px 18px 48px; }
.panel, .intro-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(31, 55, 92, .06);
}
.panel { padding: 22px; }
.intro-card { padding: 18px 22px; display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 18px; }
.intro-card h2, .panel h2 { margin: 0; color: var(--navy); }
.intro-card p { margin: 5px 0 0; color: var(--muted); max-width: 700px; font-size: .92rem; }
.step-row { display: flex; gap: 9px; flex-wrap: wrap; }
.step-row span { background: #f4f7fc; border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; font-size: .78rem; white-space: nowrap; }
.step-row b { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 4px; border-radius: 50%; background: var(--navy); color: white; font-size: .68rem; }

.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.input-card { min-width: 0; }
.input-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.input-heading > div { display: flex; align-items: center; gap: 9px; }
.input-heading h2 { font-size: 1.02rem; }
.step-number { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: white; font-weight: 800; font-size: .8rem; }
textarea {
  width: 100%;
  min-height: 315px;
  resize: vertical;
  padding: 13px 14px;
  color: var(--ink);
  background: #fbfcfe;
  border: 1px solid #cbd5e4;
  border-radius: 9px;
  outline: none;
}
textarea:focus, input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(33,79,155,.12); }
.input-meta { min-height: 20px; display: flex; justify-content: space-between; gap: 12px; margin-top: 5px; color: #8791a3; font-size: .73rem; }
.file-button { color: var(--blue); background: var(--blue-light); border: 1px solid #cfdef8; padding: 6px 9px; border-radius: 7px; font-size: .76rem; font-weight: 700; cursor: pointer; }
.file-button:hover { background: #dfeaff; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

.url-loader { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fbfcfe; }
.url-loader summary { color: var(--blue); cursor: pointer; font-size: .8rem; font-weight: 700; }
.url-row { display: flex; gap: 8px; margin-top: 9px; }
.url-row input { flex: 1; min-width: 0; }
input[type="text"], input[type="url"], input[type="number"] { border: 1px solid #cbd5e4; border-radius: 8px; background: #fff; color: var(--ink); padding: 9px 10px; outline: none; }
.hint { color: #8a94a7; font-size: .73rem; margin: 6px 0 0; }

.compare-options { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 2fr .75fr; gap: 14px; }
.compare-options label { display: grid; gap: 6px; color: #4d586d; font-size: .78rem; font-weight: 700; }
.compare-options small { font-weight: 500; color: #8c96a8; }
.main-actions { margin-top: 16px; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; }
button { border-radius: 8px; border: 1px solid var(--navy); padding: 10px 16px; font-weight: 750; transition: .15s ease; }
button.primary { color: white; background: var(--blue); }
button.primary:hover { background: var(--navy); transform: translateY(-1px); }
button.secondary { color: var(--blue); background: white; border-color: #b9c8df; }
button.secondary:hover { background: #f1f5fc; }
button.small { padding: 7px 10px; font-size: .76rem; }
button:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
.form-error { min-height: 18px; margin: 8px 0 0; color: var(--red); font-size: .82rem; font-weight: 650; }

.results { display: grid; gap: 18px; margin-top: 18px; }
.hidden { display: none !important; }
.score-panel { padding: 26px; }
.score-wrap { display: grid; grid-template-columns: auto 1fr; gap: 25px; align-items: center; }
.score-ring {
  --size: 150px;
  --score: 0;
  width: var(--size); height: var(--size); border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--blue) calc(var(--score) * 1%), #e8edf5 0);
  position: relative;
}
.score-ring::after { content: ""; position: absolute; inset: 11px; background: white; border-radius: 50%; }
.score-inner { position: relative; z-index: 1; display: grid; text-align: center; }
.score-inner strong { font-size: 2.25rem; line-height: 1; color: var(--navy); }
.score-inner span { color: var(--muted); font-size: .72rem; margin-top: 5px; }
.score-copy h2 { font-size: 1.55rem; }
.score-copy > p:not(.eyebrow):not(.disclaimer) { margin: 6px 0 8px; color: #455169; }
.disclaimer { margin: 0; color: #8c95a6; font-size: .7rem; }
.score-stats { margin-top: 22px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); padding-top: 18px; }
.score-stats > div { padding: 0 16px; border-right: 1px solid var(--line); }
.score-stats > div:first-child { padding-left: 0; }
.score-stats > div:last-child { border-right: 0; }
.score-stats strong { display: block; font-size: 1.25rem; color: var(--navy); }
.score-stats span { color: var(--muted); font-size: .72rem; }

.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.section-heading.compact { align-items: center; margin-bottom: 13px; }
.section-heading h2 { font-size: 1.12rem; }
.section-help { margin: 6px 0 14px; color: var(--muted); font-size: .82rem; }
.priority-badge { background: var(--amber-bg); color: var(--amber); border-radius: 999px; padding: 6px 9px; font-size: .7rem; font-weight: 750; white-space: nowrap; }
.count-badge { min-width: 28px; text-align: center; padding: 3px 8px; border-radius: 999px; background: #eff3f9; color: var(--navy); font-size: .75rem; font-weight: 800; }
.two-column-results { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 30px; }
.chip { border-radius: 999px; padding: 7px 10px; font-size: .77rem; font-weight: 700; border: 1px solid; }
.chip.matched { color: var(--green); background: var(--green-bg); border-color: #c6e9d7; }
.chip.missing { color: var(--red); background: var(--red-bg); border-color: #f0caca; }
.chip.priority { color: var(--amber); background: var(--amber-bg); border-color: #f1d8ae; }
.empty-message { margin: 0; color: #8c96a8; font-size: .8rem; font-style: italic; }

.skill-columns { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.skill-columns h3 { margin: 0 0 9px; font-size: .86rem; color: #49566d; }
.skill-list { display: grid; gap: 7px; }
.skill-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; border-bottom: 1px solid #edf0f5; padding: 7px 0; font-size: .8rem; }
.skill-row:last-child { border-bottom: none; }
.skill-status { border-radius: 999px; padding: 3px 7px; font-size: .66rem; font-weight: 800; }
.skill-status.yes { color: var(--green); background: var(--green-bg); }
.skill-status.no { color: var(--red); background: var(--red-bg); }

.recommendations { margin: 14px 0 0; padding-left: 24px; }
.recommendations li { padding: 7px 0 7px 4px; color: #404c61; font-size: .87rem; }
.recommendations strong { color: var(--navy); }

.output-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.output-header h2 { font-size: 1.12rem; }
.legend, .save-buttons { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.legend span { color: var(--muted); font-size: .72rem; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.matched-dot { background: var(--green); }
.missing-dot { background: var(--red); }
.cloud-meta { margin: 0 0 8px; color: #8c96a8; font-size: .73rem; }
.word-cloud { min-height: 185px; padding: 22px; display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 5px 15px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.word-cloud span { display: inline-block; line-height: 1.2; white-space: nowrap; font-family: Georgia, "Times New Roman", serif; }
.word-cloud .cloud-match { color: var(--green); }
.word-cloud .cloud-missing { color: var(--red); }
.word-cloud .cloud-count { font-size: .48em; opacity: .55; margin-left: 2px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #edf0f5; white-space: nowrap; }
th { color: var(--navy); background: #f7f9fc; font-size: .7rem; letter-spacing: .02em; }
.status-text.match { color: var(--green); font-weight: 800; }
.status-text.miss { color: var(--red); font-weight: 800; }
.priority-text { color: var(--amber); font-weight: 700; }

.site-footer { max-width: 1120px; margin: 0 auto; padding: 0 18px 32px; color: #8d96a6; font-size: .72rem; text-align: center; }

@media print {
  body { background: white; }
  .site-header, .intro-card, .input-panel, .site-footer, .save-buttons { display: none !important; }
  .container { max-width: none; padding: 0; }
  .results { display: block !important; margin: 0; }
  .panel { box-shadow: none; break-inside: avoid; margin-bottom: 16px; }
}

@media (max-width: 820px) {
  .header-inner, .intro-card { align-items: flex-start; flex-direction: column; }
  .privacy-pill { align-self: flex-start; }
  .input-grid, .two-column-results, .skill-columns { grid-template-columns: 1fr; }
  textarea { min-height: 245px; }
  .score-stats { grid-template-columns: repeat(2, 1fr); gap: 14px 0; }
  .score-stats > div:nth-child(2) { border-right: 0; }
  .score-stats > div:nth-child(3), .score-stats > div:nth-child(4) { border-top: 1px solid var(--line); padding-top: 12px; }
}

@media (max-width: 560px) {
  .container { padding-inline: 12px; }
  .panel { padding: 17px; }
  .compare-options { grid-template-columns: 1fr; }
  .score-wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .score-ring { --size: 132px; }
  .section-heading, .output-header { flex-direction: column; }
  .score-stats { grid-template-columns: 1fr 1fr; }
  .main-actions button { width: 100%; }
  .url-row { flex-direction: column; }
}

/* Side-by-side visual comparison directly below the match report */
.cloud-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.cloud-comparison .cloud-panel {
  min-width: 0;
}
.resume-only-dot { background: var(--blue); }
.word-cloud .cloud-resume-only { color: var(--blue); }
.resume-word-cloud { background: #f8fbff; }

@media (max-width: 820px) {
  .cloud-comparison { grid-template-columns: 1fr; }
}
