/* One stylesheet for the whole app. System fonts, no icons, nothing loaded from anywhere. */

:root {
  --ink: #1a2330;
  --quiet: #5c6879;
  --faint: #8b95a3;
  --line: #e4e8ef;
  --panel: #ffffff;
  --page: #f3f5f9;
  --accent: #195d9c;
  --accent-soft: #e7f0f9;
  --good: #1e7a4d;
  --good-soft: #e9f5ee;
  --bad: #b03636;
  --bad-soft: #fbefef;
  --flat: #7c8695;
  --warm: #94660f;
  --warm-soft: #fbf3e2;
  --shadow: 0 1px 2px rgba(26, 35, 48, .05), 0 4px 14px rgba(26, 35, 48, .04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.6 system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

header.top {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.bar {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}

.bar .name { font-weight: 750; font-size: 16px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; padding: 14px 0; }
.bar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.bar nav a { color: var(--quiet); text-decoration: none; padding: 14px 10px 12px; border-bottom: 2px solid transparent; }
.bar nav a:hover { color: var(--ink); }
.bar nav a.here { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 30px 20px 70px;
}

h1 { font-size: 26px; letter-spacing: -.015em; margin: 0 0 4px; }
h2 { font-size: 16px; letter-spacing: -.005em; margin: 34px 0 10px; }
p.lead { color: var(--quiet); margin: 0 0 22px; max-width: 640px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

/* the big number on a brand page */
.headline { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.headline .big {
  font-size: 54px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.headline .word { color: var(--quiet); }


.counts { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 18px; }
.counts div { min-width: 88px; }
.counts strong { display: block; font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.counts small { color: var(--quiet); }

.good { color: var(--good); }
.bad { color: var(--bad); }
.flat { color: var(--flat); }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
/* long links and headlines have to break, or one of them pushes the page sideways */
td { overflow-wrap: anywhere; }
/* a heading is one short word and breaking it reads as two, so it never wraps */
th { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, .panel table tr:hover td { background: #fafbfd; }
td.tight { white-space: nowrap; color: var(--quiet); font-size: 13px; }
td.num, th.num { text-align: right; }

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 1px 9px;
  border-radius: 999px;
  color: var(--quiet);
  background: var(--page);
}
.tag.positive { color: var(--good); background: var(--good-soft); }
.tag.negative { color: var(--bad); background: var(--bad-soft); }
.tag.neutral { color: var(--flat); }

form.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
select, input[type=text] {
  font: inherit;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}
select:hover, input[type=text]:hover { border-color: #c9d1dd; }

svg.trend { display: block; width: 100%; height: auto; }
svg.trend polygon { fill: var(--accent-soft); }
svg.trend polyline { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.trend line { stroke: var(--line); stroke-width: 1; }
svg.trend text { fill: var(--faint); font-size: 12px; }

.quiet { color: var(--quiet); }
.small { font-size: 13px; }
.method .panel { max-width: 760px; }
.method code {
  background: var(--page);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}
.formula {
  background: var(--page);
  padding: 14px 16px;
  border-radius: 8px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px;
  overflow-x: auto;
}

/* wide tables get their own sideways scroll rather than squashing the page */
.scroller { overflow-x: auto; }
.scroller table { min-width: 560px; }

a.here { color: var(--ink); font-weight: 700; text-decoration: none; }

/* the little message after a form is saved */
.note {
  background: var(--accent-soft);
  border: 1px solid #cadeef;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 18px;
}
.note.alarm { background: var(--bad-soft); border-color: #e6c4c4; }

/* a link that has to look like a button */
a.button, button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 7px 15px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
a.button:hover, button:hover { background: #14507e; border-color: #14507e; }
a.button.plain, button.plain { background: #fff; color: var(--accent); }
a.button.plain:hover, button.plain:hover { background: var(--accent-soft); }
button.danger { background: #fff; color: var(--bad); border-color: #e0bcbc; }
button.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
button[disabled] { opacity: .5; cursor: default; }

/* a button that should read as a link, inside a table row */
button.link {
  background: none;
  border: 0;
  padding: 0;
  font-weight: 400;
  color: var(--accent);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
button.link:hover { background: none; }

.headrow { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.headrow .actions { display: flex; gap: 8px; align-items: center; }

.form label { display: block; margin-bottom: 18px; font-weight: 600; }
.form label small { display: block; font-weight: 400; color: var(--quiet); margin-top: 5px; }
.form input[type=text], .form textarea, .form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}
.form textarea { resize: vertical; }
.form .tickbox { font-weight: 400; display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.form .tickbox input { margin: 0; }
.formhead { font-weight: 700; margin: 0 0 12px; }

.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.columns h2 { margin-top: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips form { display: inline; }
.chip {
  font-size: 13px;
  padding: 3px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--quiet);
  text-decoration: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.good { color: var(--good); border-color: #bfdccb; }
.chip.bad { color: var(--bad); border-color: #e6c4c4; }

/* the try it box should take whatever room is going */
input.wide { flex: 1 1 260px; min-width: 0; }

/* the row of the confidence table that the code settled on */
tr.chosen td { background: var(--good-soft); font-weight: 600; }

/* the panel shown while a collection is going on */
.panel.working { border-color: #cadeef; background: #f7fbfe; }


@media (max-width: 640px) {
  /* two wrapped nav rows pinned to a small screen cost more than they help */
  header.top { position: static; }
  th, td { padding: 8px 6px; }
  .columns { grid-template-columns: 1fr; }
  .headline .big { font-size: 44px; }
  .hide-small { display: none; }
}

/* the score breakdown, opened by the browser itself so there is no javascript here */
details.breakdown { margin: -6px 0 20px; }
details.breakdown > summary {
  display: inline-block;
  font-weight: 600;
  padding: 7px 15px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: #fff;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}
details.breakdown > summary::-webkit-details-marker { display: none; }
details.breakdown > summary:hover { background: var(--accent-soft); }
details.breakdown[open] > summary { margin-bottom: 12px; }
details.breakdown p { margin: 0 0 10px; }
.step { margin: 16px 0; padding-left: 14px; border-left: 3px solid var(--line); }
.stepname { font-weight: 650; }
.sum { font-variant-numeric: tabular-nums; }
.maths { width: 340px; max-width: 100%; margin: 0 0 18px; font-variant-numeric: tabular-nums; }
.maths td, .maths th { padding: 3px 0; border: 0; text-align: left; }
.maths td:last-child { text-align: right; }
.maths tr.rule td { border-top: 1px solid var(--line); font-weight: 650; padding-top: 6px; }
.maths th[colspan] { font-weight: 650; text-align: left; padding: 4px 0; }

/* the sign in page, which is the only page with no header above it */
body.plain { background: var(--page); }
.gate {
  max-width: 380px;
  margin: 0 auto;
  padding: 14vh 20px 60px;
}
.gate .panel { padding: 26px 26px 28px; }
.gate h1 { font-size: 21px; margin-bottom: 18px; }
.gate .note { margin-bottom: 18px; }
.gate label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
}
.gate input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
}
.gate input:hover { border-color: #c9d1dd; }
.gate button { width: 100%; padding: 11px; font-size: 15px; }

/* the way out, sitting at the far end of the header */
.bar .out { margin-left: auto; }
.bar .out button.link { color: var(--quiet); padding: 14px 0; }
.bar .out button.link:hover { color: var(--ink); }
