/* Waldorf style: warm paper, plant colours laid on like watercolour, soft round forms. Every colour, space and font is set here. */

@font-face {
  font-family: Alegreya;
  src: url(fonts/Alegreya.ttf) format('truetype');
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url(fonts/AlegreyaSans-Regular.ttf) format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url(fonts/AlegreyaSans-Italic.ttf) format('truetype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url(fonts/AlegreyaSans-Medium.ttf) format('truetype');
  font-weight: 500 700;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: light-dark(#f6f1e6, #211d19);
  --paper-2: light-dark(#efe7d6, #2a2520);
  --paper-3: light-dark(#e6dbc4, #352e27);
  --sheet: light-dark(#fbf8f1, #342d27);
  --ink: light-dark(#3b342e, #ece4d6);
  --soft: light-dark(#6b6056, #bcb0a1);
  --hint: light-dark(#74695e, #ab9f91);
  --edge: light-dark(rgb(59 52 46 / 0.16), rgb(236 228 214 / 0.16));
  --edge-strong: light-dark(rgb(59 52 46 / 0.3), rgb(236 228 214 / 0.32));
  --shade: light-dark(rgb(59 52 46), rgb(0 0 0));
  --madder: light-dark(#b5574b, #c46a5d);
  --madder-ink: light-dark(#99463b, #e8a093);
  --ochre: light-dark(#c79a3a, #c99d45);
  --ochre-ink: light-dark(#7f5d18, #e3c27a);
  --woad: light-dark(#4d6a8a, #6f8fb3);
  --woad-ink: light-dark(#3e5876, #a9c2de);
  --birch: light-dark(#7b9a5a, #8aa868);
  --birch-ink: light-dark(#526d36, #b7d197);
  --rose: light-dark(#d8a7a0, #c08a83);
  --rose-ink: light-dark(#8f534a, #e7b6ae);
  --stone: light-dark(#a39a8f, #8a8177);
  --stone-ink: light-dark(#6b6258, #c0b6ab);
  --accent: var(--madder-ink);
  /* The height of the sticky header, measured in both layouts. */
  --bar: 65px;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --r1: 10px;
  --r2: 16px;
  --r3: 24px;
  --round: 999px;
  --serif: Alegreya, Georgia, serif;
  --sans: 'Alegreya Sans', 'Segoe UI', sans-serif;
  --shadow: 0 1px 2px color-mix(in srgb, var(--shade) 6%, transparent), 0 8px 24px color-mix(in srgb, var(--shade) 8%, transparent);
}

/* A theme chosen in the settings overrides the system. */
[data-theme='light'] {
  color-scheme: light;
}

[data-theme='dark'] {
  color-scheme: dark;
}

/* The paper grain stains a dark page. */
html[data-theme='dark'] {
  background-image: none;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) {
    background-image: none;
  }
}

/* Each family line has a plant colour for washes and lines, and a deeper one for text. */
.line-0 {
  --line: var(--madder);
  --line-ink: var(--madder-ink);
}

.line-1 {
  --line: var(--ochre);
  --line-ink: var(--ochre-ink);
}

.line-2 {
  --line: var(--woad);
  --line-ink: var(--woad-ink);
}

.line-3 {
  --line: var(--birch);
  --line-ink: var(--birch-ink);
}

.line-4 {
  --line: var(--rose);
  --line-ink: var(--rose-ink);
}

.line-none {
  --line: var(--stone);
  --line-ink: var(--stone-ink);
}

*,
::before,
::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-padding-top: var(--bar);
  background: var(--paper) url(paper.svg);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: 0;
}

h1,
h2,
h3,
p,
ul,
figure,
blockquote {
  margin: 0;
}

h1 {
  font: 500 34px/1.15 var(--serif);
  letter-spacing: -0.005em;
}

h2 {
  font: 500 22px/1.25 var(--serif);
}

h3,
h2.label {
  color: var(--soft);
  font: 500 12px/1.5 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

a {
  color: inherit;
  text-decoration-color: var(--edge-strong);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--woad);
  outline-offset: 2px;
}

code {
  font: 14px/1.4 ui-monospace, monospace;
}

.muted {
  color: var(--soft);
}

.icon {
  flex: none;
  width: 20px;
  height: 20px;
}

/* Header */

.bar {
  display: grid;
  grid-template-areas: 'brand tabs actions';
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s3) var(--s5);
  position: sticky;
  top: 0;
  z-index: 5;
  padding: var(--s3) var(--s5);
  border-bottom: 1px solid var(--edge);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px);
}

.bar .brand {
  grid-area: brand;
}

.bar .tabs {
  grid-area: tabs;
}

.bar .actions {
  grid-area: actions;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin: 0;
  color: var(--ink);
  font: 500 23px/1 var(--serif);
  text-decoration: none;
  white-space: nowrap;
}

.brand .icon {
  width: 26px;
  height: 26px;
  color: var(--madder);
}

.tabs {
  display: flex;
  justify-content: center;
  gap: var(--s1);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs a {
  padding: 6px 14px;
  border-radius: var(--round);
  color: var(--soft);
  text-decoration: none;
  white-space: nowrap;
}

.tabs a:hover {
  color: var(--ink);
}

.tabs a[aria-current] {
  background: color-mix(in srgb, var(--madder) 16%, var(--paper));
  color: var(--ink);
}

.count {
  display: inline-block;
  min-width: 22px;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: var(--round);
  background: var(--madder-ink);
  color: var(--sheet);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  text-align: center;
  vertical-align: 1px;
}

.actions {
  display: flex;
  gap: 2px;
}

main {
  flex: 1;
  min-height: 0;
}

.foot {
  display: grid;
  justify-items: center;
  gap: var(--s1);
  padding: var(--s6) var(--s5) var(--s5);
  color: var(--soft);
}

@media (max-width: 960px) {
  :root {
    --bar: 109px;
  }

  .bar {
    grid-template-areas: 'brand actions' 'tabs tabs';
    grid-template-columns: minmax(0, 1fr) auto;
    padding: var(--s3) var(--s4) var(--s2);
  }

  .tabs {
    justify-content: flex-start;
    margin: 0 calc(-1 * var(--s4));
    padding: 0 var(--s4);
    /* The fading edge shows that more views lie to the right. */
    mask-image: linear-gradient(to right, black calc(100% - 2.5rem), transparent);
  }
}

@media (max-width: 380px) {
  .bar {
    column-gap: var(--s3);
  }

  .bar .brand span {
    display: none;
  }

  .bar .tool {
    width: 34px;
    min-width: 34px;
  }
}

/* Controls */

button,
.button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 40px;
  padding: 0 var(--s4);
  border: 1.5px solid var(--edge-strong);
  border-radius: var(--round);
  background: var(--sheet);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

button:hover,
.button:hover {
  border-color: var(--ink);
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

.primary,
button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--sheet);
}

.primary:hover {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--accent) 88%, var(--ink));
}

.danger,
button.danger {
  border-color: color-mix(in srgb, var(--madder) 60%, transparent);
  color: var(--madder-ink);
}

.small,
button.small {
  min-height: 32px;
  padding: 0 var(--s3);
  font-size: 15px;
}

.tool {
  display: inline-grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--soft);
}

.tool:hover,
.tool[aria-current] {
  background: color-mix(in srgb, var(--madder) 12%, transparent);
  color: var(--ink);
}

.tool.off {
  opacity: 0.3;
  cursor: default;
}

.tool.yes {
  color: var(--birch-ink);
}

.tool.no {
  color: var(--madder-ink);
}

.tool.small {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
}

.state {
  display: inline-grid;
  margin-right: var(--s1);
  vertical-align: -4px;
}

.state.yes {
  color: var(--birch-ink);
}

.state.no {
  color: var(--madder-ink);
}

.source-line {
  display: flex;
  align-items: center;
  gap: var(--s1);
}

.source-line .source {
  min-width: 0;
}

.locked,
[aria-disabled='true'] {
  opacity: 0.45;
  pointer-events: none;
}

form.act {
  display: contents;
}

input:where(:not([type='checkbox'], [type='radio'], [type='file'], [type='hidden'])),
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: var(--s2) var(--s3);
  border: 1.5px solid var(--edge-strong);
  border-radius: var(--r1);
  background: var(--sheet);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--woad);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--woad) 22%, transparent);
}

input[type='file'] {
  width: 100%;
  padding: var(--s2) 0;
}

textarea {
  resize: vertical;
}

::placeholder {
  color: var(--hint);
  opacity: 1;
}

input[type='checkbox'],
input[type='radio'] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--madder-ink);
}

.segments {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--round);
  background: var(--paper-2);
}

.segments a {
  flex: auto;
  padding: 5px 12px;
  border-radius: var(--round);
  color: var(--soft);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.segments a[aria-current] {
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--shade) 12%, transparent);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--ink);
  text-decoration: none;
}

button.switch {
  min-height: 40px;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 400;
}

.knob {
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  border-radius: var(--round);
  background: light-dark(var(--paper-3), rgb(236 228 214 / 0.2));
  box-shadow: inset 0 0 0 1px var(--edge);
}

.knob::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: light-dark(var(--sheet), var(--soft));
  box-shadow: 0 1px 2px color-mix(in srgb, var(--shade) 30%, transparent);
  content: '';
}

.switch[aria-checked='true'] .knob {
  background: var(--birch);
}

.switch[aria-checked='true'] .knob::before {
  left: 19px;
  background: var(--sheet);
}

.notice {
  padding: var(--s3) var(--s4);
  border-radius: var(--r2);
  background: color-mix(in srgb, var(--ochre) 20%, var(--paper));
}

.hint-card {
  position: fixed;
  bottom: var(--s5);
  left: 50%;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: var(--s4);
  width: min(30rem, calc(100% - 2 * var(--s4)));
  padding: var(--s4);
  border-radius: var(--r3);
  background: var(--sheet);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.hint-card p {
  flex: 1;
  margin: 0;
}

.error {
  color: var(--madder-ink);
  font-weight: 500;
}

/* Forms and dialogs */

.stack {
  display: grid;
  gap: var(--s4);
}

.field {
  display: grid;
  gap: var(--s1);
  min-width: 0;
}

fieldset.field {
  margin: 0;
  padding: 0;
  border: 0;
}

.field > legend {
  padding: 0;
}

/* Suggestions of a place field lie over what follows it. */
.field:has(> .suggest) {
  position: relative;
}

.suggest {
  position: absolute;
  z-index: 2;
  top: 100%;
  right: 0;
  left: 0;
  max-height: 18rem;
  margin: var(--s1) 0 0;
  padding: var(--s1);
  overflow: auto;
  border: 1px solid var(--edge);
  border-radius: var(--r1);
  background: var(--sheet);
  box-shadow: var(--shadow);
  list-style: none;
}

.suggest li {
  display: grid;
  padding: var(--s2) var(--s3);
  border-radius: calc(var(--r1) - var(--s1));
  cursor: pointer;
}

.suggest li[aria-selected='true'],
.suggest [role='option']:hover {
  background: var(--paper-2);
}

.suggest small {
  color: var(--soft);
}

.suggest .suggest-head {
  padding: var(--s2) var(--s3) var(--s1);
  color: var(--hint);
  font-size: 13px;
  cursor: default;
}

.field > span,
.field > legend {
  color: var(--soft);
  font-size: 14px;
  font-weight: 500;
}

.pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: var(--s4);
}

.check {
  display: flex;
  align-items: center;
  gap: var(--s2);
  cursor: pointer;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
}

/* Checkboxes in a list that scrolls in itself. */
.choices {
  display: grid;
  gap: var(--s2);
  max-height: 14rem;
  margin-top: var(--s1);
  padding: var(--s3);
  overflow-y: auto;
  border: 1.5px solid var(--edge-strong);
  border-radius: var(--r1);
}

.fixed {
  color: var(--soft);
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s2);
}

.buttons.start {
  justify-content: flex-start;
}

dialog.sheet {
  width: min(100% - 2 * var(--s4), 36rem);
  max-height: calc(100dvh - 2 * var(--s4));
  padding: var(--s6);
  overflow: auto;
  border: 1px solid var(--edge);
  border-radius: var(--r3);
  background: var(--sheet);
  color: var(--ink);
  box-shadow: var(--shadow);
}

dialog.sheet[open] {
  display: grid;
  gap: var(--s5);
}

dialog.sheet:not(:modal) {
  position: fixed;
  inset: var(--s4);
  z-index: 10;
  margin: auto;
}

dialog::backdrop {
  background: color-mix(in srgb, var(--shade) 32%, transparent);
}

.viewer img {
  display: block;
  width: 100%;
  max-height: 60dvh;
  border-radius: var(--r2);
  background: var(--paper-2);
  object-fit: contain;
}

.login {
  display: grid;
  gap: var(--s6);
  width: min(100% - 2 * var(--s4), 24rem);
  margin: auto;
  padding: var(--s8) 0;
}

.login .brand {
  justify-content: center;
  font-size: 34px;
}

.login .brand .icon {
  width: 36px;
  height: 36px;
}

.login .primary {
  width: 100%;
}

/* Pages */

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s7);
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: var(--s7) var(--s5) var(--s8);
}

