@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url(fonts/ibm-plex-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(fonts/jetbrains-mono-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
 * Layout system. Every page centres its header, content and footer in one
 * band of width --cap with --gutter on each side. Content sits in columns:
 * a text column of --column, wide enough for about 80 characters of
 * running text, and side columns of --side for navigation and outlines,
 * --gap apart. Every block of a column, text, code, tables and figures
 * alike, spans the column's full width, so all share the same edges; wide
 * code and tables scroll inside it. The cap follows the kind of page: the
 * frame of the documentation and the conversion pages, a text column
 * between two side columns (w-frame), the composed pages of wider grids
 * (w-wide) and the playground (w-tool). Wide screens get more columns
 * rather than longer lines.
 *
 * Breakpoints, the same for every page:
 *   600px   two columns of cards; the playground's panes side by side
 *   900px   the header navigation in one row; side columns appear
 *   1240px  the home page's hero beside the converter; the outline column
 *           of the documentation; three playground columns
 *   1600px  four playground columns
 * Components that live in columns of varying width use container queries.
 */
:root {
  --bg: #f3f4f6;
  --sf: #ffffff;
  --tx: #11161c;
  --mu: #5b6672;
  --ac: #0a7c72;
  --on-ac: #ffffff;
  --ln: #d9dde3;
  --ln-ctl: #828b96;
  --sub: #f7f8fa;
  --shade: rgba(17, 22, 28, 0.16);
  --warn: #9a5b00;
  --hl-k: #8b3fb0;
  --hl-s: #9a5b00;
  --hl-t: #0a7c72;
  --hl-a: #3651c9;
  --hl-n: #b3261e;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --gutter: clamp(16px, 3.2vw, 48px);
  --column: 35rem;
  --side: 240px;
  --gap: 48px;
  --cap-frame: calc(var(--column) + 2 * (var(--gap) + var(--side)));
  --cap-wide: 1200px;
  --cap-tool: 1920px;
  --h1: 30px;
  --radius: 8px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0f13;
    --sf: #141920;
    --tx: #e2e7ee;
    --mu: #8792a1;
    --ac: #35c9b0;
    --on-ac: #0c0f13;
    --ln: #252c36;
    --ln-ctl: #646e7a;
    --sub: #10151b;
    --shade: rgba(0, 0, 0, 0.55);
    --warn: #f0b45a;
    --hl-k: #c792ea;
    --hl-s: #f0b45a;
    --hl-t: #35c9b0;
    --hl-a: #82aaff;
    --hl-n: #f78c6c;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0c0f13;
  --sf: #141920;
  --tx: #e2e7ee;
  --mu: #8792a1;
  --ac: #35c9b0;
  --on-ac: #0c0f13;
  --ln: #252c36;
  --ln-ctl: #646e7a;
  --sub: #10151b;
  --shade: rgba(0, 0, 0, 0.55);
  --warn: #f0b45a;
  --hl-k: #c792ea;
  --hl-s: #f0b45a;
  --hl-t: #35c9b0;
  --hl-a: #82aaff;
  --hl-n: #f78c6c;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font: 400 15px/1.6 var(--sans);
  overflow-x: hidden;
  --cap: var(--cap-frame);
}
body.w-wide { --cap: var(--cap-wide); }
body.w-tool { --cap: var(--cap-tool); }

.bar, main, .foot {
  width: min(100% - 2 * var(--gutter), var(--cap));
  margin-inline: auto;
}

a { color: var(--ac); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

code, pre, kbd, textarea { font-family: var(--mono); }
code { font-size: 0.92em; }

h1, h2, h3, h4 { text-wrap: balance; }
p, li { text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 2px;
  border-radius: 3px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Controls that work only with JavaScript are hidden without it. */
html:not(.js) .js-only { display: none !important; }

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 12px;
  background: var(--sf);
  border: 1px solid var(--ln);
  z-index: 20;
}
.skip:focus { top: 8px; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.link { color: var(--ac); text-decoration: underline; text-underline-offset: 2px; }

/*
 * Folds: a `details` element whose summary shows on narrow screens and
 * opens its content in place. Where the layout has room, the stylesheet
 * shows the content and hides the summary (see "Unfolded" below); a
 * browser that cannot style the content of a closed `details` keeps the
 * summary there, so the content stays one click away.
 */
.fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--ln);
  border-radius: var(--radius);
  background: var(--sf);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.fold[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.fold > summary:hover { border-color: var(--ln-ctl); }
.fold[open] > summary { border-radius: var(--radius) var(--radius) 0 0; }
.fold > nav {
  padding: 10px 14px 12px;
  border: 1px solid var(--ln);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--sf);
}

/* Header */

.hdr {
  position: relative;
  border-bottom: 1px solid var(--ln);
  background: var(--sf);
}

.bar {
  display: flex;
  align-items: center;
  gap: 10px 22px;
  min-height: 56px;
  padding: 8px 0;
}

.brand { display: inline-flex; color: var(--tx); flex: none; }
.brand svg { display: block; }

/*
 * The version menu of the documentation: a badge in the header that drops
 * a list of the versions, and the same menu at the top of the docs'
 * navigation, where the list opens in place.
 */
.versions { position: relative; flex: none; }
.versions > summary {
  position: relative;
  min-height: 0;
  gap: 6px;
  padding: 4px 6px 4px 7px;
  border-color: var(--ln);
  border-radius: 4px;
  background: none;
  color: var(--mu);
  font: 500 11px/1 var(--mono);
}
.versions[open] > summary { border-radius: 4px; color: var(--tx); }
.versions > summary:hover { color: var(--tx); border-color: var(--ln-ctl); }
.versions > summary::after { width: 5px; height: 5px; margin-top: -2px; border-width: 1.5px; }
.versions[open] > summary::after { margin-top: 2px; }
/* Small targets reach 40px with an invisible margin. */
.versions > summary::before { content: ""; position: absolute; inset: -11px -4px; }
.versions > ul {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 0;
  min-width: 12rem;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--ln);
  border-radius: var(--radius);
  background: var(--sf);
  box-shadow: 0 12px 24px -12px var(--shade);
}
.versions li a {
  display: block;
  padding: 6px 10px;
  border-radius: 4px;
  color: var(--tx);
  font: 400 13px/1.4 var(--mono);
  text-decoration: none;
  white-space: nowrap;
}
.versions li a:hover { background: var(--sub); }
.versions li a[aria-current] { color: var(--ac); font-weight: 600; }
.side-nav .versions { margin: 0 0 18px; }
.side-nav .versions > summary { justify-content: flex-start; padding: 6px 10px; font-size: 12px; }
.side-nav .versions > summary::before { content: none; }
.side-nav .versions > summary::after { margin-left: auto; }
.side-nav .versions > summary .sr { position: static; width: auto; height: auto; overflow: visible; clip-path: none; font-family: var(--sans); }
.side-nav .versions > ul { position: static; margin-top: 6px; box-shadow: none; }
.side-nav .versions li a { border-left: 0; padding: 6px 10px; color: var(--tx); }

/* A note on documentation that is not the latest release's. */
.version-note {
  padding: 10px 14px;
  border: 1px solid var(--ln);
  border-left: 3px solid var(--warn);
  border-radius: 6px;
  background: var(--sf);
  font-size: 14px;
}

/* On narrow screens the navigation is a menu that drops below the bar. */
.menu { margin-left: auto; }
.menu > summary { border-color: var(--ln-ctl); min-height: 32px; padding: 0 10px; font-size: 14px; }
.menu[open] > summary { border-radius: var(--radius); background: var(--sub); }
.menu > .site-nav {
  position: absolute;
  z-index: 10;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  padding: 6px calc(max(var(--gutter), (100% - var(--cap)) / 2) - 14px) 14px;
  border: 0;
  border-bottom: 1px solid var(--ln);
  border-radius: 0;
  box-shadow: 0 12px 24px -12px var(--shade);
}
.site-nav { font-size: 14px; }
.site-nav a { color: var(--mu); text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--tx); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--tx); }
.menu .site-nav a { padding: 10px 12px; font-size: 15px; border-left: 2px solid transparent; }
.menu .site-nav a[aria-current="page"] { border-left-color: var(--ac); font-weight: 500; }

