:root {
  /* White and blue, the same look as Autopilot SEO: white panels on a light cool ground,
     one calm blue for actions and links, pale blue for selected things, colour for status only. */
  color-scheme: light;
  --bg: #f4f7fb; --panel: #ffffff; --ink: #0f1b2e; --text: #2b3648; --muted: #5f6d82; --line: #e3e8ef;
  --field: #7f8ca0; /* 3:1 against white, so a field's edge is visible */
  --brand: #1f5fbf; --brand-hover: #194fa3; --brand-ink: #ffffff; --good: #17704a; --warn: #8a5300; --bad: #b42318;
  --good-bg: #e8f5ee; --warn-bg: #fdf3e1; --bad-bg: #fdeceb; --chip: #eaf2fd; --chip-line: #b8d2f4;
  --shadow: 0 1px 2px rgba(15, 27, 46, .04), 0 6px 20px -12px rgba(15, 27, 46, .1);
  --radius: 10px;
  accent-color: var(--brand);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 'Atkinson Hyperlegible Next', 'Segoe UI', system-ui, sans-serif; font-variant-numeric: tabular-nums; }
h1, h2, h3, b, strong, .stat b { color: var(--ink); }
a { color: var(--brand); }
.shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 100vh; }
nav { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; }
nav .logo { font-weight: 700; font-size: 16px; padding: 4px 10px 16px; color: var(--ink); }
nav button { all: unset; cursor: pointer; padding: 8px 10px; border-radius: 8px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; white-space: nowrap; }
nav button:hover { background: var(--bg); color: var(--ink); }
nav button.on { background: var(--chip); color: var(--brand); font-weight: 600; }
nav .count { background: var(--brand); color: var(--brand-ink); border-radius: 99px; padding: 0 7px; font-size: 12px; line-height: 18px; flex: none; }
nav .spacer { flex: 1; }
main { padding: 24px 28px 60px; max-width: 1150px; width: 100%; min-width: 0; overflow-wrap: break-word; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 0 0 10px; }
.sub { color: var(--muted); margin: 0 0 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; overflow-x: auto; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.stat b { display: block; font-size: 24px; }
.stat span { color: var(--muted); font-size: 13px; }
.banner { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.good { background: var(--good-bg); color: var(--good); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
button.btn, .btn { font: inherit; border: 1px solid var(--chip-line); background: var(--panel); color: var(--brand); padding: 7px 13px; border-radius: 8px; cursor: pointer; }
.btn:hover:not(:disabled) { background: var(--chip); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn:focus-visible, nav button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.danger { color: var(--bad); border-color: var(--line); }
.btn.small { padding: 3px 9px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--field); border-radius: 8px; padding: 7px 10px; width: 100%; }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.form2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--chip); color: var(--brand); font-size: 12px; white-space: nowrap; }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.muted { color: var(--muted); }
.mail { white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.msg { border-left: 3px solid var(--line); padding: 4px 0 4px 12px; margin: 12px 0; }
.msg.in { border-color: var(--brand); }
.bar { height: 6px; background: var(--chip); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--brand); }
.step { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.toast { position: fixed; bottom: 18px; right: 18px; left: auto; z-index: 10; background: var(--ink); color: var(--panel); padding: 10px 14px; border-radius: 8px; max-width: 360px; }
.login { max-width: 340px; margin: 18vh auto; }
.switch { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.switch input { width: auto; }
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  nav .logo, nav .spacer { display: none; }
  main { padding: 16px; }
  .form2 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .toast { left: 16px; right: 16px; max-width: none; }
}
.banner.info { background: var(--chip); color: var(--ink); border: 1px solid var(--chip-line); }
.banner .btn { margin-left: 6px; }
h3 { font-size: 14px; margin: 18px 0 4px; }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.good-text { color: var(--good); }
.needs .todo { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.needs .todo.alert { border-color: var(--bad); }
.needs dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 12px; margin: 8px 0; }
.needs dt { color: var(--muted); font-size: 13px; }
.needs dd { margin: 0; }
.stat .info { all: unset; cursor: pointer; width: 20px; height: 20px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; line-height: 18px; flex: none; }
.stat .info:hover, .stat .info:focus-visible { color: var(--ink); border-color: var(--muted); }
.stat .delta { font-size: 13px; color: var(--muted); }
.stat .delta.up { color: var(--good); }
.stat .delta.down { color: var(--bad); }
.stat .def { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.brain { background: var(--bg); border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.draft { border: 1px dashed var(--brand); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
details summary { cursor: pointer; color: var(--brand); font-size: 13px; }
@media (max-width: 760px) {
  .needs dl { grid-template-columns: minmax(0, 1fr); }
  .needs dt { margin-top: 4px; }
}
.needs .todo.short { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.needs .todo.short .grow { flex: 1; min-width: 0; }
.needs .todo.short .btn { flex: none; }
@media (max-width: 760px) {
  .needs .todo.short { flex-direction: column; align-items: flex-start; }
}
/* The Find leads box on the Leads page. */
.find-grid { display: grid; grid-template-columns: 2fr 1.4fr 1.4fr minmax(90px, .7fr); gap: 0 12px; }
.row .grow { flex: 1; }
@media (max-width: 760px) {
  .find-grid { grid-template-columns: minmax(0, 1fr); }
}