/* Pages to work through long lists: sources in columns of cards. */

.work .list {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 32rem), 1fr));
  align-items: start;
}

.page-head {
  display: grid;
  gap: var(--s2);
}

.section {
  display: grid;
  gap: var(--s4);
}

.section-head,
.page-head.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

.empty {
  display: grid;
  justify-items: center;
  gap: var(--s5);
  padding: var(--s8) var(--s4);
  text-align: center;
}

ul.plain {
  display: grid;
  gap: var(--s2);
  padding: 0;
  list-style: none;
}

.card {
  padding: var(--s5);
  border-radius: var(--r3);
  background: var(--sheet);
}

/* Persons */

.avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: var(--size, 40px);
  height: var(--size, 40px);
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--line) 22%, var(--sheet));
  color: var(--line-ink);
  font: 500 calc(var(--size, 40px) * 0.36) / 1 var(--serif);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar.big {
  --size: 112px;
  border-width: 3px;
}

/* Accounts: a face per user, stacked where several shaped something */

.faces {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  padding-left: 6px;
}

/* Who added and decided a finding, and when. */
.by {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s4);
  color: var(--soft);
  font-size: 13px;
}

.by > span {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
}

.face {
  --size: 24px;
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: color-mix(in srgb, var(--stone) 32%, var(--sheet));
  color: var(--stone-ink);
  box-shadow: 0 0 0 2px var(--sheet);
  font: 600 10px / 1 var(--sans);
  letter-spacing: 0.02em;
  transition: transform 0.15s ease;
}