.theme {
  width: 32px;
  height: 32px;
  flex: none;
  border: 1px solid var(--ln-ctl);
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
}
.theme span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--tx);
  background: linear-gradient(90deg, var(--tx) 50%, transparent 50%);
}
.theme:hover { background: var(--sub); }

/* Shared pieces */

main { padding-block: 32px 8px; }

h1 { font: 600 var(--h1)/1.25 var(--sans); margin: 0; letter-spacing: -0.01em; }
h2 { font: 600 20px/1.3 var(--sans); margin: 0; }
h3 { font: 600 16px/1.4 var(--sans); margin: 0; }

.lede { font-size: 17px; color: var(--mu); margin: 10px 0 0; }
.small { font-size: 13px; color: var(--mu); }

.eyebrow, .stat-k, .foot-h, .toc-h, .side-nav .side-nav-h {
  font: 600 11px/1.3 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mu);
}
.eyebrow { font-size: 12px; margin: 0 0 14px; }

.page-head { max-width: var(--column); margin-bottom: 28px; }
.page-head.missing { min-height: 40vh; }

.inst {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 400 14px/1.4 var(--mono);
  background: var(--sf);
  border: 1px solid var(--ln);
  border-radius: 6px;
  padding: 8px 12px;
}
.inst code { flex: 1; min-width: 0; font-size: inherit; }
.inst code span { white-space: nowrap; }
.inst .p { color: var(--ac); }
.inst .ib { margin: -6px -8px -6px 0; }

