:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --border: #d9dde1;
  --text: #1c2024;
  --muted: #60676f;
  --accent: #1f4e8c;
  --good: #1d6b3f;
  --warn: #8a5a00;
  --bad: #9b2c2c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 600; }
.meta { color: var(--muted); font-size: 13px; }

main { max-width: 1080px; margin: 24px auto; padding: 0 24px 48px; }

form { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; }
@media (max-width: 800px) { form { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
}

label { display: block; font-weight: 600; margin-bottom: 8px; }

textarea {
  width: 100%;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
  color: inherit;
}
textarea:focus, input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.file-list { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; }
.file-list li { display: flex; justify-content: space-between; padding: 4px 0; border-top: 1px solid var(--border); }
.file-list .size { color: var(--muted); }

button.primary {
  margin-top: 14px;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 4px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.primary:disabled { opacity: 0.6; cursor: progress; }

.error { color: var(--bad); font-size: 14px; margin: 10px 0 0; }

#results { margin-top: 32px; }
.results-head { display: flex; justify-content: space-between; align-items: baseline; }
.results-head h2 { margin: 0 0 8px; font-size: 16px; }

.job-profile { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.notices { list-style: none; margin: 0 0 10px; padding: 0; font-size: 13px; }
.notices li { padding: 6px 10px; margin-bottom: 4px; background: #fff8e6; border: 1px solid #ecd9a6; border-radius: 4px; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: #fafbfb; }
.col-rank { width: 40px; }
.col-score { width: 240px; }
.col-toggle { width: 120px; white-space: nowrap; }

.score { display: flex; align-items: center; gap: 10px; }
.bar { flex: 1; height: 8px; background: #e6e9ec; border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.score .value { width: 38px; text-align: right; font-variant-numeric: tabular-nums; }

.badge { font-weight: 600; font-size: 13px; }
.badge.shortlist { color: var(--good); }
.badge.maybe { color: var(--warn); }
.badge.reject { color: var(--bad); }

.link-button { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.link-button:hover { text-decoration: underline; }

tr.details td { background: #fafbfb; padding: 14px 16px 18px; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; }
@media (max-width: 800px) { .details-grid { grid-template-columns: 1fr; } }
.details h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.details ul { margin: 0; padding-left: 18px; }
.details p { margin: 0; }
.span-2 { grid-column: 1 / -1; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 2px 8px; border: 1px solid var(--border); border-radius: 3px; background: var(--surface); font-size: 13px; }
.chip.matched { border-color: #9cc5ae; color: var(--good); }
.chip.missing { border-color: #d9a8a8; color: var(--bad); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.mode-banner { padding: 8px 12px; margin-bottom: 10px; border-radius: 4px; font-size: 13px; border: 1px solid; }
.mode-banner.llm { background: #eaf5ee; border-color: #9cc5ae; color: var(--good); }
.mode-banner.fallback { background: #fff8e6; border-color: #ecd9a6; color: var(--warn); }
.tag { font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 3px; border: 1px solid; white-space: nowrap; }
.tag.llm { color: var(--good); border-color: #9cc5ae; }
.tag.fallback { color: var(--warn); border-color: #ecd9a6; }

.evidence { width: 100%; font-size: 13px; border: 0; background: none; }
.evidence td { padding: 4px 8px 4px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.evidence q { color: var(--muted); }
.status { font-weight: 600; white-space: nowrap; }
.status.met { color: var(--good); }
.status.partial, .status.unverified { color: var(--warn); }
.status.not_found { color: var(--bad); }
.details ol { margin: 0; padding-left: 20px; }
.details li + li { margin-top: 4px; }

.ask { margin-top: 24px; }
.ask h2 { margin: 0 0 10px; font-size: 16px; }
.ask-row { display: flex; gap: 10px; }
.ask-row input { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; font: inherit; }
.ask-row button { margin-top: 0; }
.ask-answer { margin: 4px 0 10px; }
.citations { margin: 0; padding-left: 22px; font-size: 13px; color: var(--muted); }
.citations li { margin-bottom: 4px; }
.citations strong { color: var(--text); }