.faces .face {
  margin-left: -6px;
}

.faces .face:hover {
  z-index: 1;
  transform: translateY(-2px);
}

.face img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.face.more {
  background: var(--paper-2);
}

.face .mark {
  position: absolute;
  right: -4px;
  bottom: -4px;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--birch);
  color: var(--sheet);
  box-shadow: 0 0 0 2px var(--sheet);
}

.face.rejected .mark {
  background: var(--stone);
}

.face .mark .icon {
  width: 10px;
  height: 10px;
}

.event.pending .face {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ochre) 9%, var(--sheet));
}

.team li,
.named {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

a.named {
  text-decoration: none;
}

a.named > span:not(.face) {
  text-decoration: underline;
  text-decoration-color: var(--edge-strong);
}

a.named:hover > span:not(.face) {
  text-decoration-color: currentColor;
}

.changes li > .face + .who {
  margin-right: auto;
}

.admin {
  display: inline-block;
  padding: 3px 7px;
  border-radius: var(--round);
  background: color-mix(in srgb, var(--woad) 14%, transparent);
  color: var(--woad-ink);
  font: 600 10px / 1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  vertical-align: middle;
  cursor: help;
}

.chip {
  --size: 34px;
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  max-width: 100%;
  padding: 4px var(--s4) 4px 4px;
  border-radius: var(--round);
  background: var(--sheet);
  text-decoration: none;
  box-shadow: 0 0 0 1px var(--edge);
}

.chip:hover {
  box-shadow: 0 0 0 1.5px var(--edge-strong);
}

.chip.pending {
  box-shadow: none;
  outline: 1.5px dashed var(--edge-strong);
  outline-offset: -1px;
}

.chip > span:last-child {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.chip b {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip small {
  overflow: hidden;
  color: var(--soft);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s3);
}

.rel {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.group {
  display: grid;
  gap: var(--s2);
}

.profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--s4) var(--s5);
  align-items: center;
  padding: var(--s5);
  border-radius: var(--r3);
  background:
    radial-gradient(circle at 12% 30%, color-mix(in srgb, var(--line) 26%, transparent), transparent 55%),
    radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--line) 14%, transparent), transparent 50%),
    var(--sheet);
}