/* Icons, and links and buttons made of them. */
.icon { display: block; flex: none; }

.icon-links { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 16px 0 0; }
.icon-link { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; color: var(--mu); text-decoration: none; font-size: 14px; }
.icon-link:hover { color: var(--tx); }

/*
 * Icon buttons: a square target with its name as a tooltip below it,
 * which also shows the outcome of the action for a moment.
 */
.ib {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: var(--mu);
}
.ib:hover { color: var(--tx); background: var(--bg); }
.ib .icon { width: 16px; height: 16px; }
.ib::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  right: 0;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--tx);
  color: var(--bg);
  font: 500 12px/1.3 var(--sans);
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.ib:hover::after, .ib:focus-visible::after, .ib[data-done]::after { opacity: 1; }
.ib[data-done] { color: var(--ac); }

.button {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--ln-ctl);
  border-radius: 6px;
  background: var(--sf);
  color: var(--tx);
  font-weight: 500;
  text-decoration: none;
}
.button:hover { background: var(--sub); }
.button.primary { background: var(--ac); border-color: var(--ac); color: var(--on-ac); }
.button.primary:hover { filter: brightness(1.08); }
.button:active, .chips button:active, .fold > summary:active, .theme:active, .pager a:active { filter: brightness(0.94); }

/* Blocks that scroll sideways show a shadow at the edge with more content. */
.block, .table-wrap {
  --scroll-bg: var(--sf);
  overflow-x: auto;
  background:
    linear-gradient(to right, var(--scroll-bg) 30%, transparent) left center / 40px 100% no-repeat local,
    linear-gradient(to left, var(--scroll-bg) 30%, transparent) right center / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--shade), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--shade), transparent) right center / 12px 100% no-repeat scroll,
    var(--scroll-bg);
}

.block {
  margin: 0 0 16px;
  padding: 12px 14px;
  font: 400 13px/1.6 var(--mono);
  border: 1px solid var(--ln);
  border-radius: 6px;
  tab-size: 4;
}
.block code { font-size: inherit; }

.hl-k { color: var(--hl-k); }
.hl-s { color: var(--hl-s); }
.hl-c { color: var(--mu); font-style: italic; }
.hl-t { color: var(--hl-t); }
.hl-a { color: var(--hl-a); }
.hl-n { color: var(--hl-n); }

.table-wrap {
  border: 1px solid var(--ln);
  border-radius: 6px;
  margin: 0 0 16px;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--ln); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { font-weight: 600; background: var(--sub); }
table.figures { font: 400 13px/1.3 var(--mono); }
table.figures th, table.figures td { text-align: right; white-space: nowrap; }
table.figures th {
  font: 600 11px/1.3 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mu);
  white-space: normal;
  vertical-align: bottom;
  background: none;
}
table.figures th code { text-transform: none; letter-spacing: 0; }
table.figures .l { text-align: left; }
.note { color: var(--mu); font-size: 14px; }

