/* site/v6/science.html: the evidence page. The story's fonts, colors and topbar; one long page with a sticky contents
   list; tables of counts. Red is people hurt, green is (almost) never, ink is neutral; identity grids, which have no
   right answer, use a blue/orange diverging scale. */
body.sci {
  background: var(--paper);
}
.sci-wrap {
  display: grid;
  overflow-x: clip;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--pad) 120px;
}
/* ---------- contents */
.toc {
  position: sticky;
  top: 64px;
  align-self: start;
  max-height: calc(100vh - 80px);
  overflow: auto;
  padding: 36px 0 24px;
  font-size: 14px;
}
.toc-h {
  margin: 0 0 10px;
  font-weight: 800;
}
.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.toc li a {
  display: block;
  padding: 5px 0 5px 10px;
  border-left: 2px solid #ddd8cc;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.3;
}
.toc li a:hover,
.toc li a.on {
  border-left-color: var(--ink);
  color: var(--ink);
  font-weight: 700;
}
.hl-pick {
  display: grid;
  gap: 6px;
  margin-top: 24px;
  font-weight: 700;
}
.hl-pick select,
.x-pick select {
  font: 600 14px var(--font);
  padding: 7px 8px;
  border: 1px solid #cfc9bc;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  max-width: 100%;
}
/* ---------- head and sections */
.sci-head {
  padding: 48px 0 12px;
  max-width: 760px;
}
.sci-head .x-kicker {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  color: var(--muted);
}
.sci-head h1 {
  font-size: clamp(44px, 6vw, 76px);
}
.sci-head .x-dek {
  margin: 18px 0 0;
  font-size: 20px;
  line-height: 1.5;
}
.sci-head .x-back a {
  font-weight: 700;
}
.sci-sec {
  padding-top: 56px;
  scroll-margin-top: 60px;
}
.sci-sec > h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sci-sec h2 .sn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--c);
  color: #fff;
  font-size: 20px;
  flex: none;
}
.sci-sec > .x-lede {
  max-width: 760px;
  margin: 12px 0 0;
  font-size: 18px;
  line-height: 1.55;
}
.sci-sec h3 {
  font-size: 18px;
  margin-bottom: 6px;
}
.sci-sec code {
  font: 600 0.88em Menlo, 'SF Mono', Consolas, monospace;
  background: #ece8de;
  padding: 1px 5px;
  border-radius: 5px;
}
.x-facts3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 24px 0 0;
}
.x-facts3 > div {
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 0 1px #e4dfd3;
}
.x-facts3 b {
  display: block;
  font-size: 30px;
  line-height: 1.1;
}
.x-facts3 span {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}
.x-cols2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 28px;
}
.x-cols2 p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
}
/* ---------- a figure: the question, the data, a fold for how it's counted */
.x-sf {
  margin: 26px 0 0;
  padding: 20px 22px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 0 0 1px #e4dfd3;
  scroll-margin-top: 70px;
}
.x-sf-q {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
}
.x-sf-q .x-anchor {
  margin-left: 8px;
  color: #c3bdb0;
  text-decoration: none;
  font-weight: 700;
}
.x-sf-q .x-anchor:hover,
.x-sf-q .x-anchor:focus {
  color: var(--ink);
}
.x-how {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}
.x-how summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}
.x-how p {
  margin: 8px 0 0;
  max-width: 820px;
  line-height: 1.55;
}
.x-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}
/* ---------- tables: the first column stays put while the rest scrolls */
.x-tw {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
}
.x-tw:hover,
.x-tw:focus-within {
  mask-image: none;
}
.x-st {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
.x-st th,
.x-st td {
  padding: 8px 10px;
  border-bottom: 1px solid #f0ece3;
  text-align: left;
  vertical-align: middle;
}
.x-st thead th {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 2px solid var(--ink);
  font-size: 12.5px;
  font-weight: 800;
  vertical-align: bottom;
  line-height: 1.25;
}
.x-st thead th small,
.x-st td small {
  font-weight: 600;
  color: var(--muted);
}
.x-st thead th small {
  display: block;
  font-size: 11px;
}
.x-st tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.x-st .x-tag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eeebe3;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.x-st .x-n {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.x-st td {
  font-weight: 700;
}
.x-st td.x-na {
  color: #b9b3a7;
  font-weight: 600;
}
.x-r2 {
  display: block;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
/* the tones */
.c-bad {
  background: #fbe3e1;
  color: #b4231d;
}
.c-mid {
  background: #fdf1ef;
  color: #b4231d;
}
.c-ok,
.c-good {
  color: var(--green);
}
.c-ink {
  color: var(--ink);
}
.c-mute,
.mute {
  color: var(--muted);
  font-weight: 600;
}
.ok {
  color: var(--green);
}
.bad {
  color: var(--red);
}
/* identity cells: a diverging scale, blue toward the first person, orange toward the second */
.x-sw {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  vertical-align: -2px;
}
.x-sw.a {
  background: #7fa0d0;
}
.x-sw.e {
  background: #fff;
  box-shadow: inset 0 0 0 1px #d8d2c5;
}
.x-sw.b {
  background: #e1a36f;
}
.x-side {
  color: var(--ink);
}
/* the predictions */
.x-pred td small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
}
.x-pred td:nth-child(2) {
  font-weight: 600;
  max-width: 520px;
  white-space: normal;
}
.x-pred tbody th {
  cursor: default;
}
/* the controls, version by version */
.x-sqs {
  display: inline-flex;
  gap: 3px;
  margin-right: 10px;
  vertical-align: middle;
}
.x-sq {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  color: #9a9488;
  box-shadow: inset 0 0 0 1px #d8d2c5;
}
.x-sq.pull {
  background: var(--red);
  color: #fff;
  box-shadow: none;
}
.x-sq.x-na {
  background: #eee;
}
.x-ctl td {
  white-space: nowrap;
}
/* bars for habits and changes: the middle line is half and half */
.x-hb {
  position: relative;
  display: block;
  width: 160px;
  height: 10px;
  border-radius: 5px;
  background: #f1eee6;
}
.x-hb i {
  display: block;
  height: 100%;
  width: calc(var(--w) * 1%);
  border-radius: 5px;
  background: #4b5058;
}
.x-hb em {
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--ink);
}
/* tabs inside a figure */
.x-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.x-tabs button {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #d8d2c5;
  background: #fff;
  font: 700 13px var(--font);
  cursor: pointer;
}
.x-tabs button[aria-selected='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.x-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 14px;
}
.x-lnk {
  padding: 0;
  border: 0;
  background: none;
  font: 700 14px var(--font);
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #d8d2c5;
  text-underline-offset: 3px;
}
.x-who {
  font-weight: 500;
  font-size: 13px;
  line-height: 1.4;
}
/* files */
.x-files {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.x-files li {
  padding: 8px 0;
  border-bottom: 1px solid #ece8de;
}
.x-files span {
  display: block;
  font-size: 14px;
  color: var(--muted);
}
/* highlight an AI */
tr.hl th,
tr.hl td {
  box-shadow: inset 0 2px 0 var(--amber), inset 0 -2px 0 var(--amber);
}
tr.hl th {
  background: #fff6d6;
}
span.hl {
  background: #fff1b8;
  border-radius: 3px;
}
/* the name panel on tap */
.x-tip {
  position: absolute;
  z-index: 40;
  max-width: 300px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}
.x-tip b {
  display: block;
  font-size: 14px;
}
/* ---------- phone */
@media (max-width: 900px) {
  .sci-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  main#sci {
    min-width: 0;
  }
  .x-cases > span {
    white-space: normal;
  }
  .x-st tbody th {
    white-space: normal;
    min-width: 92px;
  }
  .toc {
    position: sticky;
    top: 50px;
    z-index: 20;
    max-height: none;
    margin: 0 calc(-1 * var(--pad));
    padding: 8px var(--pad);
    background: rgba(246, 246, 242, 0.96);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid #e4dfd3;
    display: flex;
    gap: 10px;
    align-items: center;
  }
  .toc-h {
    display: none;
  }
  .toc ol {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
  }
  .toc li a {
    border-left: 0;
    padding: 5px 10px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 1px #e4dfd3;
    white-space: nowrap;
    font-size: 13px;
  }
  .toc li a.on {
    background: var(--ink);
    color: #fff;
  }
  .hl-pick {
    margin: 0;
  }
  .hl-pick span {
    display: none;
  }
  .hl-pick select {
    width: 110px;
    font-size: 12px;
  }
  .x-facts3,
  .x-cols2 {
    grid-template-columns: 1fr;
  }
  .x-sf {
    padding: 16px 14px;
    margin-left: calc(-1 * var(--pad) + 6px);
    margin-right: calc(-1 * var(--pad) + 6px);
  }
  .x-st {
    font-size: 13px;
  }
  .x-st th,
  .x-st td {
    padding: 7px 8px;
  }
  .x-hb {
    width: 90px;
  }
}
/* long tables */
.x-show {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: #fff;
  font: 800 13px var(--font);
  cursor: pointer;
}
.x-morebtn td {
  border-bottom: 0;
  padding-top: 14px;
}
/* trades, one row per AI */
.x-cases {
  font-weight: 500;
  font-size: 13px;
  line-height: 1.5;
}
.x-cases > span {
  display: inline-block;
  margin: 2px 10px 2px 0;
  padding: 2px 8px;
  border-radius: 8px;
  background: #fbf3f2;
  white-space: nowrap;
}
.x-cases .x-r2 {
  display: inline;
  margin-left: 4px;
}
.x-sub {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
/* the pair grid: the one-each column is where a favorite shows */
.x-pair td:nth-of-type(3),
.x-pair thead th:nth-of-type(4) {
  box-shadow: inset 2px 0 0 var(--ink), inset -2px 0 0 var(--ink);
}
.x-key .x-sw {
  margin-left: 6px;
}
.x-pl {
  display: inline-flex;
  gap: 2px;
}
.x-pl i {
  display: inline-grid;
  place-items: center;
  width: 21px;
  height: 22px;
  border-radius: 4px;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #ece8de;
}
.x-pick select {
  min-width: 0;
  flex: 1;
}
@media (max-width: 900px) {
  .x-pick {
    flex-wrap: wrap;
  }
  .x-pick select {
    width: 100%;
  }
}
/* ---------- realism */
.x-meter {
  display: block;
  height: 8px;
  margin: 8px 0 6px;
  border-radius: 4px;
  background: #f1eee6;
  overflow: hidden;
}
.x-meter i {
  display: block;
  height: 100%;
  width: calc(var(--w) * 1%);
  background: #4b5058;
  border-radius: 4px;
}
.x-meter.real i {
  background: var(--green);
}
.x-ladder {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.x-ladder img,
.x-ph {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
}
.x-ph {
  display: grid;
  place-items: center;
  padding: 10px;
  background: #ece8de;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.x-rn {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.x-rl {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}
.x-rl small {
  display: block;
  font-weight: 600;
  color: var(--muted);
}
.x-rp {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.x-rp b {
  color: var(--ink);
}
.x-vs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.x-vs img {
  width: 100%;
  border-radius: 10px;
}
.x-vh {
  margin: 8px 0 4px;
  font-weight: 800;
}
.x-q {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  line-height: 1.5;
}
.x-q li {
  margin-bottom: 6px;
}
.x-sub2 {
  margin: 20px 0 8px;
  font-weight: 800;
  font-size: 14px;
}
.x-tells {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 640px;
}
.x-tells li {
  display: grid;
  grid-template-columns: 260px 1fr 40px;
  gap: 12px;
  align-items: center;
  font-size: 14px;
}
.x-tells .x-meter {
  margin: 4px 0;
}
.x-tells b {
  text-align: right;
}
.x-steps {
  margin: 0 0 18px;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.55;
  max-width: 860px;
}
.x-steps li {
  margin-bottom: 6px;
}
.x-frames {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.x-frames img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}
.x-frames span {
  display: block;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted);
}
.x-frames b {
  color: var(--ink);
}
@media (max-width: 900px) {
  .x-ladder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .x-vs {
    grid-template-columns: 1fr;
  }
  .x-tells li {
    grid-template-columns: 1fr 70px 30px;
  }
  .x-frames {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