.profile .buttons {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.portrait {
  margin: 0;
}

.photo {
  position: relative;
  display: block;
  border-radius: 50%;
  cursor: pointer;
}

.photo .badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--sheet);
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--soft);
}

.photo:hover .badge {
  color: var(--ink);
}

.who {
  display: grid;
  gap: var(--s1);
  min-width: 0;
}

.who h1 {
  overflow-wrap: anywhere;
}

.tagline {
  color: var(--line-ink);
  font-weight: 500;
}

.life {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s4);
  color: var(--soft);
}

.editing {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  justify-self: start;
  padding: 2px var(--s3) 2px var(--s2);
  border-radius: var(--round);
  background: color-mix(in srgb, var(--ochre) 24%, var(--paper));
  font-size: 15px;
}

.editing .icon {
  width: 16px;
  height: 16px;
}

.bio {
  display: grid;
  gap: var(--s3);
  max-width: 40rem;
  font-size: 17px;
  white-space: pre-line;
}

.bio,
.what {
  overflow-wrap: anywhere;
  hyphens: auto;
}

.danger-zone {
  padding-top: var(--s5);
  border-top: 1px solid var(--edge);
}

/* Facts and findings */

.event {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) auto;
  gap: var(--s2) var(--s4);
  align-items: start;
  padding: var(--s4);
  border-radius: var(--r2);
  background: var(--sheet);
}

.event.pending {
  background: color-mix(in srgb, var(--ochre) 9%, var(--sheet));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ochre) 45%, transparent);
}

.event.rejected {
  opacity: 0.72;
}

.event time {
  padding-top: 2px;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

.what {
  display: grid;
  gap: var(--s2);
  min-width: 0;
  overflow-wrap: anywhere;
}

.what p {
  white-space: pre-line;
}

.kind {
  color: var(--soft);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.kind a {
  letter-spacing: normal;
  text-transform: none;
}

.review {
  display: grid;
  gap: var(--s1);
  margin: 0;
  font-size: 14px;
}

.review > div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: var(--s3);
}

.review dt {
  color: var(--soft);
}

.review dd {
  margin: 0;
}

.thread {
  display: grid;
  gap: var(--s3);
  padding: 0;
  list-style: none;
}

.thread > li {
  display: grid;
  gap: var(--s1);
  padding-left: var(--s3);
  border-left: 3px solid var(--edge);
}

.event.ask {
  grid-template-columns: minmax(0, 1fr) auto;
}

blockquote {
  padding-left: var(--s3);
  border-left: 3px solid color-mix(in srgb, var(--ochre) 55%, transparent);
  color: var(--soft);
  font-style: italic;
}

.source {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  justify-self: start;
  color: var(--woad-ink);
  font-size: 15px;
}

.source .icon {
  width: 16px;
  height: 16px;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s1);
}

.section > .event + .event,
details > .event + .event {
  margin-top: calc(-1 * var(--s2));
}

details.more > summary {
  color: var(--soft);
  cursor: pointer;
}

details.more[open] > summary {
  margin-bottom: var(--s4);
}

details.more {
  display: grid;
  gap: var(--s3);
}

/* Images */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: var(--s4);
}

.gallery.small {
  grid-template-columns: repeat(auto-fill, 4.5rem);
  gap: var(--s2);
}

.gallery figure {
  display: grid;
  align-content: start;
  gap: var(--s2);
  min-width: 0;
}