.ok { color: var(--ac); }
.partial { color: var(--warn); }

.math { overflow-x: auto; overflow-y: hidden; }
.math .katex-display { margin: 0; }
.math .error { font: 400 12px/1.5 var(--mono); color: var(--warn); white-space: pre-wrap; }

/* Cards: a bordered box, a whole link where it leads somewhere. */
.cards a, .stat, .doc-list li, .pager a {
  background: var(--sf);
  border: 1px solid var(--ln);
  border-radius: var(--radius);
}
.cards a, .stat, .doc-list li, .pager a { position: relative; }
.cards a:hover, .stat:has(.stat-a):hover, .doc-list li:hover, .pager a:hover { border-color: var(--ac); }

/*
 * Figures: a list of tiles, each a label, one value and a qualifier. The
 * tiles of a row share its lines, so their values align.
 */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.stat {
  display: grid;
  grid-row: span 3;
  grid-template-rows: subgrid;
  row-gap: 4px;
  align-content: start;
  padding: 14px 16px;
  color: var(--mu);
  font-size: 13px;
  line-height: 1.4;
}
.stat-k { align-self: end; }
.stat-n { font: 500 22px/1.2 var(--mono); color: var(--ac); white-space: nowrap; }
/* Where the tiles make two columns, an odd last tile takes the whole row. */
.stats { container-type: inline-size; }
@container (max-width: 30rem) {
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.stat-a { color: inherit; text-decoration: none; }
.stat-a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }

/* Home */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px 48px;
  align-items: start;
  padding-block: 8px 40px;
}
.hero h1 { font-size: clamp(var(--h1), 3.2vw, 40px); line-height: 1.15; }
.hero h1 span { display: block; color: var(--mu); font-weight: 400; }
.hero .lede { margin: 16px 0 22px; }
.hero-text { max-width: var(--column); }
.routes { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }

.facts { grid-template-columns: minmax(0, 1fr); margin: 0; }
.facts .stat { padding: 16px 18px; font-size: 14px; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px 48px;
  margin-top: 48px;
}

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cards a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  color: var(--mu);
  text-decoration: none;
  font-size: 14px;
}
.card-t { font-weight: 600; font-size: 16px; color: var(--tx); }
.cards a:hover .card-t { color: var(--ac); }

/* The compact converter */

.mini {
  container-type: inline-size;
  border: 1px solid var(--ln);
  border-radius: var(--radius);
  background: var(--sf);
  overflow: hidden;
}

.mini-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ln);
  background: var(--sub);
}
.mini .mini-head h2 {
  margin: 0;
  font: 600 12px/1.3 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mu);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  font: 500 12px/1.3 var(--sans);
  padding: 3px 9px;
  border: 1px solid var(--ln-ctl);
  border-radius: 999px;
  color: var(--mu);
  background: var(--sf);
}
.chips button:hover { color: var(--tx); background: var(--sub); }
.chips button[aria-pressed="true"] { background: var(--ac); border-color: var(--ac); color: var(--on-ac); }

.mini-panes { display: grid; grid-template-columns: minmax(0, 1fr); }
.pane { display: flex; flex-direction: column; min-width: 0; }
.pane + .pane { border-top: 1px solid var(--ln); }
.pane textarea {
  display: block;
  height: 220px;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  resize: vertical;
  background: transparent;
  color: var(--tx);
  font: 400 13px/1.6 var(--mono);
  white-space: pre;
  overflow: auto;
  tab-size: 2;
}
.pane textarea:focus-visible { outline: 2px solid var(--ac); outline-offset: -2px; border-radius: 0; }
.pane .outc { height: 84px; flex: none; }
.pane .math {
  flex: 1;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  font-size: 19px;
  border-top: 1px dashed var(--ln);
  background-image: radial-gradient(var(--ln) 1px, transparent 1px);
  background-size: 14px 14px;
}

@container (min-width: 600px) {
  .mini-panes { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pane + .pane { border-top: 0; border-left: 1px solid var(--ln); }
  .pane textarea { height: 300px; resize: none; flex: 1; }
  .pane .outc { height: 110px; }
}

.mini-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 18px;
  padding: 8px 14px;
  border-top: 1px solid var(--ln);
  background: var(--sub);
  font: 400 12px/1.4 var(--mono);
  color: var(--mu);
}
.mini-foot a { font-family: var(--sans); font-size: 13px; }

