:root {
  --ink: #1a1f36;
  --muted: #5a6178;
  --line: #e2e5ee;
  --brand: #1f6feb;
  --brand-dark: #1858c4;
  --bg: #f6f7fb;
  --warn-bg: #fff4e0;
  --warn-ink: #8a5a00;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-top: 16px;
  padding-bottom: 16px;
}
.logo { font-weight: 700; font-size: 20px; }
.logo-sub { color: var(--muted); }

main.wrap { padding-top: 32px; padding-bottom: 64px; }

h1 { font-size: 28px; margin: 0 0 8px; }
h2 { font-size: 22px; margin: 0 0 8px; }
h3 { font-size: 18px; margin: 0 0 6px; }

.lead { color: var(--muted); margin: 0 0 24px; }

fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin: 0 0 16px;
  background: #fff;
}
legend { font-weight: 600; padding: 0 6px; }

.field { display: block; margin: 0 0 14px; }
.field:last-child { margin-bottom: 0; }
.field > span { display: block; font-weight: 500; margin-bottom: 6px; }

input[type="file"],
input[type="email"],
select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.btn {
  display: inline-block;
  padding: 12px 20px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary {
  background: #fff;
  color: var(--brand);
  border: 1px solid var(--brand);
}
.btn:disabled { opacity: 0.5; cursor: default; }

.disclaimer, .cta-ack { color: var(--muted); font-size: 14px; margin-top: 12px; }

.field-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.field-check input { width: auto; margin-top: 3px; }
.field-check span { font-weight: 400; }

.delivery-note {
  background: #eef4ff;
  border: 1px solid #cfe0ff;
  color: #1a3a6b;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin: 0 0 16px;
}
#qualitative { font-size: 17px; }

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-top: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-track {
  width: 100%;
  height: 14px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.progress-pct {
  margin-top: 8px;
  font-weight: 600;
  color: var(--muted);
}

.sample-banner {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border: 1px solid #f0d9b0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  margin-bottom: 16px;
}

.preview-counts {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}
.count-card {
  flex: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.count-num { display: block; font-size: 32px; font-weight: 700; color: var(--brand); }
.count-label { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }

.preview-categories { list-style: none; padding: 0; margin: 0 0 16px; }
.preview-categories li {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 6px;
}
.cat-count { font-weight: 700; color: var(--brand); }

/* Full report */
.report-heading { margin: 0 0 10px; font-size: 18px; }
.sub-heading { margin: 16px 0 8px; font-size: 15px; color: var(--muted); }
.section-summary { margin: 0 0 12px; color: var(--muted); }

.fact-list, .spaced-list { padding: 0; margin: 0; }
.fact-list { list-style: none; }
.fact-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.fact-list li:last-child { border-bottom: 0; }
.fact-key { color: var(--muted); }
.fact-val { text-align: right; font-weight: 500; }

.spaced-list { padding-left: 20px; }
.spaced-list li { margin-bottom: 8px; }

.finding, .must-know-item, .term-item {
  border-left: 3px solid var(--line);
  padding: 8px 0 8px 12px;
  margin-bottom: 12px;
}
.finding-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.finding-what { font-weight: 600; }
.finding-pages { color: var(--muted); font-size: 13px; white-space: nowrap; }
.finding-why { margin: 4px 0; }
.finding-ask { margin: 4px 0; color: var(--ink); font-style: italic; }
.finding-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.muted-note { color: var(--muted); }

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef1f8;
  color: var(--muted);
}
.tag-found { background: #e6f4ea; color: #1e7a3c; }
.tag-not_found { background: #fdf2e0; color: #8a5a00; }
.tag-inconsistent { background: #fdecec; color: #a11; }
.tag-not_read { background: #eee; color: #555; }
.tier { font-size: 12px; color: var(--muted); text-transform: capitalize; }

.report-footnote { background: #fafbfe; }
.report-footnote .disclaimer { margin-top: 10px; font-size: 13px; }

/* At a glance — the headline block at the top of the report */
.at-a-glance { border: 2px solid var(--brand); }
.glance-where {
  margin: 0 0 4px;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.glance-headline {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}
.what-decides-it {
  margin: 8px 0 4px;
  padding-left: 28px;
}
.what-decides-it li {
  margin-bottom: 12px;
  font-size: 18px;
  line-height: 1.45;
}
.what-decides-it .wd-line { font-weight: 500; }
.what-decides-it .wd-pages {
  display: inline-block;
  margin-left: 8px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}

.unlock-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  background: #fff;
  margin-top: 24px;
}

.report-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
  margin-bottom: 14px;
}
.report-section h3 { margin-bottom: 4px; }
.report-section p { margin: 0; color: var(--ink); }

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.error {
  background: #fdecec;
  color: #a11;
  border: 1px solid #f4c4c4;
  border-radius: 8px;
  padding: 12px;
  margin-top: 20px;
}