/* A caption shows its start, the dialog of the image shows all. */
.gallery figcaption {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--soft);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.thumb {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--r2);
  background: var(--paper-2);
}

.gallery.small .thumb {
  border-radius: var(--r1);
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lists */

.problems {
  padding: var(--s5);
  border-radius: var(--r3);
  background: color-mix(in srgb, var(--madder) 10%, var(--sheet));
}

.problems li {
  overflow-wrap: anywhere;
}

.list {
  display: grid;
  gap: var(--s2);
}

.source-row {
  border-radius: var(--r2);
  background: var(--sheet);
}

.source-row > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s4);
  align-items: center;
  padding: var(--s3) var(--s4);
  cursor: pointer;
  list-style: none;
}

.source-row > summary::-webkit-details-marker {
  display: none;
}

.source-row .what {
  gap: 0;
}

.source-row .what b {
  font-weight: 500;
}

.source-row small {
  color: var(--soft);
  font-size: 14px;
}

.source-body {
  display: grid;
  gap: var(--s3);
  padding: 0 var(--s4) var(--s4);
}

.source-body .tools {
  justify-content: flex-start;
}

.source-body ul {
  color: var(--soft);
  overflow-wrap: anywhere;
}

.search input {
  min-height: 52px;
  font-size: 19px;
}

.search-field {
  position: relative;
  display: grid;
}

.search-field input {
  padding-right: 52px;
}

.search-field input::-webkit-search-cancel-button {
  appearance: none;
}

.search-field [data-clear] {
  position: absolute;
  top: 50%;
  right: var(--s1);
  translate: 0 -50%;
}

.search.sorted {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
}

.search.sorted .search-field {
  flex: 1 1 12rem;
  min-width: 0;
}

.results {
  display: grid;
  gap: var(--s2);
  justify-items: start;
}

.results > .group {
  justify-items: start;
}

.results > .group + .group {
  margin-top: var(--s4);
}

.hit:has(.snippet) {
  border-radius: var(--r2);
}

.hit .snippet {
  white-space: normal;
}

.hit mark {
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: inherit;
}

.users li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-radius: var(--r2);
  background: var(--sheet);
}

.users .who {
  gap: 0;
}

.changes li {
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--edge);
  border-radius: 0;
  background: none;
}

.users small {
  color: var(--soft);
}

/* Drawn views: a stage with a canvas, a panel and zoom buttons */

.stage {
  position: relative;
  flex: 1;
  min-height: 24rem;
  height: calc(100dvh - 8.5rem);
  overflow: hidden;
}

.canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.canvas > * {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

.canvas > .moving {
  will-change: transform;
}

.canvas.placing {
  cursor: crosshair;
}

.panel {
  position: absolute;
  top: var(--s4);
  left: var(--s4);
  width: 18rem;
  max-width: calc(100% - 2 * var(--s4));
  max-height: calc(100% - 2 * var(--s4));
  overflow: auto;
  border-radius: var(--r3);
  background: color-mix(in srgb, var(--sheet) 96%, transparent);
  box-shadow: var(--shadow);
}

.panel > summary {
  padding: var(--s3) var(--s4);
  font: 500 19px var(--serif);
  cursor: pointer;
}

.panel-body {
  display: grid;
  gap: var(--s3);
  padding: 0 var(--s4) var(--s4);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: var(--round);
  background: color-mix(in srgb, var(--line) 18%, var(--sheet));
  font-size: 14px;
}

.tag::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
  content: '';
}

.key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  color: var(--soft);
  font-size: 14px;
}

.key i {
  width: 26px;
  border-top: 2px solid var(--stone);
}

.key i.pending {
  margin-left: var(--s2);
  border-top-style: dashed;
}

.zoom {
  position: absolute;
  right: var(--s4);
  bottom: var(--s4);
  display: grid;
  padding: 3px;
  border-radius: var(--round);
  background: var(--sheet);
  box-shadow: var(--shadow);
}

.hint {
  position: absolute;
  right: var(--s8);
  bottom: var(--s4);
  left: var(--s8);
  padding: var(--s2) var(--s4);
  border-radius: var(--round);
  background: color-mix(in srgb, var(--sheet) 92%, transparent);
  text-align: center;
}

/* The tree */

.edges {
  overflow: visible;
  fill: none;
  stroke-linecap: round;
}

.edges .wash {
  stroke: var(--line);
  stroke-width: 7;
  opacity: 0.22;
}

.edges .ink {
  stroke: var(--line);
  stroke-width: 1.8;
}

.edges .bar {
  stroke: var(--stone-ink);
}

.edges .pending {
  stroke-dasharray: 2 7;
}

.edges circle {
  fill: var(--paper);
  stroke: var(--stone-ink);
  stroke-width: 1.6;
}

.card {
  --size: 44px;
  position: absolute;
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: 0 var(--s3);
  border-radius: 18px;
  background: color-mix(in srgb, var(--line) 14%, var(--sheet));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--line) 55%, transparent);
  text-decoration: none;
}

.card:hover {
  box-shadow: inset 0 0 0 2px var(--line);
}

.card.loose {
  background: var(--paper);
  box-shadow: none;
  outline: 1.5px dashed var(--edge-strong);
  outline-offset: -1.5px;
}