/* Conversion pages: the converter under the lede. */

.doc > .mini { margin-bottom: 12px; }

.worked {
  margin: 0 0 24px;
  border: 1px solid var(--ln);
  border-radius: var(--radius);
  background: var(--sf);
  overflow: hidden;
}
.worked figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid var(--ln);
  background: var(--sub);
}
.worked figcaption span { font: 400 12px/1.6 var(--mono); white-space: nowrap; }
.example-io > div { min-width: 0; padding: 0 14px 14px; }
.example-io > div + div { border-top: 1px solid var(--ln); }
.example-io .block { margin: 0 -14px; padding: 0 14px; border: 0; border-radius: 0; }
.example-io .out { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.example-io .math { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--ln); font-size: 17px; }
.ch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 0;
  font: 600 11px/1.3 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--mu);
}
.ch > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch em { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; }
.ch .ib { margin-right: -8px; }
.pane .ch, .col .ch { min-height: 41px; padding: 0 14px; border-bottom: 1px solid var(--ln); }

/* Running text: conversion pages and the documentation */

.doc { min-width: 0; font-size: 16px; }
.doc h2 { font-size: 23px; margin: 44px 0 12px; }
.doc h3 { font-size: 18px; margin: 30px 0 8px; }
.doc h4 { font-size: 15px; margin: 22px 0 6px; }
.doc :is(p, ul, ol) { margin: 0 0 14px; }
.doc li + li { margin-top: 4px; }
.doc :not(pre) > code { background: var(--sub); border: 1px solid var(--ln); border-radius: 4px; padding: 0 4px; }
.doc blockquote { margin: 0 0 14px; padding: 2px 16px; border-left: 3px solid var(--ln); color: var(--mu); }
.doc table code { white-space: nowrap; }
.doc :is(h2, h3, h4) code { background: none; border: 0; padding: 0; font-size: 0.95em; }
.anchor {
  margin-left: 8px;
  color: var(--ln);
  text-decoration: none;
  font-weight: 400;
  opacity: 0;
}
:is(h2, h3, h4):hover .anchor, .anchor:focus-visible { opacity: 1; color: var(--mu); }

/*
 * Benchmarks: two equal columns. Each band has its text in the first and
 * what goes with it, the facts of the measurement or the headline
 * figures, in the second; its tables span both, with their notes below
 * them set in two columns.
 */

.band { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--gap); margin: 0 0 48px; }
.band-text { max-width: var(--column); font-size: 16px; }
.band-text p { color: var(--mu); margin: 8px 0 16px; }
.band > .stats { margin-bottom: 20px; }
.band > .note { margin: 0 0 24px; columns: 2 22rem; column-gap: var(--gap); }
.band > .note p { margin: 0 0 6px; break-inside: avoid; }

.measured {
  display: grid;
  gap: 6px;
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--ln);
  border-radius: var(--radius);
  background: var(--sf);
  font-size: 13px;
  line-height: 1.45;
}
.measured div { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 12px; }
.measured dt { font: 600 11px/1.9 var(--sans); text-transform: uppercase; letter-spacing: 0.08em; color: var(--mu); }
.measured dd { margin: 0; }

/* Documentation: the navigation, the outline and the article. */

.frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px var(--gap);
}
.frame > .doc { margin-top: 14px; }
.side-nav { font-size: 14px; }
.side-nav ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.side-nav p { margin: 0 0 8px; }
.side-nav a, .toc a { display: block; padding: 3px 10px; color: var(--mu); text-decoration: none; border-left: 2px solid var(--ln); }
.side-nav a:hover, .toc a:hover { color: var(--tx); border-color: var(--mu); }
.side-nav a[aria-current="page"] { color: var(--tx); border-color: var(--ac); font-weight: 500; }
.side-nav .side-nav-h { margin: 20px 0 8px; }
.side-nav > .side-nav-h:first-child { margin-top: 0; }
.side-nav .side-nav-sub { font-weight: 600; font-size: 12px; color: var(--mu); margin: 12px 0 4px 12px; }
.toc { font-size: 13px; }
.toc-h { display: none; margin: 0 0 8px; }
.toc .toc-3 a { padding-left: 22px; }
.toc code { font-size: 0.95em; }

