/* The look of the documentation: a ReDoc-shaped reference, with the greens FastAPI made familiar and
   a paper-quiet surface around them.

   One token, two themes. Each colour is a `light-dark()` pair, so there is exactly one line per
   token; `color-scheme` picks the side, and the switch in the sidebar sets it. With no choice made
   the page follows the operating system, which is what `light dark` means. */

:root {
  color-scheme: light dark;

  --ink: light-dark(#1a222b, #e7edf2);
  --ink-soft: light-dark(#4d5a66, #a3b2bf);
  --ink-faint: light-dark(#798692, #7b8a97);
  --paper: light-dark(#fdfcfa, #0b1014);
  --paper-sunk: light-dark(#f6f5f1, #0f151a);
  --paper-raised: light-dark(#ffffff, #121920);
  --line: light-dark(#e5e1d9, #1e262e);
  --line-strong: light-dark(#cec8bc, #2b3742);
  --accent: light-dark(#0f766e, #5fd4c4);
  --accent-soft: light-dark(#e9f3f0, #0d2a27);
  --accent-ink: light-dark(#0b5d55, #7fe3d5);
  --warn: light-dark(#b45309, #f0b429);
  --code-bg: light-dark(#f6f4ef, #0e1519);
  --sans: "Inter", "Segoe UI", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --serif:
    "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia,
    "Times New Roman", serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, "Cascadia Mono", Menlo, monospace;
}

/* The switch writes one of these; without it, the platform decides. */
:root[data-theme="light"] {
  color-scheme: light;
}

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

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

::selection {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  font-variant-ligatures: no-contextual;
}

button,
input,
textarea,
select {
  font-variant-ligatures: no-contextual;
}

code,
pre,
kbd {
  font-family: var(--mono);
  font-size: 0.875em;
  font-variant-ligatures: no-contextual;
}

a {
  color: var(--accent-ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* One focus ring for everything you can tab to; the column handles draw their own. */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Scrollbars: never the browser's. The page thumb hides at the top and shows once you move, and the
   gutter is always reserved so nothing jumps. */
@supports selector(::-webkit-scrollbar) {
  html::-webkit-scrollbar,
  .scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }

  html::-webkit-scrollbar-track,
  .scroll::-webkit-scrollbar-track {
    background: transparent;
  }

  html::-webkit-scrollbar-thumb,
  .scroll::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    background-color: color-mix(in srgb, var(--ink) 22%, transparent);
    background-clip: content-box;
  }

  html.at-top::-webkit-scrollbar-thumb {
    background-color: transparent;
  }

  .scroll:hover::-webkit-scrollbar-thumb {
    background-color: color-mix(in srgb, var(--ink) 38%, transparent);
  }
}

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--ink) 26%, transparent) transparent;
  }

  html.at-top {
    scrollbar-color: transparent transparent;
  }
}

/* Every other scroller — the sidebar, the margin column, a code block — gets the same treatment:
   thin, and in the page's own ink, so no default chrome shows through. The dark panel's thumb has
   to come from the other end of the scale. */
@supports selector(::-webkit-scrollbar) {
  .side::-webkit-scrollbar,
  .rail::-webkit-scrollbar,
  pre::-webkit-scrollbar,
  .transcript .body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  .side::-webkit-scrollbar-track,
  .rail::-webkit-scrollbar-track,
  pre::-webkit-scrollbar-track,
  .transcript .body::-webkit-scrollbar-track {
    background: transparent;
  }

  .side::-webkit-scrollbar-thumb,
  pre::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    background-color: color-mix(in srgb, var(--ink) 20%, transparent);
    background-clip: content-box;
  }

  .side:hover::-webkit-scrollbar-thumb,
  pre:hover::-webkit-scrollbar-thumb {
    background-color: color-mix(in srgb, var(--ink) 34%, transparent);
  }

  .rail::-webkit-scrollbar-thumb,
  .transcript .body::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    background-color: rgb(234 242 248 / 18%);
    background-clip: content-box;
  }

  .rail:hover::-webkit-scrollbar-thumb,
  .transcript .body:hover::-webkit-scrollbar-thumb {
    background-color: rgb(234 242 248 / 32%);
  }
}

@supports not selector(::-webkit-scrollbar) {
  .side,
  .rail,
  pre,
  .transcript .body {
    scrollbar-width: thin;
  }

  .side,
  pre {
    scrollbar-color: color-mix(in srgb, var(--ink) 24%, transparent) transparent;
  }

  .rail,
  .transcript .body {
    scrollbar-color: rgb(234 242 248 / 24%) transparent;
  }
}

/* Three columns, the way a reference is read: what is in the book, the book itself, and — in the
   margin, the way ReDoc keeps a sample — what the wire actually says. Hairlines do the dividing;
   nothing is boxed twice. */
.shell {
  position: relative;
  display: grid;
  grid-template-columns:
    var(--nav-w, 244px) minmax(0, 1fr)
    var(--rail-w, 304px);
  grid-template-areas: "nav book wire";
  min-height: 100vh;
}

/* Two handles, one on each boundary: grab the hairline and the column follows. They are invisible
   until touched, and they are the only thing on the page that changes the page's own shape. */
.splitter {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 11px;
  z-index: 4;
  cursor: col-resize;
  touch-action: none;
  outline: none;
}

.splitter[data-resize="nav"] {
  left: calc(var(--nav-w, 244px) - 5px);
}

.splitter[data-resize="rail"] {
  left: calc(100% - var(--rail-w, 304px) - 5px);
}

.splitter::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 5px;
  width: 1px;
  background: transparent;
  transition: background 120ms ease, width 120ms ease;
}

.splitter:hover::after,
.splitter[data-dragging]::after,
.splitter:focus-visible::after {
  background: var(--accent);
}

.splitter:focus-visible::after {
  width: 2px;
  left: 4.5px;
}

/* While a column is being dragged, nothing else on the page should react to the pointer. */
body.resizing {
  cursor: col-resize;
  user-select: none;
}

/* The sidebar: quiet, sticky, and never wider than a column of links. */
.side {
  grid-area: nav;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--paper);
  padding: 28px 22px 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 4px;
}

.brand span small {
  display: block;
  font-weight: 450;
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0;
}

/* Day and night, as one button: the icon shown is the theme it switches to. */
.theme-toggle {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle svg {
  grid-area: 1 / 1;
  width: 15px;
  height: 15px;
}

.theme-toggle .sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .sun {
  display: block;
}

:root[data-theme="dark"] .theme-toggle .moon {
  display: none;
}

/* No switch yet, and the platform is dark: the sun is still what the button would do. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun {
    display: block;
  }

  :root:not([data-theme="light"]) .theme-toggle .moon {
    display: none;
  }
}

.side nav {
  display: grid;
  gap: 2px;
  margin-top: 22px;
}

.side nav p {
  margin: 18px 0 6px;
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.side nav a {
  display: block;
  padding: 6px 10px 6px 8px;
  border-left: 2px solid transparent;
  color: var(--ink-soft);
  font-size: 14px;
}

.side nav a:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--ink);
  text-decoration: none;
}

/* The page you are on is marked by a rule at its edge, not by a box around it. */
.side nav a[aria-current="page"] {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 550;
}

.side footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-faint);
}

main {
  grid-area: book;
  min-width: 0;
  width: 100%;
  max-width: 812px;
  margin-inline: auto;
  padding: 48px clamp(22px, 3.4vw, 52px) 96px;
}

/* The margin column: what the page is, and what the protocol says on the wire. Sticky, scrolls on
   its own, and separated from the text by nothing but a hairline. */
.rail {
  grid-area: wire;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--paper-sunk);
  padding: 30px 20px 44px;
  font-size: 13px;
}

.rail > * + * {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.rail h4 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.rail p {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

/* The wire, told one message to a line: each message becomes a row with its own hairline. */
.rail .transcript {
  margin: 0;
}

.rail .transcript header {
  padding: 7px 12px;
  font-size: 11px;
}

.rail .transcript .body {
  max-height: none;
  padding: 2px 0;
  font-size: 11px;
  line-height: 1.65;
}

.rail .transcript .line {
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  padding: 6px 12px;
  border-top: 1px solid var(--line);
}

.rail .transcript .line:first-child {
  border-top: 0;
}

.rail .transcript .who {
  text-align: left;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* A fact list: two columns, a hairline between rows, no boxes. */
.facts {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.facts div {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}

/* A leader, dotted, the way a table of contents carries the eye across a gap. */
.facts .lead {
  flex: 1;
  min-width: 12px;
  transform: translateY(-3px);
  border-bottom: 1px dotted rgb(205 216 227 / 28%);
}

.facts div:first-child {
  border-top: 0;
}

.facts dt {
  color: var(--ink-faint);
}

.facts dd {
  margin: 0;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* An outline of the page: the packages, and what each one holds. */
.outline {
  display: grid;
  gap: 2px;
}

.outline a {
  display: block;
  padding: 3px 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.outline a:hover {
  color: var(--ink);
  text-decoration: none;
}

.outline a.sub {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.outline a.sub::after {
  content: "";
  order: 1;
  flex: 1;
  min-width: 8px;
  transform: translateY(-3px);
  border-bottom: 1px dotted var(--line);
}

.outline a.sub em {
  order: 2;
}

.outline a.sub em {
  font: 500 11px/1 var(--mono);
  font-style: normal;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.outline .sub {
  padding-left: 12px;
  font-size: 12px;
  color: var(--ink-faint);
  border-left: 1px solid var(--line);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.01em;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 45px);
  line-height: 1.1;
  letter-spacing: -0.012em;
  margin: 20px 0 14px;
  font-weight: 600;
  text-wrap: balance;
}

h1 .thin {
  color: var(--ink-faint);
  font-weight: 480;
}

.lede {
  max-width: 62ch;
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 26px;
}

h2 {
  text-wrap: balance;
  font-size: 23px;
  letter-spacing: -0.018em;
  margin: 56px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-weight: 640;
  scroll-margin-top: 24px;
}

h2 code {
  font-size: 0.86em;
}

h3 {
  font-size: 15px;
  letter-spacing: 0.01em;
  margin: 34px 0 10px;
  font-weight: 600;
  color: var(--ink-soft);
}

h3.group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 34px 0 2px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

h3.group .label {
  text-transform: uppercase;
  white-space: nowrap;
}

h3.group .rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

h3.group .count {
  font: 500 11px/1 var(--mono);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

p {
  margin: 0 0 14px;
  text-wrap: pretty;
}

.package h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.package h2 .count {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.blurb {
  color: var(--ink-soft);
  max-width: 68ch;
}

/* Code: a slab that scrolls on its own, with a hairline and no chrome. */
pre {
  margin: 14px 0 18px;
  padding: 16px 18px;
  background: var(--code-bg);
  border: 1px solid var(--line);
  overflow: auto;
  line-height: 1.6;
  color: var(--ink);
}

pre code {
  font-size: 13px;
  white-space: pre;
}

:not(pre) > code {
  padding: 1px 4px;
  border: 1px solid var(--line);
  background: var(--paper-sunk);
  overflow-wrap: anywhere;
}

/* Cards: the feature grid, and the reference entries, share one surface. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 232px), 1fr));
  gap: 14px;
  margin: 18px 0 10px;
}

.card {
  border: 1px solid var(--line-strong);
  padding: 18px 18px 16px;
  background: var(--paper-raised);
}

.card h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 620;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.card svg {
  flex: none;
  color: var(--accent);
}

/* The reference: one entry per public item, in two columns — the name to look up on the left, what
   it takes, gives back and means on the right, with a hairline between them. The same shape ReDoc
   gives a field. */
.item {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.item:last-child {
  border-bottom: 0;
}

.entry-name {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 5px;
  padding: 14px 16px 14px 0;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.entry-name code {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.entry-body {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 13px 0 14px 16px;
  min-width: 0;
}

/* A name in a heading or a row is a name, not a chip: the chip belongs to code quoted in prose. */
.package h2 code,
.entry-name code,
.outline code,
.side nav code {
  padding: 0;
  border: 0;
  background: transparent;
}

.entry-body .sig {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}

.entry-body .sig code {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  color: inherit;
}

/* What a call gives back is what a reader scans for, so it gets the accent. */
.entry-body .sig .ret {
  color: var(--accent-ink);
}

/* The row you are on, said with a wash rather than an outline. */
.item:hover {
  background: color-mix(in srgb, var(--accent) 3%, transparent);
}

.kind {
  flex: none;
  margin-top: 2px;
  padding: 1px 7px;
  font: 600 10.5px/1.7 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
}

.kind.struct,
.kind.enum {
  background: #5b7cfa;
}

.kind.trait {
  background: #8b5cf6;
}

.kind.error {
  background: #e0537a;
}

.kind.value {
  background: #0ea5e9;
}

.kind.alias {
  background: #64748b;
}

.doc {
  padding-left: 2px;
  color: var(--ink-soft);
  font-size: 14.5px;
  max-width: 74ch;
}

.doc p {
  margin: 0 0 8px;
}

.doc p:last-child {
  margin-bottom: 0;
}

/* A transcript, for a library whose product is a conversation. */
.transcript {
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--paper-raised);
  margin: 18px 0 8px;
}

.transcript header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-sunk);
  font: 500 12px/1.4 var(--mono);
  color: var(--ink-faint);
}

.transcript .body {
  padding: 12px 0;
  font: 12.5px/1.75 var(--mono);
  max-height: 320px;
  overflow: auto;
}

.transcript .line {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  padding: 2px 14px;
}

.transcript .line:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.transcript .who {
  color: var(--ink-faint);
  text-align: right;
}

.transcript .line.agent .who {
  color: var(--accent-ink);
}

.transcript .what {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
}

.transcript .line.agent .what {
  color: var(--ink);
}

/* Tables: the consistency findings, and anything else that is a grid of facts. */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  font-weight: 600;
}

td code {
  white-space: nowrap;
}

.pass {
  color: var(--accent-ink);
  font-weight: 600;
}

.note {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 12px 16px;
  margin: 18px 0;
  color: var(--accent-ink);
  font-size: 14.5px;
}

.note.warn {
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  color: var(--ink);
}

footer.page {
  margin-top: 64px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
}

/* Narrow screens: the sidebar becomes a strip of links above the content, nothing scrolls
   sideways, and long identifiers break instead of pushing the page wide. */
/* The sample panel's own bar: two transports to switch between, and a copy button, the way a
   request sample is presented. */
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 0 10px;
  border-bottom: 1px solid #2a3947;
}

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

.tabs button {
  appearance: none;
  border: 0;
  padding: 3px 10px;
  background: transparent;
  color: #8b9bab;
  font: 600 10.5px/1.6 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.tabs button:hover {
  color: #eaf2f8;
}

.tabs button[aria-selected="true"] {
  background: #22303c;
  color: #eaf2f8;
}

.copy {
  appearance: none;
  padding: 2px 10px;
  border: 1px solid #33434f;
  background: transparent;
  color: #9fb0c0;
  font: 500 10.5px/1.7 var(--mono);
  letter-spacing: 0.04em;
  cursor: pointer;
}

.copy:hover {
  color: #eaf2f8;
  border-color: #4a5d6b;
}

.tabs button:focus-visible,
.copy:focus-visible {
  outline: 2px solid #4dd4c4;
  outline-offset: 2px;
}

/* The second sample is the same turn over HTTP, so it reads as a request and a stream. */
.rail.wire .sample {
  margin: 0;
  padding: 12px 0 0;
  border: 0;
  background: transparent;
  color: #b9c7d4;
  font-size: 10.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The pre's own `white-space: pre` on code would keep the sample from wrapping. */
.rail.wire .sample code {
  white-space: inherit;
  overflow-wrap: inherit;
  font-size: inherit;
}

/* The one word in the sample that is a verb. */
.rail.wire .sample .m {
  color: #4dd4c4;
  font-weight: 600;
}

/* The wire: the margin column kept dark, the way a sample panel is kept dark — this is what the
   protocol says, not prose about it, and it should never be mistaken for prose. */
.rail.wire {
  padding: 0 0 40px;
  background: #1b2732;
  border-left-color: #23303c;
  color: #cdd8e3;
}

.rail.wire > div {
  padding: 18px 20px;
}

.rail.wire > * + * {
  border-top: 1px solid #2a3947;
}

.rail.wire h4 {
  color: #7f93a5;
}

.rail.wire p {
  color: #9fb0c0;
}

.rail.wire .verb {
  display: inline-block;
  margin-right: 8px;
  padding: 0 7px;
  background: #0f766e;
  color: #ffffff;
  font: 600 9.5px/1.8 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.rail.wire .transcript {
  border: 0;
  background: transparent;
}

.rail.wire .transcript header {
  padding: 0 0 12px;
  border-bottom: 1px solid #2a3947;
  background: transparent;
  color: #9fb0c0;
}

.rail.wire .transcript .body {
  padding: 0;
}

.rail.wire .transcript .line {
  padding: 8px 0;
  border-top: 1px solid #22313d;
}

.rail.wire .transcript .line:first-child {
  border-top: 0;
}

.rail.wire .transcript .line:hover {
  background: transparent;
}

.rail.wire .transcript .who {
  color: #7f93a5;
}

.rail.wire .transcript .line.agent .who {
  color: #4dd4c4;
}

.rail.wire .transcript .what {
  color: #b9c7d4;
}

.rail.wire .transcript .line.agent .what {
  color: #eaf2f8;
}

/* The wire is JSON, and JSON reads better with its parts told apart. */
.rail.wire .k {
  color: #7fd1f0;
}

.rail.wire .s {
  color: #e8b98a;
}

.rail.wire .n {
  color: #a5d6a7;
}

.rail.wire .b {
  color: #c3a6ff;
}

.rail.wire .facts div {
  border-top-color: #2a3947;
}

.rail.wire .facts dt {
  color: #7f93a5;
}

.rail.wire .facts dd {
  color: #e2eaf2;
}

/* The three columns give ground before the margin column gives up: a narrower page, not a shorter
   one. */
@media (width <= 1180px) {
  .shell {
    grid-template-columns: 220px minmax(0, 1fr) 264px;
  }

  /* The columns are the stylesheet's from here down, so there is nothing to grab. */
  .splitter {
    display: none;
  }
}

/* Past this point the margin column has nothing left to be a margin of: it becomes the end of the
   article, and an outline — which would only repeat the article — steps out of the way. */
@media (width <= 980px) {
  .shell {
    grid-template-columns: 244px minmax(0, 1fr);
    grid-template-areas: "nav book" "nav wire";
  }

  .rail {
    position: static;
    height: auto;
    width: 100%;
    max-width: 812px;
    margin-inline: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .rail.outline {
    display: none;
  }
}

@media (width <= 860px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "nav" "book" "wire";
  }

  .side {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px 18px 14px;
  }

  .side nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .side nav p,
  .side footer {
    display: none;
  }

  /* A strip of links is marked from below, not from the left. */
  .side nav a {
    border-left: 0;
    border-bottom: 2px solid transparent;
    padding: 6px 10px;
  }

  .side nav a[aria-current="page"] {
    border-bottom-color: var(--accent);
  }

  main {
    padding: 28px 18px 72px;
  }

  h1 {
    font-size: 28px;
  }

  .transcript .line {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .transcript .who {
    text-align: left;
  }
}

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