.card.loose:hover {
  outline-color: var(--stone-ink);
}

.card.loose em {
  color: var(--hint);
}

.card.root {
  background: color-mix(in srgb, var(--line) 26%, var(--sheet));
  box-shadow: inset 0 0 0 2.5px var(--line);
}

.card-text {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.card b {
  display: -webkit-box;
  overflow: hidden;
  font: 500 16px/1.2 var(--serif);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card small,
.card em {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card small {
  color: var(--soft);
}

.card em {
  color: var(--line-ink);
  font-style: normal;
}

.card-editing {
  position: absolute;
  top: -12px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: var(--round);
  background: color-mix(in srgb, var(--ochre) 30%, var(--paper));
  font-size: 12px;
  white-space: nowrap;
}

.card-editing .icon {
  width: 13px;
  height: 13px;
}

/* The fan */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: var(--s6);
  align-items: start;
}

.fan-wrap {
  overflow-x: auto;
}

/* The fan fits the height of the window beside the header. */
.fan {
  display: block;
  width: 100%;
  min-width: 36rem;
  max-width: calc((100dvh - var(--bar) - 14rem) * 5 / 3);
  height: auto;
  margin: 0 auto;
  font-size: 17px;
}

.fan text {
  fill: var(--ink);
  text-anchor: middle;
  pointer-events: none;
}

.guide {
  fill: none;
}

.fan-cell > path:first-child {
  fill: color-mix(in srgb, var(--line) 22%, var(--sheet));
  stroke: color-mix(in srgb, var(--line) 60%, transparent);
  stroke-width: 1.2;
}

.fan a:hover .fan-cell > path:first-child {
  fill: color-mix(in srgb, var(--line) 38%, var(--sheet));
}

.fan-cell.unknown > path:first-child {
  fill: color-mix(in srgb, var(--paper-2) 60%, transparent);
  stroke: var(--edge-strong);
  stroke-dasharray: 3 5;
}

.fan-cell.unknown text {
  fill: var(--soft);
  font-size: 22px;
}

.fan-cell.pending > path:first-child {
  stroke-dasharray: 3 5;
}

.fan .fan-span {
  fill: var(--soft);
  font-size: 15px;
}

.fan-hub {
  fill: color-mix(in srgb, var(--madder) 20%, var(--sheet));
  stroke: var(--madder);
  stroke-width: 2;
}

.fan .fan-root {
  font: 500 21px var(--serif);
}

.fan .fan-side {
  fill: var(--soft);
  font-size: 15px;
  letter-spacing: 0.12em;
  text-anchor: start;
  text-transform: uppercase;
}

.fan .fan-side.end {
  text-anchor: end;
}

.aside {
  display: grid;
  gap: var(--s4);
}

.box {
  display: grid;
  gap: var(--s3);
  padding: var(--s5);
  border-radius: var(--r3);
  background: var(--sheet);
}

.meter {
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.meter svg {
  flex: none;
  width: 64px;
}

.meter circle {
  fill: none;
  stroke: var(--paper-3);
  stroke-width: 6;
}

.meter circle.value {
  stroke: var(--birch);
  stroke-linecap: round;
}

.level {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s1) var(--s2);
}

.bar-row {
  display: flex;
  grid-column: 1 / -1;
  gap: 2px;
}

.bar-row i {
  flex: 1;
  height: 9px;
  border-radius: 3px;
  background: var(--line);
}

.bar-row i.unknown {
  background: var(--paper-3);
}

.bar-row i.pending {
  opacity: 0.5;
}

.gap {
  display: block;
  padding: var(--s2) var(--s3);
  border-radius: var(--r1);
  background: var(--paper-2);
  text-decoration: none;
}

.gap:hover {
  background: var(--paper-3);
}

/* The timeline */

.timeline {
  --names: 15rem;
  max-height: calc(100dvh - 16rem);
  min-height: 12rem;
  overflow: auto;
  border-radius: var(--r3);
  background: var(--sheet);
}

.tl-body {
  position: relative;
  min-width: calc(var(--names) + 34rem);
  padding-bottom: var(--s3);
}

.tl-row {
  display: grid;
  grid-template-columns: var(--names) minmax(0, 1fr);
}

.tl-name {
  --size: 30px;
  position: sticky;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-width: 0;
  padding: var(--s1) var(--s3) var(--s1) var(--s4);
  background: var(--sheet);
  text-decoration: none;
}

.tl-name > span:last-child {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.tl-name b {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-name small {
  color: var(--soft);
  font-size: 13px;
}

.tl-head {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--edge);
  background: var(--sheet);
}

.tl-axis {
  position: relative;
  height: 3.6rem;
}

.tl-track {
  position: relative;
  height: 2.6rem;
}

.tl-axis,
.tl-track {
  background: linear-gradient(to right, var(--edge) 1px, transparent 1px) 0 0 / var(--decade) 100%;
}

.tl-epoch {
  position: absolute;
  top: 6px;
  overflow: hidden;
  padding: 0 6px;
  border-left: 2px solid var(--paper-3);
  color: var(--soft);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 18px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.tl-tick {
  position: absolute;
  bottom: 6px;
  padding-left: var(--s1);
  color: var(--soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.tl-year {
  position: absolute;
  bottom: 4px;
  left: calc(var(--cursor) * 100%);
  display: none;
  padding: 0 6px;
  border-radius: var(--round);
  background: var(--woad-ink);
  color: var(--sheet);
  font-size: 13px;
  font-weight: 500;
  translate: -50% 0;
}

.tl-group {
  position: sticky;
  left: 0;
  display: flex;
  align-items: center;
  gap: var(--s2);
  width: max-content;
  padding: var(--s4) var(--s4) var(--s1);
}

.tl-group::before {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
  content: '';
}

.tl-rest {
  position: sticky;
  left: 0;
  width: max-content;
  max-width: 100%;
  padding: var(--s1) var(--s4);
  color: var(--soft);
  font-size: 14px;
}

.tl-bar {
  position: absolute;
  top: calc(50% - 6px);
  height: 12px;
  border-radius: var(--round);
  background: color-mix(in srgb, var(--line) 75%, transparent);
}

.tl-bar.open {
  background: linear-gradient(to right, color-mix(in srgb, var(--line) 75%, transparent) 45%, transparent);
}

.tl-mark {
  position: absolute;
  top: calc(50% - 3px);
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--sheet);
}

.tl-mark.union {
  top: calc(50% - 5px);
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border: 2px solid var(--sheet);
  border-radius: 2px;
  background: var(--ink);
  rotate: 45deg;
}

.tl-end {
  position: absolute;
  top: calc(50% - 10px);
  padding-left: var(--s2);
  color: var(--soft);
  font-size: 13px;
}

.tl-age {
  position: absolute;
  top: 0;
  left: calc(var(--cursor) * 100%);
  display: none;
  padding-left: 5px;
  color: var(--woad-ink);
  font-size: 12px;
  font-weight: 500;
}

.tl-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--names) + (100% - var(--names)) * var(--now));
  width: 1px;
  background: var(--soft);
  opacity: 0.4;
  pointer-events: none;
}

.tl-line.cursor {
  left: calc(var(--names) + (100% - var(--names)) * var(--cursor));
  display: none;
  background: var(--woad-ink);
  opacity: 1;
}

.probing :is(.tl-line.cursor, .tl-age, .tl-year) {
  display: block;
}

.probing .tl-end {
  visibility: hidden;
}

.hint-line {
  color: var(--soft);
  font-size: 14px;
  text-align: center;
}

/* The map */

@property --land-fill {
  syntax: '<color>';
  inherits: true;
  initial-value: transparent;
}

@property --land-edge {
  syntax: '<color>';
  inherits: true;
  initial-value: transparent;
}

@property --land-name {
  syntax: '<color>';
  inherits: true;
  initial-value: transparent;
}

/* The canvas reads the colours of the land as resolved values. */
.land {
  --land-fill: color-mix(in srgb, var(--birch) 14%, var(--sheet));
  --land-edge: color-mix(in srgb, var(--birch-ink) 45%, transparent);
  --land-name: var(--soft);

  width: 100%;
  height: 100%;
}

.map {
  overflow: visible;
  pointer-events: none;
}

.arcs path {
  fill: none;
  stroke: var(--line);
  stroke-linecap: round;
  stroke-width: 2px;
  transition: opacity 0.15s;
}

.arcs .loose {
  stroke-dasharray: 4px 5px;
}

.pin {
  cursor: pointer;
  pointer-events: auto;
}

.placing .pin {
  pointer-events: none;
}

.pin:focus-visible {
  outline: none;
}

.pin:focus-visible circle {
  stroke: var(--ink);
}

.pin circle {
  fill: var(--line);
  stroke: var(--sheet);
  stroke-width: 2px;
}

.pin text {
  fill: var(--ink);
  font: 500 14px var(--serif);
  paint-order: stroke;
  stroke: var(--sheet);
  stroke-width: 3px;
}

.pin .pin-count {
  fill: var(--sheet);
  font: 600 12px var(--sans);
  stroke: none;
  text-anchor: middle;
}

.map .dim {
  opacity: 0.3;
}

.map .faded {
  opacity: 0.12;
}

.map-card-tools {
  display: flex;
}

.map-place + .map-place {
  margin-top: var(--s2);
}

.map-place h3 {
  margin: var(--s2) 0 0;
  padding-left: var(--s2);
  color: var(--soft);
  font: 600 12px var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* The card of a place lies over the panel. */
.map-card {
  z-index: 1;
  width: min(20rem, calc(100% - var(--s4)));
  max-height: 50%;
  padding: var(--s3);
  overflow: auto;
  border-radius: var(--r2);
  background: var(--sheet);
  box-shadow: var(--shadow);
  cursor: auto;
}

.map-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding-left: var(--s2);
  font-family: var(--serif);
  font-size: 18px;
}

.map-people {
  display: grid;
  margin: var(--s2) 0 0;
  padding: 0;
  list-style: none;
}

.map-people li {
  display: flex;
  align-items: center;
  gap: var(--s1);
}

.map-person {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--s3);
  min-width: 0;
  padding: var(--s2);
  border-radius: var(--r1);
  color: inherit;
  text-decoration: none;
}

.map-person:hover {
  background: var(--paper-2);
}

.map-person span {
  display: grid;
  min-width: 0;
}

.map-person small {
  overflow: hidden;
  color: var(--soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split.narrowed {
  grid-template-columns: 18rem minmax(0, 1fr);
}

.findings {
  display: grid;
  gap: var(--s5);
  min-width: 0;
}

.picker {
  position: sticky;
  top: calc(var(--bar) + var(--s4));
  max-height: calc(100dvh - var(--bar) - 2 * var(--s4));
  overflow-y: auto;
  scrollbar-width: thin;
}

.picker-select {
  display: none;
  width: 100%;
}

.segments.wrap {
  flex-wrap: wrap;
  border-radius: var(--r2);
}

.segments.wrap a {
  flex: none;
}

.segments small {
  color: var(--soft);
  font-size: 12px;
}

@media (max-width: 720px) {
  .split.narrowed {
    grid-template-columns: minmax(0, 1fr);
  }

  .picker {
    position: static;
    max-height: none;
  }

  .picker-select {
    display: block;
  }

  .picker .picker-list {
    display: none;
  }
}

.picks,
.places {
  display: grid;
  gap: var(--s1);
}

.pick {
  --size: 32px;
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 40px;
  padding: 4px var(--s3) 4px 4px;
  border-radius: var(--round);
  text-decoration: none;
}

.pick > b {
  padding-left: var(--s2);
  font-weight: 500;
}

.pick:hover,
.pick[aria-current] {
  background: var(--paper-2);
}

.pick span:last-child,
.place > span {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.pick b,
.place b {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pick small,
.place small {
  color: var(--soft);
  font-size: 13px;
}

.place {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .timeline {
    --names: 10rem;
  }

  .tl-name .avatar {
    display: none;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 28px;
  }

  .page {
    gap: var(--s6);
    padding: var(--s5) var(--s4) var(--s7);
  }

  dialog.sheet {
    padding: var(--s5);
  }

  .profile {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }

  .avatar.big {
    --size: 88px;
  }

  .event,
  .event.ask {
    grid-template-columns: minmax(0, 1fr);
  }

  .event time:empty {
    display: none;
  }

  .tools {
    justify-content: flex-start;
  }

  .hint {
    right: var(--s4);
    left: var(--s4);
    bottom: auto;
    top: var(--s4);
  }
}

/* Keyboard and screen readers */

.skip {
  position: absolute;
  top: var(--s2);
  left: var(--s2);
  z-index: 20;
  padding: var(--s2) var(--s4);
  border-radius: var(--r1);
  background: var(--sheet);
  color: var(--ink);
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

main:focus {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
    scroll-behavior: auto !important;
  }
}

.bar .theme {
  display: contents;
}

/* Overview */

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s5);
  color: var(--soft);
  font-size: 18px;
}

.facts a,
.figures a {
  color: inherit;
  text-decoration: none;
}

.facts a:hover {
  color: var(--ink);
}

.figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-block: var(--s6);
  border-block: 1px solid var(--edge);
}

.figures li + li {
  border-left: 1px solid var(--edge);
}

.figures a {
  display: grid;
  gap: var(--s1);
  padding: var(--s4) var(--s4) var(--s4) var(--s5);
}

.figures li:first-child a {
  padding-left: 0;
}

.figures b {
  font: 500 36px/1.1 var(--serif);
  font-variant-numeric: lining-nums;
  transition: color 0.15s ease;
}

.figures small {
  color: var(--soft);
}

.figures a:hover b {
  color: var(--accent);
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--s5) var(--s7);
}

.rows li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  min-height: 48px;
  border-bottom: 1px solid var(--edge);
}