.doc > .lede { margin-bottom: 28px; }

.crumbs { font-size: 13px; color: var(--mu); margin: 0 0 10px; }
.crumbs a { color: var(--mu); }

.doc-list { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 10px; }
.doc-list li { padding: 14px 16px; }
.doc-list li + li { margin-top: 0; }
.doc-list a { font-weight: 600; text-decoration: none; }
.doc-list a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.doc-list li:hover a { text-decoration: underline; }
.doc-list p { margin: 4px 0 0; color: var(--mu); font-size: 14px; }

.pager { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin: 48px 0 16px; }
.pager a {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  text-decoration: none;
  font-weight: 500;
}
.pager span { font: 400 12px/1.4 var(--sans); color: var(--mu); }
.pager .next { grid-column: 2; text-align: right; }
.edit { font-size: 13px; }

/* Playground */

.tool-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 0 0 16px; }
.tool-head p { margin: 0; color: var(--mu); }
.noscript { color: var(--warn); }

.tool {
  border: 1px solid var(--ln);
  border-radius: var(--radius);
  background: var(--sf);
  overflow: hidden;
}

.tbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ln);
  background: var(--sub);
  font-size: 12px;
  color: var(--mu);
}
.tbar-actions { display: inline-flex; gap: 4px; margin: -4px -6px -4px auto; }

/* The link to share, where it cannot be copied for the reader. */
.share-box {
  position: fixed;
  inset: auto;
  margin: 0;
  width: min(28rem, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--ln-ctl);
  border-radius: var(--radius);
  background: var(--sf);
  color: var(--tx);
  box-shadow: 0 12px 24px -12px var(--shade);
  font-size: 14px;
}
.share-box p { margin: 0; }
.share-box input {
  width: 100%;
  margin-top: 8px;
  padding: 6px 8px;
  border: 1px solid var(--ln-ctl);
  border-radius: 5px;
  background: var(--sub);
  color: var(--tx);
  font: 400 12px/1.4 var(--mono);
}

.opt-group { display: inline-flex; align-items: center; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.opt-group legend { float: left; padding: 0; }

.opt {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--ln-ctl);
  border-radius: 5px;
  overflow: hidden;
}
.opt label { position: relative; display: inline-flex; cursor: pointer; }
.opt label + label span { border-left: 1px solid var(--ln-ctl); }
.opt input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.opt span { display: inline-flex; align-items: center; padding: 3px 8px; font: 500 12px/1.3 var(--mono); color: var(--mu); }
.opt label:hover span { color: var(--tx); background: var(--bg); }
.opt input:checked + span { background: var(--ac); color: var(--on-ac); }
.opt input:focus-visible + span { outline: 2px solid var(--ac); outline-offset: -2px; box-shadow: inset 0 0 0 4px var(--sf); }
.opt input:disabled + span { opacity: 0.45; cursor: not-allowed; }
.opt input:disabled + span:hover { background: none; }
.opt.small { flex-wrap: nowrap; flex: none; }
.opt.small span { padding: 1px 6px; font-size: 11px; text-transform: none; letter-spacing: 0; }

label.example select {
  font: 500 12px/1.3 var(--sans);
  color: var(--tx);
  background: var(--sf);
  border: 1px solid var(--ln-ctl);
  border-radius: 5px;
  padding: 3px 6px;
  max-width: 14em;
}
label.example { display: inline-flex; align-items: center; gap: 6px; }

/*
 * The panes: stacked on narrow screens, then input and output side by
 * side above the two drawings, then three columns with the drawings
 * stacked, and on the widest screens four columns. The panes fill the
 * height of the window.
 */
.cols {
  display: grid;
  grid-template-areas: "input" "output" "latex" "native";
}
.col { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-top: 1px solid var(--ln); }
.col-input { grid-area: input; border-top: 0; }
.col-output { grid-area: output; }
.col-latex { grid-area: latex; }
.col-native { grid-area: native; }
.col .ch { padding: 0 12px; }
.code { height: 280px; }
.outc { min-height: 110px; }
.render .math { min-height: 120px; }

