:root {
  /* the system's scheme, unless the theme toggle pins light or dark */
  color-scheme: light dark;
  --bg: light-dark(#fbfbfa, #131416);
  --panel: light-dark(#ffffff, #1b1d20);
  --text: light-dark(#1d1f21, #e6e6e3);
  --dim: light-dark(#6b6f76, #979ba2);
  --line: light-dark(#e4e4e0, #2c2f33);
  --accent: light-dark(#5b3fd4, #a995ff);
  --accent-soft: light-dark(#efebff, #2a2441);
  --component: light-dark(#0f7b6c, #5fd0bd);
  --component-soft: light-dark(#e2f4f1, #17302c);
  --interface: light-dark(#8a5a00, #f0bf5e);
  --interface-soft: light-dark(#fbf0d9, #352a14);
  --code-bg: light-dark(#f4f4f1, #1f2124);
  --k: light-dark(#a626a4, #e08be0);
  /* types, in the teal-cyan editors use, which doesn't read as a link */
  --t: light-dark(#1f6f86, #5cc4e0);
  --b: light-dark(#b04a00, #ff9f5a);
  --f: light-dark(#3b7d1f, #8ad36a);
  --n: light-dark(#7a4cc2, #c3a6ff);
  --d: light-dark(#6c7178, #8a8f96);
  --deprecated: light-dark(#b42318, #ff8a80);
  --deprecated-soft: light-dark(#fdecea, #3a1d1b);
  /* how much of its color a badge on an icon keeps, blended toward the background */
  --badge-strength: 70%;
  --shadow-color: light-dark(rgb(0 0 0 / 0.12), rgb(0 0 0 / 0.5));
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  /* the heights of what's pinned to the top of the window, kept up to date by head.js: the site's
     header, and a page's breadcrumbs and title */
  --site-header: 57px;
  --page-head: 0px;
  /* where a link to a section scrolls it to, clear of what's pinned */
  --anchor-offset: calc(var(--site-header) + var(--page-head) + 16px);
}
html { scroll-padding-top: var(--anchor-offset); }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  /* a short page still keeps the footer at the bottom of the window */
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); font-size: 0.9em; }
h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 0.6em; }
h1 { font-size: 1.7rem; margin-top: 0.6em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--dim); }
.dim { color: var(--dim); }
/* a date in the monospace font, so the dates in a list line up */
time { font-family: var(--mono); font-size: 0.9em; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 16px; }

header.site { border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 10; }
header.site .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text); font-size: 1.05rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { display: inline-flex; color: var(--text); }
.brand .mark svg { height: 30px; width: auto; display: block; }
header nav { display: flex; gap: 16px; margin-left: auto; }
header nav a { color: var(--dim); }
header nav .github { display: flex; padding: 4px; border-radius: 6px; }
header nav .github:hover { color: var(--text); }
header nav .github svg { width: 20px; height: 20px; display: block; }
.search { position: relative; flex: 1 1 260px; max-width: 460px; }
.search input, .filters input, .filters select {
  width: 100%; font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
}
.search input:focus, .filters input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px var(--shadow-color);
}
.suggest a { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 6px; color: var(--text); overflow: hidden; }
.suggest a:hover, .suggest a:focus { background: var(--accent-soft); text-decoration: none; outline: none; }
.suggest .kind-icon { flex: none; width: 14px; height: 14px; align-self: center; }
.suggest .dim { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.85em; }

/* the space above the footer is the main's padding alone: the trailing margins of the page's
   last blocks are trimmed, so it's the same on every page */
main { flex: 1 0 auto; width: 100%; padding-bottom: 48px; }
.page > :last-child, .page > .layout > * > :last-child, .page > .layout > * > :last-child > :last-child { margin-bottom: 0; }
footer.site { border-top: 1px solid var(--line); background: var(--panel); color: var(--dim); font-size: 0.85rem; padding-block: 28px 24px; }
footer.site .wrap { display: grid; grid-template-columns: minmax(0, 1fr) repeat(2, minmax(140px, auto)); gap: 16px 48px; }
footer.site p { margin: 0 0 6px; max-width: 60ch; }
footer.site h2 { margin: 0 0 8px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text); }
footer.site ul { list-style: none; margin: 0; padding: 0; }
footer.site li { padding: 2px 0; }
footer.site a { color: var(--dim); }
footer.site a:hover { color: var(--text); }
footer.site .footer-legal { grid-column: 1 / -1; max-width: none; margin: 8px 0 0; padding-top: 16px; text-align: center; }
@media (max-width: 640px) {
  footer.site .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  footer.site .footer-about { grid-column: 1 / -1; }
}

.hero { padding: 40px 0 16px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.02em; margin-bottom: 0.25em; }
.hero p { color: var(--dim); max-width: 80ch; font-size: 1.05rem; }
/* the home page's own search, larger than the header's, its matches dropping under it */
.hero-search { max-width: 640px; margin: 24px 0 12px; }
.hero-search input { font-size: 1.05rem; padding: 11px 14px; border-radius: 10px; background: var(--panel); }
.hero .browse { font-size: 0.9rem; }
/* a namespace's link keeps its icon with its name, a line wrapping between namespaces */
.hero .browse-ns a { white-space: nowrap; }
.hero .browse-ns a + a { margin-left: 10px; }
.hero .browse a .kind-icon, .chips .kind-icon { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.section-lede { color: var(--dim); max-width: 70ch; margin-top: -0.4em; }

/* a WASI package, and the components that stand in for it */
.caps { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.cap { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.cap-head { font-weight: 600; font-size: 1.05rem; color: var(--text); }
.cap-head .kind-icon { width: 16px; height: 16px; margin-right: 6px; vertical-align: -2px; }
.cap > p { margin: 0; color: var(--dim); font-size: 0.9rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 0; padding: 4px 0 0; list-style: none; }
.chips a { display: inline-block; font-size: 0.85rem; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text); }
.chips a:hover { border-color: var(--accent); text-decoration: none; }
.chips .chips-more { color: var(--dim); border-style: dashed; }

/* the latest releases, a line each */
.recent { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.recent li + li { border-top: 1px solid var(--line); }
.recent a { display: flex; align-items: baseline; gap: 10px; padding: 9px 14px; color: var(--text); min-width: 0; }
.recent a:hover { background: var(--accent-soft); text-decoration: none; }
.recent li:first-child a { border-radius: 10px 10px 0 0; }
.recent li:last-child a { border-radius: 0 0 10px 10px; }
.recent .kind-icon { flex: none; width: 14px; height: 14px; align-self: center; }
.recent code { font-weight: 600; flex: none; }
.recent-version, .recent time { color: var(--dim); font-size: 0.85rem; font-variant-numeric: tabular-nums; flex: none; }
.recent-desc { color: var(--dim); font-size: 0.85rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .recent-desc { display: none; } .recent time { margin-left: auto; } }
.more { font-size: 0.8rem; font-weight: 400; margin-left: 8px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.card {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-width: 0;
}
.card:hover { border-color: var(--accent); text-decoration: none; }
/* the icon and the name on one row: a long name wraps beside its icon, at its hyphens, and within
   a word only when one is wider than the card */
.card-head { display: flex; gap: 6px; align-items: flex-start; }
.card .pkg { min-width: 0; font-weight: 600; overflow-wrap: break-word; }
.card p { margin: 0; color: var(--dim); font-size: 0.9rem; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { display: flex; align-items: baseline; gap: 12px; color: var(--dim); font-size: 0.8rem; font-variant-numeric: tabular-nums; }

.badge { font-size: 0.7rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; text-transform: lowercase; white-space: nowrap; }
/* a pre-release, in the color of a caution, as the compare view counts them */
.badge.pre { color: var(--interface); background: var(--interface-soft); border: 1px solid transparent; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input { flex: 1 1 220px; width: auto; }
.filters select { width: auto; }

/* a page's breadcrumbs and title, pinned under the site's header while the page scrolls under them */
/* its space above is padding rather than margin, so it's pinned from the first pixel scrolled */
.page-head { padding-top: 16px; background: var(--bg); }
@media (min-width: 701px) and (min-height: 560px) {
  .page-head { position: sticky; top: var(--site-header); z-index: 9; }
  /* once the page has scrolled under it, a line parts it from the page */
  .page-head.stuck { box-shadow: 0 1px 0 var(--line); }
}
.crumbs { font-family: var(--mono); font-size: 0.85rem; color: var(--dim); }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title-row h1 { margin: 0.3em 0; overflow-wrap: anywhere; }
/* a page's title copies its id, e.g. `wasi:cli/command@0.2.6`, with a button at the end of its
   row, after its gates and badges, that shows while the row's hovered, or the button's focused
   or has just copied; always on a screen without hover */
.title-row > .copy { opacity: 0; transition: opacity 0.15s; }
.title-row:hover > .copy, .title-row > .copy:focus-visible, .title-row > .copy.copied { opacity: 1; }
@media (hover: none) { .title-row > .copy { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .title-row > .copy { transition: none; } }

/* a breadcrumb that switches to another namespace, package, version or interface */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.pivot { position: relative; display: inline-block; }
.pivot > summary {
  display: inline-flex; align-items: center; gap: 2px; list-style: none; cursor: pointer;
  color: var(--accent); border-radius: 6px; padding: 1px 4px; margin: 0 -4px;
}
.pivot > summary::-webkit-details-marker { display: none; }
.pivot > summary:hover, .pivot[open] > summary { background: var(--accent-soft); }
.pivot > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pivot-chevron { width: 14px; height: 14px; flex: none; transition: transform 0.15s; }
.pivot[open] .pivot-chevron { transform: rotate(180deg); }
.pivot-menu {
  position: absolute; left: -4px; top: calc(100% + 6px); z-index: 20; margin: 0; padding: 4px; list-style: none;
  /* as wide as its longest choice, rather than the breadcrumb it hangs from */
  width: max-content; min-width: 240px; max-width: min(600px, calc(100vw - 32px)); max-height: min(60vh, 420px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px var(--shadow-color);
  font-size: 0.85rem;
}
.pivot-menu a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 5px 8px; border-radius: 6px; color: var(--text); }
.pivot-menu a code { font-size: 1em; overflow-wrap: anywhere; }
.pivot-menu a .kind-icon { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
.pivot-menu a[aria-current] .kind-icon { color: currentColor; }
.pivot-menu a .dim { flex: none; }
.pivot-menu a span.dim { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 0.9em; }
.pivot-menu a:hover, .pivot-menu a:focus-visible { background: var(--code-bg); text-decoration: none; outline: none; }
.pivot-menu a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pivot-menu li[hidden] { display: none; }
/* over the choices it filters as they scroll under it, a badged icon among them included */
.pivot-filter { position: sticky; top: -4px; z-index: 1; margin: -4px -4px 4px; padding: 4px; background: var(--panel); }
.pivot-filter input { width: 100%; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
.pivot-filter input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.pivot-empty { padding: 5px 8px; color: var(--dim); }
.lede { font-size: 1.05rem; color: var(--dim); max-width: 70ch; margin-top: 0; }
.lede > :first-child { margin-top: 0; }
.notice { background: var(--interface-soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; max-width: 70ch; }
.notice.synthetic { margin-top: 16px; }

/* comparing two versions of a package */
/* the compare page's head: each row's start on the left, its controls on the right, wrapping
   under it on a narrow screen */
.compare-row { display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
/* the package's title and the versions on its line share a baseline: the title's, the labels'
   and the versions' text */
.compare-head .title-row { align-items: baseline; padding-bottom: 8px; }
.compare-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
/* on a narrow screen the versions share one line, under the package, their menus narrower */
@media (max-width: 560px) {
  .compare-pick { flex-wrap: nowrap; width: 100%; margin-left: 0; gap: 6px; }
  .compare-pick .compare-side { flex: 1 1 0; min-width: 0; }
  .compare-pick .compare-version { flex: 1 1 0; min-width: 0; }
  .compare-pick .compare-version > summary { display: flex; min-width: 0; width: 100%; padding: 0 8px; gap: 4px; }
  .compare-pick .compare-version [data-pivot-label] { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* a version to compare: a menu that looks like a field, its versions by release line */
.compare-side { display: flex; align-items: baseline; gap: 6px; font-size: 0.8rem; color: var(--dim); }
/* the menus and the swap button between them share one height */
.compare-version > summary {
  min-width: 9em; height: 36px; justify-content: space-between; margin: 0; padding: 0 10px;
  font-family: var(--mono); font-size: 0.9rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.compare-version > summary:hover, .compare-version[open] > summary { background: var(--bg); border-color: var(--dim); }
.compare-version .pivot-menu { left: 0; font-size: 0.85rem; }
.pivot-line { padding: 8px 8px 2px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; color: var(--dim); }
.pivot-line:first-child { padding-top: 2px; }
.pivot-fold button {
  display: block; width: 100%; padding: 3px 8px 3px 20px; border: 0; border-radius: 6px; background: none;
  color: var(--accent); font: inherit; font-size: 0.85em; text-align: left; cursor: pointer;
}
.pivot-fold button:hover, .pivot-fold button:focus-visible { background: var(--code-bg); outline: none; }
.compare-swap {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--dim); cursor: pointer;
}
.compare-swap:hover { color: var(--text); border-color: var(--dim); }
.compare-swap:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.compare-swap svg { width: 16px; height: 16px; }
.compare-result[aria-busy] { opacity: 0.6; }
/* how many changes of each kind, at the end of the version selectors */
/* the counts, on the breadcrumbs' line, at their size */
.compare-counts { display: flex; align-items: center; margin: 0 0 0 auto; font-family: var(--mono); font-size: 0.85rem; line-height: inherit; }
.compare-counts > span { display: inline-flex; align-items: center; }
.compare-counts.dots > * + *::before { margin: 0 6px; }
.compare-count { display: inline-flex; align-items: center; gap: 3px; padding: 0 4px; border-radius: 6px; font-weight: 600; }
.compare-count:hover { background: var(--code-bg); text-decoration: none; }
.compare-count .meta-icon { width: 14px; height: 14px; margin: 0; }
.compare-count-stop { color: var(--deprecated); }
.compare-count-caution { color: var(--interface); }
.compare-count-info { color: var(--dim); }
.compare-section h2 { display: flex; align-items: center; gap: 8px; }
.compare-section h2 .count-chip { font-size: 0.8rem; }
.change-group { display: flex; align-items: center; gap: 6px; margin: 1.2em 0 0.4em; font-size: 0.95rem; }
.change-group .kind-icon { margin: 0; }
ul.changes { list-style: none; margin: 0; padding: 0; }
.change { padding: 6px 0 6px 12px; border-left: 2px solid var(--line); margin: 4px 0; }
.change > .kind-icon { width: 14px; height: 14px; margin: 0 4px 0 6px; vertical-align: -2px; }
/* a badged icon, a used type's or a function's, sized like the others in a change */
.change > .kind-icon-used, .change > .kind-icon-badged { margin: 0 6px 0 6px; vertical-align: -2px; }
.change > .kind-icon-used .kind-icon, .change > .kind-icon-badged .kind-icon { width: 14px; height: 14px; margin: 0; vertical-align: 0; }
.change .kind-badge, .change .fbadge { width: 10px; height: 10px; }
.change code { overflow-wrap: anywhere; }
/* what happened to an item: removed and changed can break an upgrade, added rarely does */
.change-badge {
  display: inline-block; padding: 0 7px; border-radius: 999px; font-size: 0.72rem; font-weight: 650;
  text-transform: lowercase; vertical-align: 1px;
}
.change-removed { color: var(--deprecated); background: var(--deprecated-soft); }
.change-changed, .change-deprecated, .change-upgraded { color: var(--interface); background: var(--interface-soft); }
.change-added, .change-stabilized { color: var(--component); background: var(--component-soft); }
.change-caveat { display: block; margin-top: 2px; color: var(--dim); font-size: 0.85rem; }
/* a changed item's members, or its definition, before and after */
.diff { display: grid; gap: 2px; margin-top: 6px; }
.diff code { display: block; padding: 2px 8px; border-radius: 4px; font-size: 0.85rem; white-space: pre-wrap; }
.diff-mark { display: inline-block; width: 1.2em; color: var(--dim); }
.diff-del { background: var(--deprecated-soft); }
/* an IDE style tooltip for a type or function in a comparison: its definition, docs and origin */
.wit-tip {
  position: fixed; z-index: 40; max-width: min(560px, calc(100vw - 16px)); padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px var(--shadow-color); font-size: 0.85rem; line-height: 1.45; pointer-events: none;
}
.wit-tip-head { display: flex; align-items: baseline; gap: 6px; }
.wit-tip-head > .kind-icon, .wit-tip-head > .kind-icon-used, .wit-tip-head > .kind-icon-badged { flex: none; align-self: flex-start; margin: 2px 2px 0 0; }
.wit-tip-head .kind-icon { width: 14px; height: 14px; }
.wit-tip .kind-badge, .wit-tip .fbadge { width: 10px; height: 10px; }
.wit-tip-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wit-tip-def { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1em; }
/* how many more members a long record, variant, enum or flags has than its tooltip lists */
.wit-tip-more { color: var(--dim); font-style: italic; }
/* a used type's own definition, under its `use` */
.wit-tip-origin { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.wit-tip-docs { margin: 8px 0 0; color: var(--text); }
/* the interface a definition is in, beneath it */
.wit-tip-from { color: var(--dim); font-family: var(--mono); font-size: 0.85em; overflow-wrap: anywhere; }

/* the WIT, line by line, with the lines around each change and the rest folded */
.wit-options { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--dim); font-size: 0.85rem; }
pre.wit-diff { padding: 8px 0; line-height: 1.5; font-size: 0.85rem; }
.wit-line { display: block; padding: 0 14px 0 8px; white-space: pre; }
.wit-del { background: var(--deprecated-soft); }
.wit-add { background: var(--component-soft); }
/* the lines around a change, highlighted, but set back from the change */
.wit-ctx { opacity: 0.72; }
.wit-fold { display: block; margin: 4px 0; padding: 2px 14px; color: var(--dim); font-style: italic; border-block: 1px dashed var(--line); }
.diff-add { background: var(--component-soft); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
/* the side pane stays in view beside the content, scrolling on its own when it's taller than the
   window, as the page contents do, rather than once the content has scrolled to its end. Its
   menus, e.g. a group's versions, hang 4px out from its lists, inside its padding, and fit its
   width, which its scrolling clips to. */
aside {
  position: sticky; top: calc(var(--site-header) + var(--page-head) + 16px);
  max-height: calc(100vh - var(--site-header) - var(--page-head) - 32px);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  margin-inline: -4px; padding-inline: 4px;
  /* its scrollbar beside its content, in a gutter of its padding, out into the page's own, rather
     than over it, as an overlay scrollbar, e.g. Safari's, would be */
  margin-right: -14px; padding-right: 14px;
  font-size: 0.9rem;
}
aside .pivot-menu { min-width: min(240px, calc(100% + 8px)); max-width: calc(100% + 8px); }
aside section { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
aside h3 { margin-top: 1.2em; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--dim); }
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  aside { position: static; max-height: none; overflow: visible; }
}

.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 8px 0 0; }
.facts dt { color: var(--dim); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.digest { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; }
pre.wit { line-height: 1.5; }
/* the WIT a version keeps of its dependencies, folded under its own */
.nested-wit { margin-top: 12px; }
.nested-wit > summary { cursor: pointer; color: var(--dim); font-size: 0.9rem; }
.nested-wit > summary:hover { color: var(--text); }
.nested-wit > p { margin: 8px 0; font-size: 0.85rem; max-width: 75ch; }

/* a button that copies a value: in the corner of a block, outside its scrolling, or after an
   inline value. Its icon turns to a check for a moment once it has copied. */
.copy {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; padding: 0; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--dim); cursor: pointer;
}
.copy:hover { color: var(--text); background: var(--panel); border-color: var(--line); }
.copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.copy-icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.copy .copy-icon-check, .copy.copied .copy-icon-copy { display: none; }
.copy.copied .copy-icon-check { display: block; }
.copy.copied { color: var(--component); }
.copy-wrap { position: relative; }
.copy-wrap > .copy { position: absolute; top: 6px; right: 6px; background: var(--code-bg); }
.copy-wrap > .copy:hover { background: var(--panel); }
/* an inline value and its button share its line, the value giving way */
.copy-line { display: flex; align-items: flex-start; gap: 4px; }
.copy-line > code { min-width: 0; }
.copy-line > .copy { width: 22px; height: 22px; margin-block: -3px; }
.wit .k, .k { color: var(--k); }
.wit .t { color: var(--t); }
.wit .b { color: var(--b); }
.wit .f, code .f { color: var(--f); }
.wit .i { color: var(--t); }
/* code isn't bold: a field's or case's name, bold in a list of a type's members, isn't in code */
.wit .c { font-weight: inherit; }
.wit .n { color: var(--n); }
.wit .d { color: var(--d); font-style: italic; }
/* a linked type keeps its highlighting, underlined on hover */
/* a link to a type or function, which has a tooltip: in its syntax color, its dotted underline
   telling it apart from the text around it, solid on hover */
a.t, .wit a.t { color: var(--t); }
a.f, .wit a.f { color: var(--f); }
a.t, a.f {
  text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 60%, transparent);
}
a.t:hover, a.f:hover { text-decoration-style: solid; text-decoration-color: currentColor; }
/* a path to an interface, e.g. `wasi:io/streams@0.2.6` in a `use` or an `import`, is one name: its
   namespace, package, interface, version and separators in one color, linked to the interface */
.path, .wit .path * { color: var(--n); }
a.path:hover { text-decoration: underline; text-decoration-color: var(--dim); }
code .k { color: var(--k); } code .t { color: var(--t); } code .b { color: var(--b); } code .p { color: var(--text); }

ul.links, ul.items, ul.members { list-style: none; padding: 0; margin: 0; }
ul.links li { padding: 3px 0; overflow-wrap: anywhere; }
ul.items li { padding: 6px 0; border-bottom: 1px solid var(--line); }
ul.members li { padding: 6px 0 6px 12px; border-left: 2px solid var(--line); margin: 4px 0; }
.members .docs, .item .docs { color: var(--dim); font-size: 0.9rem; }
/* a paragraph break reads clearly apart from a wrapped line: the lines of a paragraph are set closer,
   and paragraphs further apart */
.docs { line-height: 1.45; }
/* a heading in docs, whatever its level, as a modest subheading of the docs it's in */
.docs :is(h3, h4, h5, h6) {
  font-size: 1em; font-weight: 650; color: var(--text); text-transform: none; letter-spacing: normal;
  margin: 1.1em 0 0.4em;
}
.docs p, .docs ul, .docs ol, .docs pre { margin: 0.75em 0; }
.members .docs :where(p, ul, ol, pre), .item .docs :where(p, ul, ol, pre) { margin: 0.6em 0; }
.docs > :first-child { margin-top: 0; }
.docs > :last-child { margin-bottom: 0; }
/* a member's docs sit a little apart from its signature */
ul.members li > .head + .docs { margin-top: 4px; }
.c { color: var(--text); font-weight: 600; }

.item { padding: 4px 0 12px; border-bottom: 1px solid var(--line); }
.item h3 { font-weight: 500; overflow-wrap: anywhere; }
.world { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px 12px; margin-bottom: 12px; }
.world h3 { margin-top: 0.8em; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .two { grid-template-columns: 1fr; } }
.docs { max-width: 75ch; }

/* a group's package: its icon, its name wrapping in a column of its own, and its count at the end */
/* a package opening a menu of its versions, its whole line the button */
.pivot.pivot-group { display: block; }
.pivot.pivot-group > summary { display: block; margin: 0 -6px; padding: 2px 6px; color: var(--text); }
.pivot-group .pivot-chevron { align-self: flex-start; margin-top: 0.25em; color: var(--dim); }
.pivot-unlinked { display: block; padding: 5px 8px; color: var(--dim); }
ul.links.groups li { padding: 0; }
/* a version and its date at the end of its line, the whole row its link */
.versions-list li { display: flex; align-items: center; gap: 4px; padding: 0; }
.versions-list .version-row { flex: 1; min-width: 0; }
/* a version's comparison with the one on view, beside it */
.version-compare {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; border-radius: 6px; color: var(--dim);
}
a.version-compare:hover, a.version-compare:focus-visible { color: var(--accent); background: var(--code-bg); outline: none; }
.version-compare .meta-icon { margin: 0; vertical-align: 0; }
.version-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin: 0 -6px; padding: 3px 6px; border-radius: 6px; color: inherit;
}
.version-row .version { min-width: 0; overflow-wrap: anywhere; }
.version-row > .dim { flex: none; }
a.version-row .version { color: var(--accent); }
a.version-row:hover, a.version-row:focus-visible { background: var(--code-bg); text-decoration: none; outline: none; }
a.version-row:hover .version { text-decoration: underline; }
/* the version on view, highlighted like the current choice of a menu */
.version-row[aria-current] { background: var(--accent-soft); }
.version-row[aria-current] .version { color: var(--accent); font-weight: 600; }
.group-line { display: flex; align-items: baseline; gap: 6px; }
.group-line > .kind-icon { align-self: flex-start; margin: 0.2em 0 0; }
.group-line > code { flex: 1; min-width: 0; overflow-wrap: anywhere; }
/* the number of versions in a group, as a chip at the end of its package's line */
.count-chip {
  flex: none; display: inline-block; min-width: 1.6em; padding: 0 6px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel); color: var(--dim);
  font-family: var(--mono); font-size: 0.75rem; line-height: 1.5; text-align: center;
  font-variant-numeric: tabular-nums; vertical-align: 1px;
}

.theme { position: relative; }
.theme-button {
  display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 6px 0 8px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--dim); cursor: pointer; font: inherit;
}
.theme-button:hover, .theme-button[aria-expanded="true"] { color: var(--text); }
.theme-button:focus-visible, .theme-menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.theme svg { width: 16px; height: 16px; flex: none; }
.theme-button .chevron { width: 14px; height: 14px; }
/* the button shows the icon of the current choice, from the attribute set before first paint */
.theme-button .icon-light, .theme-button .icon-dark { display: none; }
:root[data-theme="light"] .theme-button .icon-system,
:root[data-theme="dark"] .theme-button .icon-system { display: none; }
:root[data-theme="light"] .theme-button .icon-light,
:root[data-theme="dark"] .theme-button .icon-dark { display: block; }
.theme-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 132px; margin: 0; padding: 4px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px var(--shadow-color);
}
.theme-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text); font: inherit; font-size: 0.9rem; text-align: left; cursor: pointer;
}
.theme-menu button:hover, .theme-menu button:focus-visible { background: var(--code-bg); }
.theme-menu button svg { color: var(--dim); }
.theme-menu button[aria-checked="true"] { color: var(--accent); }
.theme-menu button[aria-checked="true"] svg { color: var(--accent); }

.gates { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.gate { font-size: 0.7rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--line); color: var(--dim); }
.gate.unstable { color: var(--interface); background: var(--interface-soft); border-color: transparent; }
.gate.deprecated { color: var(--deprecated); background: var(--deprecated-soft); border-color: transparent; }

.jump { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 8px; font-family: var(--mono); font-size: 0.85rem; }
.group { margin-top: 28px; }
.group-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.group-head h2 { margin: 0; font-size: 1.1rem; }
.group-head .pivot { font-family: var(--mono); font-size: 0.85rem; }
/* a repository's packages it didn't release at the version shown, at their own latest */
/* a repository's packages it didn't release at the version on view, in a menu */
.pivot.group-others { display: block; width: fit-content; margin-top: 10px; font-size: 0.85rem; }
.group-others > summary .count-chip { margin-left: 4px; }
/* each package's lowest and highest versions, with their dates */
.others-range { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; justify-content: flex-end; }
.others-at { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.others-at code { color: var(--text); font-weight: 400; }
/* a version's details, one size throughout */
.group-version { font-size: 0.85rem; }
.group-version code, .group-version time { font-size: 1em; }
.group-head .count .kind-icon { width: 14px; height: 14px; margin-right: 3px; vertical-align: -2px; }
/* an icon for a detail beside it, a date, commit or release notes, in the detail's color */
.meta-icon {
  width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
}
.group-details { margin-left: auto; }
/* an image's signature: verified, or one that didn't verify */
.facts .signed { color: var(--component); font-weight: 600; }
.facts .unverified { color: var(--deprecated); font-weight: 600; }
/* who signed an image and its log entry, folded under its status */
.sig-fold > summary { display: inline-flex; align-items: center; gap: 2px; cursor: pointer; list-style: none; }
.sig-fold > summary::-webkit-details-marker { display: none; }
/* the chevron of a menu, as the breadcrumbs', turned up when it's open */
.sig-fold > summary .pivot-chevron { color: var(--dim); }
.sig-fold > summary:hover .pivot-chevron { color: var(--text); }
.sig-fold[open] > summary .pivot-chevron { transform: rotate(180deg); }
.sig-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.facts.sig-facts { margin: 4px 0 2px; font-size: 0.92em; }
.sig-facts code { font-size: 0.95em; }
/* a dot between each of a list's items, however many it has, e.g. a version's release notes, date
   and commit. Its own box keeps a link's underline off it, and its alt text, none, keeps it from
   screen readers */
.dots > * + *::before {
  content: "·"; content: "·" / ""; display: inline-block; margin: 0 0.45em;
  color: var(--dim); font-weight: 400; text-decoration: none;
}
.released-with .kind-icon, .packages .kind-icon { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
/* as a card's head: the icon and the name on one row, a long name wrapping beside its icon, at its
   hyphens, and within a word only when one is wider than the list */
.released-with li { display: flex; align-items: flex-start; overflow-wrap: break-word; }
.released-with li > .kind-icon { flex: none; margin-top: 0.2em; margin-top: calc((1lh - 14px) / 2); }
.released-with li > a { min-width: 0; }
/* a world's imports and exports, as a card's head: a long item, e.g.
   `latch0: componentized:http/latch@0.1.0`, wraps beside its icon, at its spaces and hyphens, and
   within a word only when one is wider than the list */
ul.world-items li { display: flex; align-items: flex-start; overflow-wrap: break-word; }
.world-items li > .kind-icon { flex: none; margin-top: 0.15em; margin-top: calc((1lh - 16px) / 2); }
.world-items li > :is(a, code) { min-width: 0; }
/* an interface a world names, beside its icon, wrapping there: the name it's under, the link to
   it, its gates, and the docs of its import folded under them */
.world-items li > .world-item { flex: 1; min-width: 0; }
.world-ref .world-name { white-space: pre; }
.world-ref > .gates { margin-left: 8px; }
.world-item > .fold-body > .docs { margin: 2px 0 4px; color: var(--dim); font-size: 0.9rem; }
/* what a world defines itself, a row each like the interfaces it names above them: headed at
   the list's size whatever their level, not as the h4 that labels a section, e.g. a world's
   imports, when an inline interface's items are h4s */
.world-own .item { padding: 3px 0; border-bottom: 0; }
.world-own :is(.item, .item > summary) > .head { font-size: inherit; font-weight: inherit; line-height: inherit; margin: 0; overflow-wrap: anywhere; text-transform: none; letter-spacing: normal; color: var(--text); }
/* a long signature or name wraps beside its icon, not under it: indented by the icon's width and
   gap, its first line outdented by as much for the icon */
.world-own .head > .head-main { padding-left: 22px; text-indent: -22px; }
.world-own .head > .head-main > * { text-indent: 0; }
.world-own .head > .head-main > .kind-icon-badged { margin-right: 6px; }
/* its docs, and a type's members, under its name, as the docs of an import are */
.world-own :is(.item, .fold-body) > :is(.docs, .from, .members) { margin: 2px 0 4px 22px; }
.world-own :is(.item, .fold-body) > .docs { font-size: 0.9rem; }
.world-own :is(.item, .fold-body) > .from { font-size: 0.85rem; }
:is(.world-own, .world-item) .fold-body > .docs > :first-child { margin-top: 0; }
:is(.world-own, .world-item) .fold-body > .docs > :last-child { margin-bottom: 0; }
.world-own ul.members li { padding: 2px 0 2px 10px; margin: 2px 0; font-size: 0.9rem; }
/* an item with details folds them under its line, opened by it, with a chevron at its end; one
   without keeps the chevron's room, so their gates line up */
.world-fold > summary { display: flex; align-items: flex-start; gap: 6px; cursor: pointer; list-style: none; }
.world-fold > summary::-webkit-details-marker { display: none; }
.world-fold > summary > :first-child { flex: 1; min-width: 0; }
.world-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.fold-chevron { flex: none; width: 14px; height: 14px; margin-top: calc((1lh - 14px) / 2); color: var(--dim); transition: transform 0.15s; }
.world-fold > summary:hover > .fold-chevron { color: var(--text); }
.world-fold[open] > summary > .fold-chevron { transform: rotate(180deg); }
.world-own div.item > .head, div.world-item { padding-right: 20px; }
@media (prefers-reduced-motion: reduce) { .fold-chevron { transition: none; } }
/* an inline interface's own types and functions, set in under it */
.world-inline-items { margin: 2px 0 2px 22px; padding-left: 10px; border-left: 2px solid var(--line); }

.fold { margin-top: 12px; }
.fold > summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
  color: var(--accent); font-size: 0.85rem;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "▸"; color: var(--dim); transition: transform 0.15s; }
.fold[open] > summary::before { transform: rotate(90deg); }
.fold > summary:hover { border-color: var(--accent); }
.fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fold .when-open, .fold[open] .when-closed { display: none; }
.fold[open] .when-open { display: inline; }
/* the summary sits after the cards it reveals, so they read as one grid */
.fold[open] { display: flex; flex-direction: column-reverse; gap: 12px; }
.fold[open] > summary { align-self: flex-start; }

/* the page contents column */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
main.wrap.has-toc { max-width: 1440px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
.page { min-width: 0; }
.toc {
  position: sticky; top: calc(var(--site-header) + 7px); max-height: calc(100vh - var(--site-header) - 15px); overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 4px 24px 0; font-size: 0.85rem; scrollbar-width: thin;
}
.toc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.toc-title { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--dim); white-space: nowrap; }
.toc-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--dim); cursor: pointer;
}
.toc-toggle:hover { color: var(--text); border-color: var(--dim); }
.toc-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.toc-toggle svg { width: 14px; height: 14px; transition: transform 0.15s; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc ol ol { margin: 2px 0 6px 6px; padding-left: 8px; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 3px 8px; border-radius: 6px; color: var(--dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.toc li > .dim { display: none; }
.toc a:hover { color: var(--text); background: var(--code-bg); text-decoration: none; }
.toc a[aria-current] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.toc code { font-size: 0.95em; }

/* collapsed to a rail with the button to bring it back */
:root[data-toc="collapsed"] main.wrap.has-toc { grid-template-columns: 28px minmax(0, 1fr); }
:root[data-toc="collapsed"] .toc { overflow: visible; padding-right: 0; }
:root[data-toc="collapsed"] .toc-title, :root[data-toc="collapsed"] .toc-list { display: none; }
:root[data-toc="collapsed"] .toc-head { justify-content: center; }
:root[data-toc="collapsed"] .toc-toggle svg { transform: rotate(180deg); }

/* the right column's sections are listed in the contents only once it stacks under the content:
   beside the content, it's always in view */
@media (min-width: 1241px) {
  .toc .toc-aside { display: none; }
}

/* beside a contents column, the right column of a page stacks under its content sooner */
@media (max-width: 1240px) {
  .has-toc .layout { grid-template-columns: minmax(0, 1fr); }
  .has-toc aside { position: static; max-height: none; overflow: visible; }
}

/* a narrow screen folds the contents into a panel above the page */
@media (max-width: 1000px) {
  main.wrap.has-toc, :root[data-toc="collapsed"] main.wrap.has-toc { display: block; }
  .toc, :root[data-toc="collapsed"] .toc {
    position: static; max-height: none; overflow: visible; margin: 16px 0 0; padding: 8px 12px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  }
  :root[data-toc="collapsed"] .toc-title { display: inline; }
  :root[data-toc="collapsed"] .toc-head { justify-content: space-between; }
  .toc-head { margin: 0; }
  .toc-list, :root[data-toc="collapsed"] .toc-list { display: none; margin-top: 8px; }
  :root[data-toc-open="true"] .toc-list { display: block; }
  .toc-toggle svg, :root[data-toc="collapsed"] .toc-toggle svg { transform: rotate(-90deg); }
  :root[data-toc-open="true"] .toc-toggle svg { transform: rotate(90deg); }
}

/* the icon of each kind of type and of functions */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.kind-icon {
  width: 16px; height: 16px; flex: none; vertical-align: -3px; margin-right: 6px;
  fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
  color: var(--t);
}
.kind-icon.kind-resource { color: var(--n); }
.kind-icon.kind-use { color: var(--k); }
.kind-icon.kind-func { color: var(--f); }
.kind-icon.kind-world { color: var(--component); }
.kind-icon.kind-interface, .kind-icon.kind-package { color: var(--interface); }
.kind-icon.kind-component { color: var(--component); }
.kind-icon.kind-repo { color: var(--accent); }
.kind-icon.kind-namespace { color: var(--n); }
.card-head > .kind-icon {
  flex: none; width: 15px; height: 15px; margin-right: 0;
  /* centered on the name's first line */
  margin-top: 0.15em; margin-top: calc((1lh - 15px) / 2);
}
/* a heading's icon grows with its text */
h1 > .kind-icon, h2 > .kind-icon, h3 > .kind-icon { width: 0.95em; height: 0.95em; vertical-align: -0.1em; margin-right: 0.35em; }
.kind-icon.kind-variant circle, .kind-icon.kind-enum circle { fill: currentColor; stroke: none; }
.toc a .kind-icon { width: 14px; height: 14px; margin-right: 5px; vertical-align: -2px; }
.toc a[aria-current] .kind-icon { color: currentColor; }
ul.members li > .kind-icon { margin-right: 4px; }

/* a used type: the icon of the type it uses, badged with an arrow in the keyword color; and a
   composition, a component nested within a component: a component's icon, badged with another */
.kind-icon-used { position: relative; display: inline-block; margin-right: 6px; vertical-align: -3px; line-height: 0; }
.kind-icon-used .kind-icon { margin: 0; vertical-align: 0; }
.kind-badge {
  position: absolute; right: -5px; bottom: -5px; width: 11px; height: 11px; overflow: visible;
  /* the keyword color, blended toward the background so it stays behind the type's own icon */
  fill: color-mix(in srgb, var(--k) var(--badge-strength), var(--bg));
  stroke: var(--bg); stroke-width: 3.2; stroke-linejoin: round; paint-order: stroke;
}
.toc a .kind-icon-used { margin-right: 5px; vertical-align: -2px; }
/* the icon inside a badged icon keeps no spacing of its own, the badge sits on its corner */
.toc a .kind-icon-used .kind-icon { width: 14px; height: 14px; margin: 0; vertical-align: 0; }
.toc a .kind-badge { width: 10px; height: 10px; }
.toc a:hover .kind-badge { stroke: var(--code-bg); }
/* on the current entry, a badge takes the entry's color like its icon, blended toward the highlight */
.toc a[aria-current] .kind-badge { stroke: var(--accent-soft); fill: color-mix(in srgb, currentColor var(--badge-strength), var(--accent-soft)); }

/* a resource's functions sit closer under it than a section's entries */
.toc ol ol ol { margin: 0 0 4px 8px; }

/* a function's modifiers, as badges on the corners of its icon */
.kind-icon-badged { position: relative; display: inline-block; margin-right: 8px; vertical-align: -3px; line-height: 0; }
.kind-icon-badged .kind-icon { margin: 0; vertical-align: 0; }
/* a filled glyph with a halo in the page's background, drawn under the fill, to part it from the icon */
.fbadge {
  position: absolute; width: 11px; height: 11px; overflow: visible;
  fill: color-mix(in srgb, var(--mod) var(--badge-strength), var(--bg));
  stroke: var(--bg); stroke-width: 3.2; stroke-linejoin: round; paint-order: stroke;
}
.fbadge-static { top: -5px; right: -5px; --mod: var(--n); }
.fbadge-async { bottom: -5px; right: -5px; --mod: var(--b); }
.fbadge-get, .fbadge-set, .fbadge-constructor { bottom: -5px; left: -5px; }
.fbadge-get, .fbadge-set { --mod: var(--t); }
.fbadge-constructor { --mod: var(--k); }
/* a lower left badge hangs into the padding before the icon, rather than pushing the icon and its
   label out of line with the functions without one */
.toc a .kind-icon-badged { margin-right: 7px; vertical-align: -2px; }
.toc a .kind-icon-badged .kind-icon { width: 14px; height: 14px; margin: 0; vertical-align: 0; }
.toc a .fbadge { width: 10px; height: 10px; }
.toc a:hover .fbadge { stroke: var(--code-bg); }
.toc a[aria-current] .fbadge { stroke: var(--accent-soft); fill: color-mix(in srgb, currentColor var(--badge-strength), var(--accent-soft)); }

.item .from { margin: -4px 0 6px; font-size: 0.85rem; color: var(--dim); }

/* a long signature keeps a parameter per line; a long line within it still wraps */
code.sig { white-space: pre-wrap; display: inline-block; vertical-align: top; max-width: 100%; }

/* a heading's title on the left, its since, unstable and deprecated chips on the right, beside the
   first line of a long signature, or on a line below when they don't fit */
.head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.head-main { flex: 1 1 auto; min-width: 0; }
.head > .gates { margin-left: auto; flex: none; }

/* a composition's wiring as a diagram, drawn by wiring.js: panned and zoomed within its view, or
   expanded to fill the window, over the page, under a tooltip */
.wiring-diagram { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.wiring-diagram.wiring-expanded {
  position: fixed; inset: 0; z-index: 35; margin: 0; border-radius: 0; border: 0;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.wiring-locked, .wiring-locked body { overflow: hidden; }
.wiring-tools { display: flex; align-items: flex-start; gap: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.wiring-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; flex: 1 1 auto; min-width: 0; }
.wiring-tools button {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text);
  font: inherit; font-size: 1rem; line-height: 1; cursor: pointer;
}
.wiring-tools button:hover { border-color: var(--accent); color: var(--accent); }
.wiring-tools button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wiring-tools button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.wiring-tools svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
/* on one line, level with the first line of controls, whatever they wrap to; on a phone it wraps
   too, rather than leave the controls no room */
.wiring-hint { flex: none; margin-left: auto; font-size: 0.75rem; line-height: 28px; white-space: nowrap; text-align: right; }
@media (max-width: 600px) { .wiring-hint { flex: 0 1 auto; max-width: 45%; line-height: 1.3; padding-top: 2px; white-space: normal; } }
.wiring-viewport {
  position: relative; overflow: hidden; height: 320px; cursor: grab; touch-action: pan-y;
  background: radial-gradient(circle, var(--line) 1px, transparent 1px) 0 0 / 16px 16px, var(--bg);
}
.wiring-expanded .wiring-viewport { flex: 1; height: auto; touch-action: none; }
.wiring-viewport:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.wiring-viewport.wiring-dragging { cursor: grabbing; }
.wiring-viewport.wiring-dragging * { cursor: grabbing; }
/* the stage is as large as the diagram, scaled from its corner */
.wiring-stage {
  position: absolute; top: 0; left: 0; width: max-content; transform-origin: 0 0;
  display: flex; align-items: center; gap: 56px; padding: 8px; font-size: 0.8rem; user-select: none;
}
.wiring-edges { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; }
/* the bands the pointer finds an edge by, over the parts, as wide as is easy to point at */
.wiring-hits { z-index: 2; }
.wiring-hit { fill: none; stroke: transparent; stroke-width: 10; pointer-events: stroke; }
.wiring-edge { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0.75; transition: opacity 0.15s, stroke-width 0.15s; }
.wiring-edge-host { stroke: var(--dim); stroke-dasharray: 3 3; opacity: 0.35; }
.wiring-picking .wiring-edge { opacity: 0.1; }
.wiring-picking .wiring-edge.is-on { opacity: 1; stroke-width: 2.25; }
/* the composition, framed, around its parts in their columns */
.wiring-frame { position: relative; z-index: 1; padding: 8px 20px 20px; border: 1.5px dashed var(--component); border-radius: 12px; }
.wiring-frame-head { margin-bottom: 12px; color: var(--component); font-weight: 600; }
.wiring-columns { display: flex; align-items: center; gap: 64px; }
.wiring-column { display: flex; flex-direction: column; gap: 20px; }
.wiring-node {
  min-width: 170px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); box-shadow: 0 1px 2px var(--shadow-color);
}
.wiring-node.is-on { border-color: var(--accent); }
.wiring-node-head { display: flex; align-items: flex-start; gap: 6px; padding: 7px 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.wiring-node-head > .kind-icon { width: 14px; height: 14px; margin: 0; margin-top: calc((1lh - 14px) / 2); }
.wiring-title { min-width: 0; max-width: 260px; }
.wiring-title code { font-weight: 600; font-size: 1em; }
.wiring-version { color: var(--dim); font-family: var(--mono); font-size: 0.9em; }
/* a named instance's name, under the component it's an instance of */
.wiring-title code.wiring-instance { display: block; font-weight: 400; font-size: 0.85em; color: var(--dim); }
.wiring-node-ports { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; }
.wiring-ports { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wiring-ports-in { align-items: flex-start; }
.wiring-ports-out { align-items: flex-end; margin-left: auto; }
/* a port, its dot on the edge of its part where an edge joins it */
/* a port's label is on one line, its part as wide as it needs */
.wiring-port { position: relative; display: block; padding: 1px 10px; color: var(--text); white-space: nowrap; border-radius: 4px; }
.wiring-port code { font-size: 1em; }
a.wiring-port:hover { text-decoration: none; background: var(--code-bg); }
.wiring-port:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.wiring-port::before {
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -4px; border-radius: 50%;
  background: var(--panel); border: 1.5px solid var(--accent);
}
.wiring-port-in::before { left: -4.5px; }
.wiring-port-out::before { right: -4.5px; }
.wiring-port.is-on { background: var(--accent-soft); }
.wiring-port.is-on::before { background: var(--accent); }
/* the composition's own imports and exports, either side of it */
.wiring-boundary { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; }
.wiring-boundary-head { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 0 10px; }
.wiring-boundary-out { align-items: flex-end; text-align: right; }
.wiring-boundary .wiring-port { border: 1px solid var(--line); background: var(--panel); padding: 3px 10px; }
.wiring-boundary .wiring-ports { gap: 6px; }
.wiring-boundary-out .wiring-port::before { border-color: var(--dim); }
/* the focus has a line of its own, under the other controls */
.wiring-focus { display: flex; flex: 0 0 100%; flex-wrap: wrap; align-items: center; gap: 6px; }
/* clearing it is a plain ✕, a frame only while it's pointed at */
.wiring-tools button[data-wiring-clear] { border-color: transparent; background: transparent; color: var(--dim); }
.wiring-tools button[data-wiring-clear]:hover { border-color: transparent; background: var(--code-bg); color: var(--text); }
.wiring-focus-label { font-size: 0.8rem; color: var(--dim); }
.wiring-focus-label code { color: var(--text); font-size: 1em; }
/* the directions shown with a focus, one choice of three, as a segmented control */
.wiring-segments { display: inline-flex; }
.wiring-segments button { border-radius: 0; margin-left: -1px; }
.wiring-segments button:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.wiring-segments button:last-child { border-radius: 0 6px 6px 0; }
.wiring-segments button[aria-pressed="true"] { position: relative; border-color: var(--accent); }
.wiring-segments circle { fill: currentColor; stroke: none; }
/* each part's focus button, in the corner of its head; the focused part's stands out */
.wiring-focus-button {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  margin: -1px -4px 0 auto; padding: 0; border: 1px solid transparent; border-radius: 5px;
  background: transparent; color: var(--dim); cursor: pointer;
}
.wiring-focus-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.wiring-focus-button:hover { color: var(--accent); border-color: var(--line); background: var(--bg); }
.wiring-focus-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wiring-focus-button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.wiring-node.is-focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), 0 1px 2px var(--shadow-color); }
/* where an edge passes through a column, the room it's drawn along, between the parts */
.wiring-lane { height: 6px; }

/* a composition's badged icon takes the place a component's icon has in each context: the icon
   within it sized, and the whole spaced, as a plain one is there, the badge hanging into the gap
   after it, so its text lines up with its neighbors' */
span.kind-icon-used > svg.kind-icon { display: block; margin: 0; }
/* where the icon is centered on the first line of its text, by the line's height, the badged icon
   takes that height from its context, rather than the none it has to keep its own box tight */
:is(.card-head, .released-with li, .wiring-node-head) > .kind-icon-used { line-height: inherit; }
.card-head > .kind-icon-used { flex: none; margin: 0.15em 0 0 0; margin-top: calc((1lh - 15px) / 2); }
.card-head > .kind-icon-used > .kind-icon { width: 15px; height: 15px; }
:is(h1, h2, h3) > .kind-icon-used { margin-right: 0.35em; vertical-align: -0.1em; }
/* a heading has no neighbors to line up with, so its title starts after the badge, rather than
   under it */
:is(h1, h2, h3) > .kind-icon-used { margin-right: 0.6em; }
:is(h1, h2, h3) > .kind-icon-used > .kind-icon { width: 0.95em; height: 0.95em; }
/* its badge grows with it too, in the proportions a badge has on a 16px icon */
:is(h1, h2, h3) > .kind-icon-used > .kind-badge { width: 0.65em; height: 0.65em; right: -0.3em; bottom: -0.3em; }
.released-with li > .kind-icon-used, .packages li > .kind-icon-used { flex: none; margin-right: 6px; vertical-align: -2px; }
.released-with li > .kind-icon-used { margin-top: 0.2em; margin-top: calc((1lh - 14px) / 2); }
.group-line > .kind-icon-used { flex: none; align-self: flex-start; margin: 0.2em 0 0; }
.pivot-menu a .kind-icon-used { margin-right: 6px; vertical-align: -2px; }
.suggest .kind-icon-used { flex: none; align-self: center; margin-right: 6px; }
.wiring-node-head > .kind-icon-used { flex: none; margin: 0; margin-top: calc((1lh - 14px) / 2); }
.wiring-node-head > .kind-icon-used > .kind-icon { width: 14px; height: 14px; }
.wiring-node-head .kind-badge { width: 10px; height: 10px; stroke: var(--panel); }
.card .kind-badge { stroke: var(--panel); }

/* a composition's badge is a component's icon, outlined in the component color over a halo in the
   badge's own halo color, wherever that is, e.g. a card's panel */
.kind-badge-component > use { fill: none; stroke: var(--component); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.kind-badge-component > .kind-badge-halo { stroke: inherit; stroke-width: 5; }
.pivot-menu a[aria-current] .kind-badge-component > use:not(.kind-badge-halo) { stroke: currentColor; }

/* the icons page: each icon in each variant, on the backgrounds it's meant for */
.icons-intro, .icons-variants { max-width: 70ch; }
.icons-example { max-width: 100%; overflow-x: auto; padding: 8px 12px; background: var(--code-bg); border-radius: 8px; font-size: 0.85rem; }
.icons-scroll { max-width: 100%; overflow-x: auto; }
.icons-table { border-collapse: collapse; margin: 16px 0; }
.icons-table th, .icons-table td { padding: 6px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.icons-table thead th { font-size: 0.85rem; color: var(--dim); font-weight: 600; }
.icons-table tbody th { font-weight: 400; }
.icons-label { display: block; font-size: 0.85rem; color: var(--dim); }
.icons-table .swatch { text-align: center; }
.icons-table .swatch img { display: block; margin: 0 auto; }
.icons-table .swatch a { display: inline-block; padding: 6px; border-radius: 6px; }
.swatch-light a { background: #ffffff; box-shadow: inset 0 0 0 1px #e4e4e0; }
.swatch-dark a { background: #131416; box-shadow: inset 0 0 0 1px #2c2f33; }
