/*
 * Systeamatic styles. Plain CSS, no framework.
 *
 * The look: warm paper background, white cards with soft shadows, a deep
 * evergreen accent, and a serif for headings, which gives an editorial,
 * academic feel. Every colour, size and shadow is a variable below, so the
 * whole look can be changed in one place.
 */

:root {
  /* Colours */
  --bg: #f6f4ef;            /* warm paper */
  --surface: #ffffff;
  --surface-soft: #faf9f6;
  --ink: #1c1a17;
  --ink-soft: #3d3933;
  --muted: #736c63;
  --line: #e7e2d9;
  --line-strong: #d6cfc3;

  --accent: #1f4e46;        /* deep evergreen */
  --accent-hover: #163b35;
  --accent-soft: #e6efec;
  --accent-ink: #ffffff;

  --include: #2c7350;  --include-soft: #e5f2ea;
  --maybe: #9a6513;    --maybe-soft: #f8efdc;
  --exclude: #a8402f;  --exclude-soft: #f8e6e2;
  --warn-soft: #fbf3e1; --warn-line: #ead7a8;

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  /* Shape and depth */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(28, 26, 23, 0.05);
  --shadow: 0 1px 2px rgba(28, 26, 23, 0.04), 0 6px 20px rgba(28, 26, 23, 0.05);
  --shadow-lift: 0 2px 4px rgba(28, 26, 23, 0.05), 0 12px 32px rgba(28, 26, 23, 0.08);
  --focus: 0 0 0 3px rgba(31, 78, 70, 0.22);
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
/* Hidden things stay hidden, whatever display a rule gives them. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font: 15.5px/1.6 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--ink); line-height: 1.25; }
h1 {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
}
h2 { font-size: 1.15rem; font-weight: 650; margin: 0 0 0.85rem; }
h3 { font-size: 1rem; font-weight: 650; margin: 1.5rem 0 0.6rem; }

a { color: var(--accent); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

p { margin: 0 0 0.9rem; }
code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-soft); padding: 0.1rem 0.35rem; border-radius: 5px; border: 1px solid var(--line); }

.muted { color: var(--muted); }
.hint { font-size: 0.88rem; color: var(--muted); }
.eyebrow {
  font-size: 0.75rem; font-weight: 650; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 0.4rem;
}
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 62ch; margin: 0 0 1.75rem; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-serif); font-size: 1.2rem; font-weight: 600; color: var(--ink);
}
.brand:hover { text-decoration: none; }
.logo { width: 30px; height: 30px; display: block; }
.topbar nav { display: flex; gap: 1.5rem; align-items: center; font-size: 0.93rem; }
.topbar nav a { color: var(--ink-soft); }
.user { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--ink-soft); text-decoration: none; }
.avatar {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 0.72rem; font-weight: 700;
}

/* ---------- Layout ---------- */

.container { max-width: 1080px; margin: 2.5rem auto 4rem; padding: 0 2rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; margin-bottom: 1.5rem; box-shadow: var(--shadow);
}
.narrow { max-width: 460px; margin: 4rem auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.page-head h1, .page-head h2 { margin: 0; }
.section-title { font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 2rem 0 1rem; }
.empty { text-align: center; padding: 2.5rem; }
.table-wrap { overflow-x: auto; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.row label { margin-top: 0; }

/* ---------- Landing page ---------- */

.hero { text-align: center; padding: 4.5rem 1rem 3rem; max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: 3rem; line-height: 1.12; margin-bottom: 1.25rem; }
.hero .lead { margin: 0 auto 2rem; }
.hero .hint { margin-top: 1rem; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 1rem; }
.features div {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
}
.features h3 { font-family: var(--font-serif); font-size: 1.15rem; margin-top: 0; }
.features p { color: var(--muted); margin: 0; }

/* ---------- Forms ---------- */

label { display: block; font-weight: 600; font-size: 0.92rem; margin: 1.1rem 0 0.4rem; color: var(--ink-soft); }
input, textarea, select {
  width: 100%; padding: 0.65rem 0.8rem; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: #a9a196; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
textarea { resize: vertical; }
textarea.mono { font-family: var(--font-mono); font-size: 0.88rem; line-height: 1.7; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; margin: 0.9rem 0; background: var(--surface-soft); }
legend { font-weight: 650; padding: 0 0.4rem; font-size: 0.92rem; }
fieldset .row { margin-bottom: 0.5rem; }
fieldset select, fieldset textarea { margin-top: 0.5rem; }
label.choice { font-weight: 400; display: flex; gap: 0.6rem; align-items: baseline; margin: 0.5rem 0; color: var(--ink); }
label.choice input { width: auto; accent-color: var(--accent); }
form button[type="submit"]:not(.link) { margin-top: 1.25rem; }
form.inline { display: inline; margin: 0; }
.error { color: var(--exclude); font-size: 0.92rem; margin: 0.6rem 0 0; }

/* ---------- Buttons ---------- */

button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.65rem 1.2rem; font: inherit; font-weight: 600; font-size: 0.95rem;
  color: var(--accent-ink); background: var(--accent); border: 1px solid var(--accent);
  border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
}
button:hover, .button:hover { background: var(--accent-hover); text-decoration: none; }
button:active, .button:active { transform: translateY(1px); }
button:focus-visible, .button:focus-visible { outline: none; box-shadow: var(--focus); }
.button.large { padding: 0.85rem 1.7rem; font-size: 1.02rem; }
.button.small { padding: 0.45rem 0.85rem; font-size: 0.88rem; }
button.secondary, a.secondary-link {
  background: var(--surface); color: var(--ink); border-color: var(--line-strong);
}
button.secondary:hover, a.secondary-link:hover { background: var(--surface-soft); }
button.link {
  padding: 0; color: var(--ink-soft); background: none; border: 0; box-shadow: none;
  font-weight: 500; font-size: inherit;
}
button.link:hover { color: var(--ink); background: none; text-decoration: underline; }
kbd {
  font: 600 0.72rem var(--font-mono); padding: 0.05rem 0.4rem; margin-left: 0.15rem;
  border: 1px solid currentColor; border-radius: 5px; opacity: 0.55;
}

/* ---------- Messages ---------- */

.flash {
  background: var(--accent-soft); border: 1px solid #c9ddd6; color: var(--accent-hover);
  border-radius: var(--radius-sm); padding: 0.8rem 1.1rem; margin-bottom: 1.75rem; overflow-wrap: anywhere;
}
.devnote {
  background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem; margin: 1rem 0 1.5rem;
}
.error-box { background: var(--exclude-soft); border-color: #eac3bb; color: var(--ink); }
.badge {
  font-size: 0.78rem; font-weight: 600; padding: 0.25rem 0.7rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); white-space: nowrap;
}

/* ---------- Tables ---------- */

table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { text-align: left; padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-soft); }
td.title { max-width: 440px; }

/* ---------- Projects ---------- */

.project-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.project-list .card { margin: 0; transition: box-shadow 0.2s, transform 0.2s; }
.project-list .card:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.project-list h2 { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 600; margin-bottom: 0.3rem; }
.project-list a:hover { text-decoration: none; }

.steps { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.step { margin: 0; padding: 1.3rem 1.35rem; display: flex; flex-direction: column; gap: 0.6rem; opacity: 0.72; }
.step.ready { opacity: 1; }
.step-head { display: flex; align-items: center; gap: 0.7rem; }
.step-head h3 { margin: 0; font-size: 1rem; }
.step-num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; font-weight: 700;
}
.step.ready .step-num { background: var(--accent); color: var(--accent-ink); }
.step-stat { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.step-links { display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem; margin-top: auto; padding-top: 0.4rem; font-size: 0.9rem; }

progress {
  width: 100%; height: 6px; border: 0; border-radius: 999px; overflow: hidden;
  background: var(--line); -webkit-appearance: none; appearance: none;
}
progress::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

.invite-form { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.pager { display: flex; gap: 1.25rem; align-items: center; justify-content: center; margin-top: 1.25rem; }
.numbers { font-size: 0.95rem; }

/* ---------- Screening ---------- */

.screen { display: grid; grid-template-columns: 1fr 310px; gap: 1.5rem; align-items: start; }
.screen .card { margin: 0; }
.screen > article { padding: 2rem 2.2rem; }
.record-title { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; line-height: 1.3; margin-bottom: 0.6rem; }
.abstract-text { font-size: 1.04rem; line-height: 1.75; max-width: 70ch; color: var(--ink-soft); margin-top: 1.25rem; }
mark.include { background: var(--include-soft); color: inherit; padding: 0.05rem 0.15rem; border-radius: 4px; box-shadow: inset 0 -2px 0 #b9dcc7; }
mark.exclude { background: var(--exclude-soft); color: inherit; padding: 0.05rem 0.15rem; border-radius: 4px; box-shadow: inset 0 -2px 0 #e9b9ae; }
.criteria { position: sticky; top: 5.5rem; background: var(--surface-soft); }
.criteria h3 { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 1.25rem 0 0.5rem; }
.criteria h3:first-child { margin-top: 0; }
.criteria ul { padding-left: 1.1rem; margin: 0; font-size: 0.93rem; }
.criteria li { margin-bottom: 0.4rem; }
.note summary { cursor: pointer; color: var(--muted); margin-top: 1.25rem; font-size: 0.92rem; }

.decide { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin: 1.75rem 0 0.25rem; }
.decide form { margin: 0; }
.decide select { width: auto; }
button.vote { min-width: 9.5rem; padding: 0.75rem 1.2rem; box-shadow: var(--shadow-sm); }
button.vote-include { background: var(--include-soft); color: var(--include); border-color: #bcdcc9; }
button.vote-include:hover { background: var(--include); color: #fff; }
button.vote-maybe { background: var(--maybe-soft); color: var(--maybe); border-color: #ead4a6; }
button.vote-maybe:hover { background: var(--maybe); color: #fff; }
button.vote-exclude { background: var(--exclude-soft); color: var(--exclude); border-color: #e9c1b8; }
button.vote-exclude:hover { background: var(--exclude); color: #fff; }
button.chosen { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor; }
button.wide { width: 100%; margin-top: 0.5rem !important; }
.vote-label { font-weight: 650; }
span.vote-include { color: var(--include); }
span.vote-maybe { color: var(--maybe); }
span.vote-exclude { color: var(--exclude); }
.votes { padding-left: 1.1rem; }
p.or { text-align: center; color: var(--muted); margin: 1.1rem 0 0.5rem; font-size: 0.9rem; }

/* ---------- Duplicates ---------- */

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.compare .card { margin: 0; }
.compare dl { margin: 0; }
.compare dt { font-size: 0.72rem; font-weight: 650; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; margin-top: 0.9rem; }
.compare dd { margin: 0.2rem 0 0; overflow-wrap: anywhere; }
.compare .abstract { max-height: 12rem; overflow-y: auto; font-size: 0.94rem; color: var(--ink-soft); }

/* ---------- Full text and extraction ---------- */

.fulltext { display: grid; grid-template-columns: 1fr 330px; gap: 1.5rem; align-items: start; }
.fulltext .card, .extract .card { margin: 0; }
.pdf-panel iframe { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.upload-pdf { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.upload-pdf label { margin: 0; }
.upload-pdf input { width: auto; flex: 1; }
.upload-pdf button { margin-top: 0 !important; }

.extract { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.extract .pdf-panel { position: sticky; top: 5.5rem; }
.extract-form h2 { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.extract-form h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
table.arms th, table.arms td { padding: 0.3rem; border: 0; }
table.arms tbody tr:hover td { background: none; }
table.arms input { padding: 0.45rem 0.55rem; }

/* ---------- PRISMA and downloads ---------- */

.prisma svg { width: 100%; height: auto; max-width: 900px; display: block; margin: 0.5rem auto; }
.summary { line-height: 1.75; font-family: var(--font-serif); font-size: 1.08rem; color: var(--ink-soft); }
.downloads { list-style: none; padding: 0; margin: 0; }
.downloads li { padding: 0.75rem 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.downloads li:last-child { border-bottom: 0; }

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
  /* minmax(0, 1fr), not 1fr: a column may shrink below its widest word. */
  .screen, .compare, .row, .steps, .fulltext, .extract, .features { grid-template-columns: minmax(0, 1fr); }
  .criteria, .extract .pdf-panel { position: static; }
  .hero h1 { font-size: 2.2rem; }
  .container { padding: 0 1.1rem; }
  .topbar { padding: 0.75rem 1.1rem; }
  .user-name { display: none; } /* just the avatar, which still opens the account page */
}

/* Phones: the signed-in header keeps to one line, with just the logo. */
@media (max-width: 640px) {
  .brand.signed-in .brand-name { display: none; }
  .topbar nav { gap: 1rem; white-space: nowrap; }
}

/* Phones: nothing scrolls sideways. Long words, searches and DOIs break
   onto the next line, and tables squeeze to fit instead of scrolling. */
@media (max-width: 640px) {
  body { overflow-wrap: anywhere; }
  .table-wrap { overflow-x: visible; }
  input[type=file] { font-size: 0.85rem; min-width: 0; }
  button.small-button { white-space: normal; }

  /* Screening: the three votes side by side, within thumb reach, and no
     keyboard keys, as phones have no keyboard. */
  .screen > article { padding: 1.25rem; }
  .decide > button.vote:not(.wide) { flex: 1 1 0; min-width: 0; padding: 0.8rem 0.3rem; }
  .decide { gap: 0.5rem; }
  button.vote kbd { display: none; }

  /* Tables become a list of cards, one value per line, each labelled with
     its column's heading (static/tables.js adds the labels). */
  table.stack thead { display: none; }
  table.stack tr { display: block; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
  table.stack td { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.1rem 0.75rem; padding: 0.15rem 0; border: 0; }
  table.stack td::before {
    content: attr(data-label); color: var(--muted); font-size: 0.72rem; font-weight: 650;
    letter-spacing: 0.05em; text-transform: uppercase; padding-top: 0.2rem;
  }
  table.stack td[data-label] > * { grid-column: 2; }
  table.stack td:not([data-label]) { grid-template-columns: minmax(0, 1fr); }
  table.stack td:not([data-label])::before { content: none; }
  table.stack tbody tr:hover td { background: none; }
  td.title { max-width: none; }
}

.site-footer { margin-top: 3.5rem; color: var(--muted); }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer nav a { color: var(--muted); }

/* The account page's details. */
dl.details { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.45rem 1rem; margin: 0; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; }

/* The privacy policy and terms. */
.legal { max-width: 760px; margin: 0 auto; padding: 2.2rem 2.4rem; line-height: 1.7; }
.legal h2 { font-size: 1.15rem; margin-top: 2rem; }
.legal table { font-size: 0.92rem; margin: 0.5rem 0 1rem; }

/* The free PRISMA diagram tool: the form beside the diagram, which can be
   scrolled sideways inside its card on small screens. */
.container.wide { max-width: 1320px; }
.tool-hero { margin-bottom: 1.75rem; }
.tool-hero .lead { max-width: 46rem; }
.tool-points { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; list-style: none; padding: 0; margin: 1rem 0 0; color: var(--ink-soft); font-size: 0.92rem; }
.tool-points li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: 0.45rem; }

.tool-layout { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.tool-layout .card { margin: 0; }
.tool-form h2 { margin: 0 0 0.25rem; }
.tool-form textarea { font-family: var(--font-mono); font-size: 0.86rem; }
.tool-step { display: flex; align-items: center; gap: 0.6rem; font-size: 1rem; margin: 1.6rem 0 0.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.tool-step span { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 0.82rem; font-weight: 700; }
.field-group { font-weight: 600; margin: 0.9rem 0 0.2rem; font-size: 0.92rem; }
.tool-numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0 0.75rem; align-items: end; }
.tool-optional { margin: 0.6rem 0; padding: 0.75rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.tool-optional summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: 1.25rem; }
.form-actions button { white-space: nowrap; }

/* The diagram: sticky beside the form, on a dotted "desk" with the
   diagram as a sheet of paper, as tall as the screen allows. */
.preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.preview-head h2 { margin: 0; }
.prisma-downloads { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.download-group { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; font-size: 0.88rem; }
.download-group > * { padding: 0.45rem 0.85rem; border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; margin: 0; border-radius: 0; }
.download-group > span { border-left: 0; background: var(--accent); color: #fff; cursor: default; }
.download-group > a:hover, .download-group > button:hover { background: var(--accent-soft); }
.tool-paper { background-color: var(--surface-soft); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 14px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.75rem; }
.tool-figure { overflow-x: auto; background: #fff; border-radius: 4px; box-shadow: 0 1px 2px rgba(28, 26, 23, 0.06), 0 8px 24px rgba(28, 26, 23, 0.08); padding: 0.75rem; }
.tool-figure svg { display: block; width: 100%; height: auto; }
.tool-preview > .hint { margin: 0.75rem 0 0; }
.citation { font-size: 0.92rem; padding: 0.75rem 1rem; background: var(--surface-soft); border-radius: var(--radius-sm); }
.legal-note, .tool-cta, .tool-faq { margin-top: 1.5rem; }
@media (max-width: 900px) {
  .tool-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .download-group { display: flex; width: 100%; }
  .download-group > * { flex: 1; text-align: center; }
  .download-group > span { flex: 0 0 auto; }
  .prisma-downloads > .small-button { flex: 1; }
  .tool-paper { padding: 0.6rem; }
}
/* Printing (or saving as PDF) the tool shows just the diagram. */
@media print {
  body * { visibility: hidden; }
  .tool-figure.printing, .tool-figure.printing * { visibility: visible; }
  .tool-figure.printing { position: absolute; left: 0; top: 0; width: 100%; }
}

/* A form field only bots fill in (see requestAccess). */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Team: roles and "view as" ---------- */

.role-form { display: flex; gap: 0.4rem; align-items: center; margin: 0; }
.role-form select { width: auto; padding: 0.35rem 0.5rem; }
.invitations ul { list-style: none; padding: 0; margin: 0; }
.invitations li {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 0.75rem 0; border-top: 1px solid var(--line);
}
.invitations form { margin: 0; }
.invite-actions { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.invite-actions form { margin: 0; }
button.link-button.resend { color: var(--accent); }
button.link-button {
  background: none; border: 0; box-shadow: none; padding: 0; min-width: 0;
  color: var(--exclude); font-size: 0.88rem; font-weight: 500; text-decoration: underline; cursor: pointer;
  margin: 0 !important;
}
.view-as { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 1.25rem; }
.view-as-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin: 0 0 1.25rem; padding: 0.8rem 1.1rem; border-radius: var(--radius-sm);
  background: var(--maybe-soft); border: 1px solid #ead4a6; color: var(--ink);
}

/* ---------- Filters (e.g. removed duplicates by reason) ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.25rem; }
.filters a {
  padding: 0.35rem 0.85rem; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-soft); font-size: 0.88rem; text-decoration: none;
}
.filters a.chosen { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
td .hint { display: block; margin-top: 0.15rem; }

/* ---------- AI suggestions ---------- */

.ai-panel {
  margin-top: 1.5rem; padding: 1rem 1.2rem; border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong); background: var(--surface-soft); font-size: 0.94rem;
}
.ai-panel .ai-head { display: flex; align-items: baseline; gap: 0.2rem 0.5rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.ai-panel .ai-head > * { overflow-wrap: normal; }
.ai-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.ai-foot .hint { margin: 0; }
button.agree { padding: 0.45rem 0.9rem; font-size: 0.9rem; box-shadow: none; }
.ai-panel .eyebrow { margin: 0; }
.ai-include .ai-head strong { color: var(--include); }
.ai-maybe .ai-head strong { color: var(--maybe); }
.ai-exclude .ai-head strong { color: var(--exclude); }
.ai-panel ul { padding-left: 1.1rem; margin: 0.5rem 0; }
.ai-panel summary { cursor: pointer; color: var(--muted); }

/* ---------- Search ---------- */

.sample { padding-left: 1.1rem; margin: 0; }
.sample li { margin-bottom: 0.6rem; font-size: 0.94rem; }
p.mono { font-family: var(--font-mono); font-size: 0.82rem; overflow-wrap: anywhere; }
button.small-button { padding: 0.4rem 0.8rem; font-size: 0.85rem; margin: 0 !important; white-space: nowrap; }
.syntax { margin-top: 0.75rem; }
.syntax dl { margin: 0.5rem 0 0; font-size: 0.9rem; }
.syntax dt { font-weight: 650; margin-top: 0.75rem; }
.syntax dd { margin: 0.2rem 0 0; color: var(--ink-soft); }

/* ---------- Meta-analysis ---------- */

svg.forest { width: 100%; height: auto; max-width: 900px; display: block; margin: 1rem auto 0.5rem; }

/* ---------- Deleting ---------- */

.card.danger { border-color: #e9c1b8; }
.card.danger h2 { color: var(--exclude); }
button.danger-button { background: var(--exclude); border-color: var(--exclude); }
button.danger-button:hover { background: #8c3426; }

/* ---------- Charts ----------
 * Series colours were checked with the dataviz validator (contrast, and
 * separation for colour-blind readers): blue and orange pass every check
 * against the white card. Every chart also has a legend, direct labels or
 * hover titles, and a table of its numbers, so colour is never the only cue.
 */

.viz {
  --series-1: #2a78d6; /* assurance; simulated trials */
  --series-2: #eb6834; /* power */
  --chart-grid: #ebe7df;
  --chart-ink: var(--muted);
}
svg.chart { width: 100%; height: auto; display: block; margin: 0.5rem 0; font-family: var(--font); }
svg.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
svg.chart .axis-line { stroke: var(--line-strong); stroke-width: 1; }
svg.chart .axis { fill: var(--chart-ink); font-size: 12px; }
svg.chart .label { fill: var(--ink-soft); font-size: 12px; font-weight: 600; }
svg.chart .reference { stroke: #a39b8f; stroke-width: 1; stroke-dasharray: 4 4; }
svg.chart .reference.strong { stroke: var(--ink-soft); }
svg.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .line.series-1 { stroke: var(--series-1); }
svg.chart .line.series-2 { stroke: var(--series-2); }
svg.chart .marker { stroke: var(--surface); stroke-width: 2; }
svg.chart .marker.series-1, svg.chart .bar.series-1 { fill: var(--series-1); }
svg.chart .marker.series-2 { fill: var(--series-2); }
svg.chart .bar:hover, svg.chart .marker:hover { opacity: 0.8; }
.legend { display: flex; gap: 1.25rem; font-size: 0.88rem; color: var(--ink-soft); margin-top: 1rem; }
.legend .swatch { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 0.4rem; vertical-align: middle; }
.legend .swatch.series-1 { background: var(--series-1); }
.legend .swatch.series-2 { background: var(--series-2); }

/* Headline numbers */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.9rem; margin: 0.5rem 0 1rem; }
.tile { background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.9rem 1rem; }
.tile strong { display: block; font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; line-height: 1.2; }
.tile span { display: block; margin-top: 0.15rem; font-size: 0.85rem; line-height: 1.4; color: var(--muted); }
h2.form-section { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }

/* ---------- Landing page ---------- */

.landing-hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center;
  padding: 3.5rem 0 3rem;
}
/* Grid items may shrink below their content's width, so long words or the
   preview never push the page wider than the screen. */
.landing-hero > *, .features > *, .phases > * { min-width: 0; }
.landing-hero h1 { font-size: 3.1rem; line-height: 1.08; margin-bottom: 1.25rem; letter-spacing: -0.02em; }
.landing-hero .lead { margin: 0 0 1.75rem; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.button.ghost { background: transparent; color: var(--accent); border-color: var(--line-strong); box-shadow: none; }
.button.ghost:hover { background: var(--surface); }

/* The product preview, in a simple browser frame. */
.hero-preview {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lift), 0 30px 60px -20px rgba(31, 78, 70, 0.25);
  overflow: hidden; transform: rotate(0.6deg);
}
.preview-bar { display: flex; gap: 6px; padding: 10px 14px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.preview-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.preview-body { padding: 1.4rem 1.5rem 1.5rem; }
.preview-meta { font-size: 0.78rem; color: var(--muted); margin: 0 0 0.6rem; }
.preview-title { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 600; line-height: 1.35; margin: 0 0 0.6rem; }
.preview-abstract { font-size: 0.9rem; color: var(--ink-soft); margin: 0 0 1rem; }
.preview-ai {
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-soft);
  padding: 0.7rem 0.9rem; font-size: 0.85rem; margin-bottom: 1rem;
}
.preview-ai .eyebrow { display: inline; margin-right: 0.3rem; }
.preview-ai strong { color: var(--include); }
.preview-ai p { margin: 0.3rem 0 0; color: var(--ink-soft); }
.preview-ai-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.75rem; }
.preview-agree {
  flex: none; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.7rem;
  border: 1px solid #bcdcc9; border-radius: var(--radius-sm); background: var(--include-soft);
  color: var(--include); font-weight: 600; font-size: 0.8rem; white-space: nowrap;
}
.preview-agree kbd { margin: 0; }
.preview-votes { display: flex; gap: 0.5rem; }
/* Each vote shows its name with its keyboard key beside it, on one line;
   phones have no keyboard, so there the keys are hidden. */
.preview-votes .vote {
  flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 0.4rem;
  padding: 0.55rem 0.4rem; border-radius: var(--radius-sm); white-space: nowrap;
  font-weight: 600; font-size: 0.88rem; border: 1px solid;
}
.preview-votes kbd { margin: 0; }
.preview-votes .vote-include { background: var(--include-soft); color: var(--include); border-color: #bcdcc9; }
.preview-votes .vote-maybe { background: var(--maybe-soft); color: var(--maybe); border-color: #ead4a6; }
.preview-votes .vote-exclude { background: var(--exclude-soft); color: var(--exclude); border-color: #e9c1b8; }

.landing-section { padding: 3rem 0 1rem; scroll-margin-top: 4.5rem; } /* clear of the sticky top bar */
.landing-heading { font-family: var(--font-serif); font-size: 1.9rem; font-weight: 600; text-align: center; margin: 0 0 1.75rem; }

.landing-sub { text-align: center; margin: -1rem auto 2rem; max-width: 560px; }
/* The 30-second "how it works" video (made in video/). */
.how-video {
  display: block; width: 100%; max-width: 960px; aspect-ratio: 16 / 9; margin: 0 auto 2.75rem;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg);
  box-shadow: 0 24px 60px rgba(28, 26, 23, 0.12);
}
/* On phones, the portrait version (see static/video.js). */
@media (max-width: 640px) { .how-video { aspect-ratio: 4 / 5; } }

/* The steps, as four phase cards in a row joined by arrows; one under
   another on phones. Inside each card, its steps sit along a thin line. */
.phases {
  list-style: none; padding: 0; margin: 0 auto; max-width: 1080px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.2rem;
}
.phase {
  position: relative; padding: 1.3rem 1.25rem 1.1rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--accent);
}
.phase:nth-child(2) { border-top-color: #2f6b5f; }
.phase:nth-child(3) { border-top-color: #4a8a7b; }
.phase:nth-child(4) { border-top-color: #6fa898; }
.phase:not(:last-child)::after {
  content: "→"; position: absolute; right: -1.75rem; top: 2.1rem;
  color: var(--accent); font-size: 1.35rem; font-weight: 700;
}
.phase-name {
  display: flex; align-items: center; gap: 0.5rem; margin: 0;
  font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; color: var(--ink);
}
.phase-summary { margin: 0.25rem 0 1rem; color: var(--muted); font-size: 0.9rem; }
.phase-steps { list-style: none; padding: 0; margin: 0; position: relative; }
.phase-steps li {
  position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 0.7rem;
  padding-bottom: 0.9rem;
}
.phase-steps li:last-child { padding-bottom: 0; }
/* The thin line joining a phase's steps, from one dot to the next. */
.phase-steps li:not(:last-child)::before {
  content: ""; position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: var(--line);
}
.step-dot {
  grid-row: span 2; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: 0.78rem; font-weight: 700;
}
.phase-steps strong { font-size: 0.97rem; line-height: 26px; }
.step-text { color: var(--muted); font-size: 0.86rem; line-height: 1.45; }

.features { grid-template-columns: repeat(3, 1fr); }

.faq { max-width: 760px; margin: 0 auto; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; margin-bottom: 0.6rem; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 0.6rem 0 0; color: var(--ink-soft); }

.landing-cta { text-align: center; padding: 4rem 1rem 3rem; }
.landing-cta img { margin: 0 auto 1rem; display: block; }
.landing-cta h2 { font-family: var(--font-serif); font-size: 2rem; font-weight: 600; margin-bottom: 0.4rem; }
.landing-cta .muted { margin-bottom: 1.5rem; }
/* The footer, in two rows: the name and the site's links, then the free
   tools. On phones, one part under another. */
.site-footer {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "brand legal" "tools tools";
  gap: 0.9rem 1.5rem; align-items: center;
  border-top: 1px solid var(--line); padding: 1.5rem 0 0; font-size: 0.9rem;
}
.footer-brand { grid-area: brand; }
.site-footer .footer-legal { grid-area: legal; justify-content: flex-end; }
.site-footer .footer-tools { grid-area: tools; padding-top: 0.9rem; border-top: 1px solid var(--line); }
@media (max-width: 700px) {
  .site-footer { grid-template-columns: minmax(0, 1fr); grid-template-areas: "brand" "legal" "tools"; }
  .site-footer .footer-legal { justify-content: flex-start; }
}
.site-footer span:first-child { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-serif); font-weight: 600; }

@media (max-width: 900px) {
  .features { grid-template-columns: minmax(0, 1fr); }
  .phases { grid-template-columns: minmax(0, 1fr); max-width: 480px; gap: 2.2rem; }
  .phase:not(:last-child)::after {
    content: "↓"; right: auto; left: 50%; top: auto; bottom: -1.95rem; transform: translateX(-50%);
  }
  .preview-votes kbd, .preview-agree kbd { display: none; }
  .preview-ai-foot { flex-wrap: wrap; }
  .landing-hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
  .landing-hero h1 { font-size: 2.3rem; }
  .hero-preview { transform: none; }
}
.tool-faq { max-width: none; margin: 1.5rem 0 0; }

/* The free kappa calculator: the table of counts, with agreements shaded
   on the diagonal, and the results with their scale. */
.kappa-form .page-head { align-items: flex-end; }
.kappa-categories { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-weight: 600; font-size: 0.92rem; }
.kappa-categories select { width: auto; margin: 0; }
.kappa-table-wrap { overflow-x: auto; }
.kappa-tool { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.kappa-table { width: auto; border-collapse: separate; border-spacing: 0.35rem; margin: 0 -0.35rem; }
.kappa-table th, .kappa-table td { border: 0; padding: 0; background: none; }
.kappa-table tbody tr:hover td { background: none; }
.kappa-table th { font-size: 0.85rem; font-weight: 600; text-align: center; padding: 0 0.2rem; color: var(--ink-soft); text-transform: none; letter-spacing: 0; }
.kappa-table .kappa-corner { text-align: left; font-weight: 500; color: var(--muted); font-size: 0.78rem; line-height: 1.3; }
.kappa-table input { margin: 0; min-width: 4.5rem; text-align: center; }
.kappa-table th input { min-width: 7rem; text-align: left; font-weight: 600; }
.kappa-table td.kappa-agree input { background: var(--accent-soft); border-color: var(--accent); }
.kappa-paste { margin-top: 1rem; }
.kappa-paste summary { cursor: pointer; font-weight: 600; }
.kappa-paste form { margin-top: 0.75rem; }
.kappa-paste textarea { font-family: var(--font-mono); font-size: 0.86rem; }
.kappa-big { font-family: var(--font-serif); font-size: 3rem; line-height: 1; margin: 0.5rem 0 0.25rem; color: var(--accent); }
.kappa-headline { font-size: 1.15rem; font-weight: 600; margin: 0 0 1rem; }
.kappa-scale { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; list-style: none; padding: 0; margin: 0 0 1.25rem; }
.kappa-scale li { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 6px; padding: 0.4rem 0.3rem; text-align: center; font-size: 0.72rem; line-height: 1.25; color: var(--muted); }
.kappa-scale li span { display: block; font-weight: 600; }
.kappa-scale li.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.kappa-stats { margin: 0 0 1.25rem; }
.kappa-stats div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.kappa-stats dt { color: var(--ink-soft); }
.kappa-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.kappa-stats small { font-weight: 400; color: var(--muted); }
.kappa-results h3 { font-size: 1rem; margin: 1.25rem 0 0.4rem; }
.references { padding-left: 1.2rem; font-size: 0.9rem; color: var(--ink-soft); }
.references li { margin-bottom: 0.3rem; }
@media (max-width: 900px) { .kappa-tool { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .kappa-scale { grid-template-columns: repeat(3, 1fr); }
  .kappa-table input { min-width: 3.5rem; }
  .kappa-table th input { min-width: 5.5rem; }
}
.kappa-tool .kappa-paste { margin-top: 1rem; }
.form-shortcuts { display: flex; gap: 0.9rem; font-size: 0.88rem; }
.form-shortcuts a { color: var(--accent); text-decoration: none; font-weight: 600; }
.form-shortcuts a:hover { text-decoration: underline; }
.tool-style { border: 0; padding: 0; margin: 0.75rem 0 0; }
.tool-style legend { font-weight: 600; font-size: 0.92rem; margin-bottom: 0.3rem; }
.tool-style .choice { display: inline-flex; margin-right: 1.25rem; }
/* With JavaScript the diagram follows the form as it's filled in, so the
   button that updates it isn't needed. */
.tool-form.live .form-actions { display: none; }
.tool-sentences { margin-top: 1.5rem; }
.tool-sentences .citation { margin: 0; line-height: 1.6; }

/* Toggle chips and segmented choices: checkboxes and radio buttons drawn
   as buttons, which fill in when chosen. */
.toggle-chips, .segmented { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.toggle-chip, .segmented label { position: relative; margin: 0; }
.toggle-chip input, .segmented input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.toggle-chip span, .segmented span { display: inline-block; padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; font-size: 0.86rem; white-space: nowrap; cursor: pointer; }
.segmented { gap: 0; }
.segmented label { margin: 0; flex: 1; }
.segmented span { display: block; text-align: center; border-radius: 0; margin-left: -1px; }
.segmented label:first-child span { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.segmented label:last-child span { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.toggle-chip input:checked + span, .segmented input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.toggle-chip input:focus-visible + span, .segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The other methods and previous version fields show only when chosen. */
.tool-form .when-other, .tool-form .when-previous { display: none; }
.tool-form:has(input[name="other"]:checked) .when-other,
.tool-form:has(input[name="previous"]:checked) .when-previous { display: block; }

/* The diagram's colour choices, each shown with swatches of its heading
   and phase colours. */
.palettes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.palette { position: relative; margin: 0; }
.palette input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.palette span { display: flex; align-items: center; gap: 0.3rem; padding: 0.45rem 0.55rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; font-size: 0.82rem; cursor: pointer; }
.palette svg { flex: none; }
.palette input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.palette input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The forest plot maker and meta-analysis calculator: the kind of data as
   tabs, and the calculator's tables. */
.kind-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.75rem 0 1rem; border-bottom: 1px solid var(--line); }
.kind-tabs a { padding: 0.5rem 0.7rem; font-size: 0.86rem; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.kind-tabs a:hover { color: var(--ink); }
.kind-tabs a.current { color: var(--accent); border-bottom-color: var(--accent); }
#meta-studies { font-family: var(--font-mono); font-size: 0.82rem; white-space: pre; overflow-x: auto; }
.tool-card { margin-top: 1.5rem; }
.tool-card .table-wrap { overflow-x: auto; }
.tool-card table td:nth-child(n+2), .tool-card table th:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }
.footer-tools strong { color: var(--ink-soft); font-weight: 600; }

/* Side-by-side panels that scroll on their own (the PRISMA tool): on wider
   screens each is at most as tall as the screen below the site's header,
   so the form and the full-size diagram can each be scrolled while the
   other stays put. At a panel's end, scrolling carries on down the page. */
@media (min-width: 901px) {
  .tool-layout.split > .card { max-height: calc(100vh - 6rem); overflow-y: auto; }
}

/* A project's diagrams saved from the free PRISMA tool. */
.saved-diagram { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; align-items: center; }
.saved-diagram strong { color: var(--ink); margin-right: 0.5rem; }
.saved-actions { display: flex; gap: 1rem; align-items: center; }
.saved-actions form.inline { display: inline; margin: 0; }

/* A project's meta-analysis: the result beside its forest plot. */
.analysis-outcome { margin: 2rem 0 1rem; }
.analysis-top { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
.agreement-sentence { margin-top: 1.25rem; }
.agreement-sentence h3 { margin: 0; font-size: 1rem; }

/* A project's PRISMA page: its colour choice above the diagram. */
.report-palettes { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 0 0 1rem; }
.report-palettes .palettes { grid-template-columns: repeat(6, auto); }
@media (max-width: 700px) { .report-palettes .palettes { grid-template-columns: repeat(3, auto); } }

/* The landing page's free tools, as cards that link to each. */
.landing-sub { text-align: center; color: var(--muted); max-width: 40rem; margin: -0.5rem auto 1.5rem; }
.free-tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.free-tools a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.free-tools a:hover { border-color: var(--accent); transform: translateY(-2px); }
.free-tools h3 { font-family: var(--font-serif); font-size: 1.05rem; margin: 0 0 0.4rem; color: var(--accent); }
.free-tools p { color: var(--muted); margin: 0; font-size: 0.92rem; }
@media (max-width: 900px) { .free-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .free-tools { grid-template-columns: minmax(0, 1fr); } }

/* The meta-analysis's publication bias section: the funnel plot beside
   Egger's test. */
.funnel-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.5rem; align-items: start; }
.funnel-layout h3 { margin-top: 0; font-size: 1rem; }
@media (max-width: 900px) { .funnel-layout { grid-template-columns: minmax(0, 1fr); } }

/* How to cite a free tool: each style with its copy button. */
.cite-style { margin-top: 1rem; }
.cite-style h3 { margin: 0; font-size: 0.95rem; }
.cite-style pre.citation { white-space: pre-wrap; font-family: var(--font-mono); font-size: 0.8rem; margin: 0.4rem 0 0; }

/* The validation page. */
.validation-badge { display: inline-block; margin-top: 1rem; padding: 0.5rem 0.9rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.validation-check code { font-size: 0.82rem; word-break: break-word; }
.validation-check .match { color: var(--accent); font-weight: 600; white-space: nowrap; }
.validation-check .mismatch { color: #b42318; font-weight: 600; }

/* ---------- Ask the evidence ----------
   A chat: each question on the right, its answer in a card below, and the
   project's conversations alongside. */

.ask-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1.5rem; align-items: start; }
.ask-you {
  margin: 0 0 0.75rem auto; max-width: 80%; width: fit-content;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.7rem 1rem; border-radius: var(--radius) var(--radius) 4px var(--radius);
}
.ask-reply { margin-bottom: 1.75rem; }
.ask-bottom { font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.5; }
.ask-points { padding-left: 1.2rem; }
.ask-points li { margin-bottom: 0.45rem; }
.ask-step { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.3rem; font-weight: 600; }
.spinner {
  width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

.cite { font-size: 0.8rem; vertical-align: super; margin-left: 0.15rem; text-decoration: none; }
.partly {
  font-size: 0.75rem; margin-left: 0.35rem; padding: 0.05rem 0.45rem; border-radius: 999px;
  background: var(--maybe-soft); color: var(--maybe); cursor: help; white-space: nowrap;
}
.strength-strong { background: var(--include-soft); color: var(--include); }
.strength-moderate { background: var(--accent-soft); color: var(--accent); }
.strength-limited { background: var(--maybe-soft); color: var(--maybe); }
.strength-insufficient { background: var(--exclude-soft); color: var(--exclude); }

.ask-studies-title { margin-top: 1.5rem; }
.ask-studies { list-style: none; padding: 0; }
.ask-studies li { border-top: 1px solid var(--line); scroll-margin-top: 5rem; } /* clear of the sticky header */
.ask-studies li:last-child { border-bottom: 1px solid var(--line); }
/* Each study is a row, its grade and title, that opens to show the rest. */
.ask-study summary {
  display: grid; grid-template-columns: 2rem minmax(0, 1fr) 1rem; gap: 0.75rem; align-items: center;
  padding: 0.6rem 0.4rem; cursor: pointer; list-style: none; border-radius: var(--radius-sm);
}
.ask-study summary::-webkit-details-marker { display: none; }
.ask-study summary::after {
  content: "›"; color: var(--muted); font-size: 1.2rem; line-height: 1; transition: transform 0.15s;
}
.ask-study[open] summary::after { transform: rotate(90deg); }
.ask-study summary:hover { background: var(--surface-soft); }
.ask-study summary:hover .ask-study-title { color: var(--accent); }
.ask-study-title { font-weight: 500; }
.ask-study-body { padding: 0 0.4rem 0.85rem calc(2.75rem + 0.4rem); }
.ask-studies li:target summary { background: var(--accent-soft); }
.ask-studies p { margin: 0.2rem 0; }
.ask-studies blockquote {
  margin: 0.4rem 0 0; padding-left: 0.8rem; border-left: 3px solid var(--line-strong);
  color: var(--ink-soft); font-size: 0.92rem;
}
.grade {
  display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
  border-radius: 50%; font-weight: 700; cursor: help;
}
.grade-A { background: var(--include); color: #fff; }
.grade-B { background: var(--include-soft); color: var(--include); }
.grade-C { background: var(--maybe-soft); color: var(--maybe); }
.grade-D { background: var(--exclude-soft); color: var(--exclude); }

.ask-form textarea { width: 100%; }
.ask-threads ul { list-style: none; padding: 0; margin: 0; }
.ask-threads li { padding: 0.5rem 0.6rem; border-radius: var(--radius-sm); }
.ask-threads li a { display: block; }
.ask-threads li.current { background: var(--accent-soft); }
@media (max-width: 900px) {
  .ask-layout { grid-template-columns: minmax(0, 1fr); }
  .ask-you { max-width: 95%; }
}

/* While answering: a tick for each step done, a spinner for the one going
   on, and the answer's sentences paler until they are checked. */
.ask-progress { list-style: none; padding: 0; margin: 0; }
.ask-progress li { display: flex; align-items: center; gap: 0.5rem; padding: 0.15rem 0; }
.ask-progress li.done { color: var(--muted); }
.ask-progress li.done::before { content: "✓"; color: var(--include); font-weight: 700; width: 1rem; }
.ask-progress li.now { font-weight: 600; }
.ask-progress .spinner { flex: none; }
.badge.drafting { background: var(--warn-soft); color: var(--maybe); }
.drafting { color: var(--ink-soft); }
/* The page doesn't hold still what's on screen as an answer grows above it
   (ask.js keeps the question in view instead), and a question jumped to
   sits below the sticky header, not under it. */
.ask-chat { overflow-anchor: none; }
.ask-turn { scroll-margin-top: 5rem; }

/* Suggested follow-up questions: a short list under the latest answer,
   one row per question, each asking it when clicked. And a button showing
   its question is on its way. */
.ask-follow-ups { margin: -0.5rem 0 1.75rem; }
.ask-follow-ups-title {
  margin: 0 0 0.35rem; font-size: 0.75rem; font-weight: 650; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
form .ask-follow-ups button.suggestion, .ask-follow-ups button.suggestion {
  display: flex; justify-content: space-between; gap: 1rem; width: 100%; margin: 0;
  padding: 0.7rem 0.6rem; text-align: left; font-weight: 500; color: var(--ink);
  background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none;
}
.ask-follow-ups button.suggestion:last-child { border-bottom: 1px solid var(--line); }
.ask-follow-ups button.suggestion:hover { background: var(--accent-soft); color: var(--accent); }
.ask-follow-ups .arrow { color: var(--accent); transition: transform 0.15s; }
.ask-follow-ups button.suggestion:hover .arrow { transform: translateX(3px); }
button.sending { position: relative; color: transparent !important; }
button.sending::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 1rem; height: 1rem;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  animation: spin 0.9s linear infinite;
}
/* A suggestion being asked keeps its words, with a spinner for its arrow. */
.ask-follow-ups button.suggestion.sending { color: var(--accent) !important; }
.ask-follow-ups button.sending .arrow { visibility: hidden; }
.ask-follow-ups button.sending::after {
  inset: 0 0.6rem 0 auto; margin: auto 0; border-color: var(--accent-soft); border-top-color: var(--accent);
}