.code { display: flex; flex: 1; min-height: 0; font: 400 13px/1.7 var(--mono); }
.ln {
  flex: none;
  overflow: hidden;
  padding: 10px 10px 10px 12px;
  min-width: 3.2em;
  text-align: right;
  color: var(--mu);
  user-select: none;
  white-space: pre;
}
.code textarea {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 10px 12px 10px 4px;
  border: 0;
  resize: none;
  background: transparent;
  color: var(--tx);
  font: inherit;
  white-space: pre;
  overflow: auto;
  tab-size: 2;
}
.code textarea:focus-visible { outline: 2px solid var(--ac); outline-offset: -2px; border-radius: 0; }

.outc {
  flex: 1;
  margin: 0;
  padding: 12px 14px;
  overflow: auto;
  font: 400 15px/1.6 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.outc:focus-visible { outline-offset: -2px; border-radius: 0; }

.render {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: auto;
  background-image: radial-gradient(var(--ln) 1px, transparent 1px);
  background-size: 14px 14px;
}
.render .math {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  font-size: clamp(20px, 1.3vw, 30px);
  padding: 12px;
}
.render .math > * { max-width: 100%; }
.render math { font-size: clamp(20px, 1.3vw, 30px); }

.status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 22px;
  padding: 7px 12px;
  border-top: 1px solid var(--ln);
  font: 400 12px/1.3 var(--mono);
  color: var(--mu);
  background: var(--sub);
  min-height: 31px;
}
.status .link { font: inherit; }
.status .link:disabled { color: inherit; text-decoration: none; cursor: default; }

.fallback-list {
  margin: 0;
  padding: 8px 12px 10px 36px;
  border-top: 1px solid var(--ln);
  font: 400 12px/1.6 var(--mono);
  color: var(--tx);
  background: var(--sub);
}

/* The Python and JavaScript samples: a switch made of radio buttons,
   which needs no script. */
.langs { display: flex; flex-wrap: wrap; gap: 0 4px; }
.langs input { position: absolute; opacity: 0; pointer-events: none; }
.langs label {
  padding: 4px 12px;
  font: 500 13px/1.4 var(--sans);
  color: var(--mu);
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
}
.langs label:hover { color: var(--tx); }
.langs input:checked + label { color: var(--tx); background: var(--sf); border-color: var(--ln); }
.langs input:focus-visible + label { outline: 2px solid var(--ac); outline-offset: -2px; }
.lang { display: none; flex: 0 0 100%; min-width: 0; margin-top: -1px; }
#lang-python:checked ~ .lang-python, #lang-javascript:checked ~ .lang-javascript { display: block; }
.lang .block { border-top-left-radius: 0; }

.insts { display: flex; flex-direction: column; gap: 8px; }

/* Footer */

.foot {
  margin-top: 64px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--ln);
  color: var(--mu);
  font-size: 13px;
}
.foot-cols { display: grid; gap: 24px 40px; grid-template-columns: minmax(0, 1fr); }
.foot-about { grid-column: 1 / -1; max-width: var(--column); }
.foot p { margin: 0 0 8px; }
.foot ul { list-style: none; margin: 0; padding: 0; line-height: 1.9; }
.foot a { color: var(--mu); }
.foot a:hover { color: var(--tx); }
.foot-h { color: var(--tx); }
.foot .foot-version { margin-top: 24px; font-size: 12px; }

/* Breakpoints */

/*
 * The frame narrows with the screen: the text column alone, then the
 * navigation beside it, then the outline on the other side.
 */
@media (max-width: 899px) {
  body.w-frame { --cap: var(--column); }
}
@media (min-width: 900px) and (max-width: 1239px) {
  body.w-frame { --cap: calc(var(--side) + var(--gap) + var(--column)); }
}

@media (max-width: 599px) {
  :root { --h1: 26px; }
  .bar { gap: 10px 12px; }
  main { padding-top: 22px; }
  .lede { font-size: 16px; }
}

/* The smallest phones leave the version menu to the documentation. */
@media (max-width: 359px) {
  .bar .versions { display: none; }
}

