:root {
  color-scheme: light;
  --ink: #14191e;
  --paper: #f2f5f3;
  --surface: #ffffff;
  --rail-blue: #174ea6;
  --rail-blue-dark: #103d84;
  --rail-blue-line: #7ca0d8;
  --fact: #0b6b3a;
  --stop: #a62b2b;
  --muted: #56616a;
  --placeholder: #65717a;
  --divider: #c8d0d3;
  --divider-dark: #394047;
  --selection: #b8d2fb;
  --code-ink: #26323a;
  --table-header: #e6eceb;
  --print-ink: #000000;
  --display: "DIN Condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --body: "Avenir Next", "Helvetica Neue", sans-serif;
  --focus: 3px solid #174ea6;
  --page-padding: clamp(1rem, 4vw, 4rem);
  --content-width: 100rem;
  --header-height: 4.5rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

a {
  color: var(--rail-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: var(--focus);
  outline-offset: 3px;
}

::selection {
  background: var(--selection);
  color: var(--ink);
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  min-height: 44px;
  padding: 0.65rem 1rem;
  background: var(--surface);
  color: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.research-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: minmax(17rem, 1fr) auto;
  align-items: stretch;
  background: var(--ink);
  color: var(--surface);
  border-bottom: 1px solid var(--divider-dark);
}

.research-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  min-height: var(--header-height);
  padding: 0 1rem;
  color: inherit;
  text-decoration: none;
}

.research-brand__mark {
  width: 2.7rem;
  height: 2.7rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: var(--rail-blue);
  border: 1px solid var(--rail-blue-line);
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 700;
}

.research-brand strong,
.research-brand small {
  display: block;
}

.research-brand strong {
  font-size: 0.9rem;
}

.research-brand small {
  overflow: hidden;
  color: #c6cdd2;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-nav {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
}

.research-nav a {
  min-height: var(--header-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  border-inline-start: 1px solid var(--divider-dark);
  color: #d7dce0;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.research-nav a:hover {
  background: #20272d;
  color: var(--surface);
}

.research-nav .research-nav__primary {
  background: var(--rail-blue);
  color: var(--surface);
}

.research-nav .research-nav__primary:hover {
  background: var(--rail-blue-dark);
}

.route-code,
.reader-aside__label {
  margin: 0;
  color: var(--rail-blue);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.document-route {
  min-height: 3.2rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--ink);
  color: var(--muted);
  font-size: 0.7rem;
}

.document-route span:first-child {
  color: var(--rail-blue);
  font-weight: 750;
  letter-spacing: 0.06em;
}

.document-route span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-route a {
  font-weight: 650;
  white-space: nowrap;
}

.research-footer {
  min-height: 5.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--page-padding);
  background: var(--ink);
  color: #d7dce0;
  font-size: 0.76rem;
}

.research-footer a {
  color: var(--surface);
}

@media (max-width: 58rem) {
  .research-header {
    grid-template-columns: minmax(13rem, 1fr) auto;
  }

  .research-nav a {
    display: none;
  }

  .research-nav .research-nav__primary {
    display: inline-flex;
  }
}

@media (max-width: 42rem) {
  :root {
    --header-height: 4rem;
  }

  .research-brand {
    min-height: var(--header-height);
  }

  .research-brand__mark {
    width: 2.35rem;
    height: 2.35rem;
  }

  .research-brand small {
    display: none;
  }

  .research-nav a {
    min-height: var(--header-height);
    padding-inline: 0.8rem;
    font-size: 0.68rem;
  }

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

  .document-route a {
    grid-column: 1 / -1;
  }

  .research-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
