:root {
  --bg: #f6f7f9;
  --card: #fff;
  --ink: #16181d;
  --muted: #6b7280;
  --line: #e3e6ea;
  --accent: #1f6feb;
  --ok: #0f7b41;
  --warn: #a1520a;
  --danger: #b4232a;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
main { max-width: 900px; margin: 0 auto; padding: 20px 16px 80px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 8px; }
a { color: var(--accent); }
code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 10px 16px; position: sticky; top: 0; z-index: 20;
}
.brand { font-weight: 700; text-decoration: none; color: var(--ink); }
.topbar nav { display: flex; gap: 14px; }
.topbar nav a { text-decoration: none; color: var(--muted); padding: 4px 2px; }
.topbar nav a.on { color: var(--ink); border-bottom: 2px solid var(--accent); }
.topbar .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { color: var(--muted); font-size: 13px; }

.flash {
  background: #e7f3ff; border: 1px solid #b9dbff; color: #0b4f9e;
  padding: 10px 12px; border-radius: var(--radius); margin-bottom: 16px;
}

/* ---- buttons ---- */
button, .btn {
  font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; padding: 8px 14px; color: var(--ink); text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { border-color: #c7ccd3; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { background: #175bc4; }
button.primary:disabled { background: #b7c6dd; border-color: #b7c6dd; cursor: not-allowed; }
button.big { padding: 12px 22px; font-size: 16px; }
button.small, .btn.small { padding: 4px 10px; font-size: 13px; }
button.link {
  border: 0; background: none; color: var(--accent); padding: 2px 4px; text-decoration: underline;
}
button.danger, button.link.danger { color: var(--danger); }

/* ---- login ---- */
.login { max-width: 340px; margin: 12vh auto; background: #fff; padding: 28px;
  border: 1px solid var(--line); border-radius: var(--radius); }
.login label { display: block; margin: 14px 0; font-size: 13px; color: var(--muted); }
.login input { width: 100%; padding: 9px 10px; font: inherit; border: 1px solid var(--line);
  border-radius: 8px; margin-top: 4px; }
.login button { width: 100%; margin-top: 8px; }

/* ---- progress ---- */
.progress-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 16px; }
.progress-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.progress-head strong { font-size: 19px; }
.progress { display: flex; gap: 4px; }
.progress .seg { flex: 1; height: 10px; background: #e8ebef; border-radius: 3px; overflow: hidden; }
.progress .seg b { display: block; height: 100%; background: var(--ok); }

/* ---- batch bar ---- */
.batch-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.batch-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.batch-actions .small { max-width: 340px; }
.signup-note { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; margin: 0 0 16px; }
.signup-note.warn { background: #fff6e9; border-color: #f0d5a8; color: var(--warn); }

/* ---- report card ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; }
.card.done { opacity: .72; }
.card.done:hover { opacity: 1; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 4px; }
.card-head-right { display: flex; align-items: center; gap: 8px; }
.domain { font-weight: 700; font-size: 16px; margin-right: 8px; }
.meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.locked { background: #fff6e9; padding: 8px 10px; border-radius: 8px; }

.badge { font-size: 12px; padding: 2px 8px; border-radius: 20px; background: #eef1f5; color: var(--muted); }
.badge.ok { background: #e4f6ea; color: var(--ok); }
.badge.todo { background: #fdeceb; color: var(--danger); }

fieldset.q { border: 0; padding: 12px 0 4px; margin: 0; border-bottom: 1px solid #f0f2f5; }
fieldset.q:last-of-type { border-bottom: 0; }
fieldset.q legend, .q.sub strong { font-weight: 600; font-size: 14px; padding: 0; }
fieldset.q.important { background: #fbfcfe; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }

.opts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.opts.stack { flex-direction: column; }
.opt { display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 11px;
  font-size: 14px; }
.opt:hover { border-color: #c7ccd3; background: #fafbfc; }
.opt input { margin: 0; }
.opt:has(input:checked) { border-color: var(--accent); background: #eff6ff; }
.opt.wide { align-items: flex-start; }
.opt.wide em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }

.reveal { margin: 8px 0 0; }
.reveal[hidden] { display: none; }
.q.sub { background: #f4f7fb; border-left: 3px solid var(--accent); padding: 10px 12px;
  border-radius: 0 8px 8px 0; border-bottom: 0; }

label.text { display: block; font-size: 13px; color: var(--muted); margin-top: 8px; }
label.text input { display: block; width: 100%; padding: 8px 10px; font: inherit;
  border: 1px solid var(--line); border-radius: 8px; margin-top: 3px; color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }
textarea { width: 100%; padding: 9px 10px; font: inherit; border: 1px solid var(--line);
  border-radius: 8px; resize: vertical; }

.card-foot { display: flex; align-items: center; gap: 12px; padding-top: 14px; }
.missing { font-size: 13px; color: var(--danger); }
.skip { margin-top: 10px; display: flex; gap: 8px; align-items: center; }
.skip select { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; }
.next-batch { display: flex; gap: 12px; align-items: center; margin-top: 8px; }

.empty { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px; text-align: center; }

/* ---- tables ---- */
table.grid { width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.grid th { text-align: left; font-size: 12px; text-transform: uppercase;
  letter-spacing: .03em; color: var(--muted); padding: 9px 10px; background: #fafbfc;
  border-bottom: 1px solid var(--line); }
table.grid td { padding: 9px 10px; border-bottom: 1px solid #f0f2f5; vertical-align: top; }
table.grid tr:last-child td { border-bottom: 0; }
form.inline { display: inline; }
form.inline select { font: inherit; font-size: 13px; padding: 3px 6px;
  border: 1px solid var(--line); border-radius: 6px; }

/* ---- admin ---- */
.funnel { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.pill { display: flex; flex-direction: column; align-items: center; min-width: 84px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 10px; text-decoration: none; color: var(--ink); }
.pill.on { border-color: var(--accent); background: #eff6ff; }
.pill b { font-size: 18px; }
.pill span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.admin-bar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.search { display: flex; gap: 6px; }
.search input { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.chip { display: inline-block; background: #eef1f5; border-radius: 20px; padding: 2px 9px;
  font-size: 12px; margin-right: 5px; }
.pager { display: flex; gap: 14px; align-items: center; margin-top: 14px; }

.upload { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; }
.upload label { display: block; font-weight: 600; font-size: 14px; margin-top: 14px; }
.upload label:first-child { margin-top: 0; }
.upload textarea { margin-top: 6px; }
.upload label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.import-report { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 18px; }
.import-report details { margin: 8px 0; }
.import-report summary { cursor: pointer; }

@media (max-width: 640px) {
  .two { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px; }
}

/* ---- copy review ---- */
table.grid.copy-review td { vertical-align: top; }
textarea.copy-line { width: 100%; min-height: 48px; font: inherit; line-height: 1.45;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
textarea.copy-line:focus { border-color: var(--accent); outline: none; }
textarea.copy-line.saved { border-color: var(--ok); }
textarea.copy-line.save-failed { border-color: var(--danger); }
.alt { margin-top: 4px; }

/* ---- contacts ---- */
.candidate { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
.candidate .muted { font-size: 12px; }
tr.needs-pick td { background: #fff9ec; }

/* ---- verification, push, QA (phases 7-9) ---- */
/* The dry-run payload. Monospaced and scrollable rather than wrapped: this is the exact
   JSON that would go over the wire, and a re-wrapped preview is a different thing. */
pre.preview { background: #f6f8fa; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px; font-size: 12px; line-height: 1.5; overflow-x: auto; max-height: 420px; }
input.small { font: inherit; font-size: 13px; padding: 4px 7px; border: 1px solid var(--line);
  border-radius: 8px; max-width: 180px; }

/* The hand-entered contact form: one row that wraps on a phone rather than a grid,
   because it is five short fields and a button. */
form.manual { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.manual select { font: inherit; font-size: 13px; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 8px; }