@media (min-width: 600px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: clamp(300px, calc(100vh - 460px), 640px) minmax(180px, auto);
    grid-template-areas: "input output" "latex native";
  }
  .col-output, .col-native { border-left: 1px solid var(--ln); }
  .col-output { border-top: 0; }
  .code { height: auto; flex: 1; }
}

@media (min-width: 900px) {
  .bar { gap: 10px 22px; }
  .site-nav { display: flex; gap: 4px 20px; min-width: 0; }
  .site-nav a { padding: 4px 0; }
  .site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--ac); }
  .theme { margin-left: auto; }

  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .band { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .band > .band-text { grid-column: 1; max-width: none; }
  .band > :is(.stats, .measured) { grid-column: 2; grid-row: 1; align-self: end; }
  .band > :is(.table-wrap, .note) { grid-column: 1 / -1; }
  .foot-cols { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); }
  .foot-about { grid-column: auto; }


  .frame { grid-template-columns: var(--side) minmax(0, var(--column)); grid-template-areas: "nav toc" "nav article"; row-gap: 0; }
  .frame > .doc { grid-area: article; margin-top: 0; }
  .side-fold, .side-nav { grid-area: nav; }
  .frame .toc-fold { grid-area: toc; margin-bottom: 14px; }
  .side-nav { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow-y: auto; }
}

@media (min-width: 1240px) {
  .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); padding-top: 24px; }
  .cols {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: repeat(2, clamp(200px, calc(50vh - 120px), 460px));
    grid-template-areas: "input output latex" "input output native";
  }
  .col-latex { border-left: 1px solid var(--ln); border-top: 0; }

  .frame { grid-template-columns: var(--side) minmax(0, var(--column)) var(--side); grid-template-areas: "nav article toc"; }
  .frame .toc-fold, .frame .toc { grid-area: toc; }
  .frame .toc { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow-y: auto; }
}

@media (min-width: 1600px) {
  .cols {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: clamp(420px, calc(100vh - 240px), 960px);
    grid-template-areas: "input output latex native";
  }
  .col-native { border-top: 0; }
}

/*
 * Unfolded: where a fold's content has room, it shows in place of its
 * summary, as if the `details` element were not there.
 */
@supports selector(::details-content) {
  @media (min-width: 900px) {
    :is(.menu, .side-fold) { display: contents; }
    :is(.menu, .side-fold) > summary { display: none; }
    :is(.menu, .side-fold)::details-content { display: contents; content-visibility: visible; }
    :is(.menu, .side-fold) > :is(.site-nav, .side-nav) { position: static; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; flex-direction: row; }
    .menu .site-nav a { padding: 4px 0; font-size: 14px; border-left: 0; }
    .menu .site-nav a[aria-current="page"] { font-weight: 400; }
    .site-nav .icon-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  }
  @media (min-width: 1240px) {
    .frame .toc-fold { display: contents; }
    .frame .toc-fold > summary { display: none; }
    .frame .toc-fold::details-content { display: contents; content-visibility: visible; }
    .frame .toc-fold > nav { padding: 0; border: 0; border-radius: 0; background: none; }
    .frame .toc-fold .toc-h { display: block; }
  }
}

/* Touch screens: every control at least 40px tall. */
@media (pointer: coarse) {
  .theme { width: 40px; height: 40px; }
  .menu > summary { min-height: 40px; }
  .site-nav a, .menu .site-nav a { padding-block: 10px; }
  .brand { padding-block: 10px; }
  .side-nav a, .toc a { padding-block: 10px; }
  .langs label, .foot li a, .crumbs a, .edit a, .mini-foot a, .status .link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }
  .ib { width: 40px; height: 40px; }
  .icon-link { min-height: 40px; }
  .site-nav .icon-link { min-width: 40px; justify-content: center; }
  .side-nav .versions > summary { min-height: 40px; }
  .chips button { min-height: 40px; padding-inline: 14px; }
  .opt span, .opt.small span { min-height: 40px; padding-inline: 12px; }
  label.example select { min-height: 40px; }
  .inst { padding-block: 0; }
  .inst .ib { margin-block: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .opt span, .site-nav a, .ib, .icon-link, .stat, .cards a, .doc-list li, .pager a, .button, .chips button, .fold > summary {
    transition: color 120ms, background-color 120ms, border-color 120ms;
  }
}