.rows small,
.team small {
  color: var(--soft);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
}

.overview > .section {
  margin-top: var(--s7);
}

.overview h3 {
  margin-top: var(--s2);
}

@media (max-width: 40rem) {
  .figures a {
    padding: var(--s3) var(--s2) var(--s3) var(--s3);
  }

  .figures b {
    font-size: 26px;
  }

  .figures small {
    font-size: 13px;
  }
}

fieldset.stack {
  margin: 0;
  padding: 0;
  border: 0;
}

fieldset.stack > legend {
  margin-bottom: var(--s2);
  padding: 0;
  font-weight: 500;
}

/* Forschung */

.team {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s5);
  margin-bottom: var(--s4);
}

.closed h2 {
  margin: var(--s4) 0 var(--s2);
  font-size: 18px;
}

.exchange {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3) var(--s4);
  margin-bottom: var(--s5);
  padding: var(--s4) var(--s5);
}

.exchange .what {
  display: grid;
  margin-right: auto;
}

.exchange h2 {
  font-size: 20px;
}

/* A file field behind its button, still reached by keyboard and screen readers. */
.hidden-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

label.button {
  position: relative;
}

label.button:focus-within {
  outline: 2px solid var(--woad);
  outline-offset: 2px;
}

.exchange .error {
  flex-basis: 100%;
}
