/* Windows 11: the variable system font with its full weight range, which system-ui does not offer */
@font-face {
  font-family: "Segoe UI Variable";
  src: local("Segoe UI Variable Text");
  font-weight: 300 700;
}

:root {
  /* the face of text: the system font of each platform */
  --sans: "Segoe UI Variable", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", "Noto Sans", Arial, sans-serif,
          "Apple Color Emoji", "Segoe UI Emoji";
  /* the face of code, wherever it is shown */
  --mono: ui-monospace, "Cascadia Mono", SFMono-Regular, Menlo, Consolas,
          "Liberation Mono", monospace;
  /* every thin line of the interface: rules, dividers, and the borders of controls */
  --line: 0.7px;
  /* the line between rows, entries and panels */
  --divider: var(--line) solid var(--border-light);
  /* the frame of controls and floating boxes */
  --frame: var(--line) solid var(--border);
  /* the bar left of a quote or a notice */
  --bar: 3px;
  --radius: 3px;
  /* gutter between columns and cells */
  --gap: 1rem;
  /* separation: within a block, between related parts, between blocks */
  --space-s: 0.2rem;
  --space-m: 0.5rem;
  --space: 0.8rem;
  /* left and right of a small label: inline code, keys, badges, messages */
  --label-pad: 0.3rem;
  /* the distance of the fixed panels from the window edge */
  --inset: 8px;
  /* the shadow around a selected item */
  --halo: 4px;
  /* between semibold and bold: Segoe UI Semibold is too light, Bold too heavy */
  --bold: 650;
  /* secondary text: notes, counts, previews */
  --small: 0.91rem;
  /* captions */
  --smaller: 0.82rem;
  /* labels and badges */
  --tiny: 0.68rem;
  /* boxes that float above the page, and the dimmed page behind them */
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  --backdrop: rgba(0, 0, 0, 0.2);
  /* the height of the editor and of the result view */
  --editor-height: calc((100vh - 13rem) / 2);

  --bg: #fff;
  --fg: #111;
  --accent: #c33;
  --accent-strong: #a22;
  --muted: #666;
  --strong: #333;
  --border: #aaa;
  --border-light: #ddd;
  /* the face of code and buttons, and of what is pointed at */
  --shade: #f8f8f8;
  --shade-hover: #eee;
  /* the rule below a heading or a table header */
  --rule: #c66;
  /* a search match */
  --mark: #fff3c4;
  /* the permission badge of a definition */
  --badge: #7d3209;
  --badge-bg: #fdeee2;
  --badge-border: #e0b294;
  /* deleted and inserted lines of a diff, and the characters that differ in them */
  --del: #fdd;
  --ins: #dfd;
  --del-strong: #faa;
  --ins-strong: #9e9;

  /* let native controls (scrollbars, dialogs) follow the light or dark scheme of the system */
  color-scheme: light dark;
}

/* the dark palette of the DBA; the editor follows the scheme on its own (cm6.js) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1e1e;
    --fg: #ddd;
    --accent: #f77;
    --accent-strong: #e66;
    --muted: #aaa;
    --strong: #ccc;
    --border: #555;
    --border-light: #444;
    --shade: #2a2a2a;
    --shade-hover: #333;
    --rule: #844;
    --mark: #5a4a14;
    --badge: #f0b48a;
    --badge-bg: #3d2717;
    --badge-border: #7a4a2c;
    --del: #4a2526;
    --ins: #253f25;
    --del-strong: #7a3335;
    --ins-strong: #3a6a3a;
  }

  /* highlight.css only has a light theme: its colors are lightened, with the same hues */
  .hljs {
    background: var(--shade);
    color: var(--fg);
  }
  .hljs-comment { color: #8a9393; }
  .hljs-tag, .hljs-punctuation { color: color-mix(in srgb, var(--fg) 67%, transparent); }
  .hljs-tag :is(.hljs-name, .hljs-attr) { color: var(--fg); }
  .hljs-type, .hljs-string, .hljs-number, .hljs-selector-id, .hljs-selector-class, .hljs-quote,
  .hljs-template-tag, .hljs-deletion, .hljs-title, .hljs-section {
    color: #e78284;
  }
  .hljs-regexp, .hljs-symbol, .hljs-variable, .hljs-template-variable, .hljs-link,
  .hljs-selector-attr, .hljs-operator, .hljs-selector-pseudo {
    color: #e5a0a0;
  }
  .hljs-literal { color: #9c6; }
  .hljs-built_in, .hljs-bullet, .hljs-code, .hljs-addition { color: #8fc96b; }
  .hljs-meta { color: #6cb6dd; }
  .hljs-meta .hljs-string { color: #7ab8e0; }
}

/* suppress the automatic font enlargement of mobile browsers, which assigns
   different sizes to different blocks as soon as the page scrolls sideways */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* a declared width or height is the size the box takes, padding and border included */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: var(--sans);
  line-height: 1.5;
  font-size: 1rem;
  background-color: var(--bg);
  color: var(--fg);
}

/* a wrapped heading stays together */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
}

h1, h2, h3, h4, h5, h6, th, b, strong {
  font-weight: var(--bold);
}

/* form controls follow the page font */
input, select, button, textarea {
  font: inherit;
}

code, pre, kbd, samp, textarea, .diff, body .cm-editor .cm-scroller {
  font-family: var(--mono);
}

p {
  margin: 0 0 var(--space);
}

h1, h2 {
  color: var(--accent-strong);
  border-bottom: var(--line) solid var(--rule);
}

h3, h4 {
  color: var(--strong);
}

h1 {
  font-size: 2rem;
  margin: var(--space-m) 0 var(--space);
}

h2 {
  font-size: 1.5rem;
  margin: var(--space) 0;
}

h3 {
  font-size: 1.3rem;
  margin: var(--space) 0;
  border-bottom: var(--divider);
}

h4 {
  margin: var(--space-m) 0;
}

table {
  border-collapse: collapse;
}

th, td {
  vertical-align: top;
  padding: var(--space-s) var(--gap) var(--space-s) 0;
  border-bottom: var(--divider);
}

th {
  text-align: left;
  border-bottom-color: var(--rule);
}

ol, ul, dd {
  padding: 0 0 0 1.2rem;
  margin: 0;
}

/* separates a list from the following text; nested lists stay compact */
:is(ol, ul):not(li > *, :last-child) {
  margin-bottom: var(--space);
}

/* a paragraph introducing a list stays close to it */
p:has(+ :is(ol, ul)) {
  margin-bottom: var(--space-m);
}

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

a:hover {
  text-decoration: underline;
}

:is(h1, h2, h3) a:hover {
  text-decoration: none;
}

a[href*="://"]::after {
  content: "⁺";
}

b, strong {
  color: var(--strong);
}

mark {
  background-color: var(--mark);
  color: inherit;
  border-radius: var(--radius);
  padding: 0 2px;
}

/* shaded panels: definitions, the bar of the fiddle dialog, notices */
.definition, .fiddle-dialog-bar, .list-subscribe {
  background-color: var(--shade);
}

.definition {
  padding: var(--space-m);
  margin: var(--space-s) 0 var(--space-m);
}

/* long lines of code, messages and diffs are wrapped instead of overflowing the article;
   'anywhere' also breaks a single unbreakable token, so that no block widens the page */
pre, .list-text, .diff td {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

pre {
  margin: var(--space-m) 0;
}

pre.definition {
  position: relative;
}

/* the box spans the full width of the block, so that the floating button bar is placed in its
   upper right corner */
pre code {
  display: block;
}

/* keep the signature clear of the permission badge, which may list several levels */
pre.definition.reserved {
  padding-right: 6rem;
}

/* every line of a definition is a block of its own, so that a line too long for the viewport
   is wrapped with a hanging indent instead of continuing in the first column, where it would
   be mistaken for a new line of the definition */
.definition .line {
  display: block;
  padding-left: 4ch;
  text-indent: -4ch;
}

/* the buttons of a code block, in the upper right corner; a little more distance from the
   border than the permission badge. the bar floats, so that only the lines beside it are
   shortened. the buttons are stacked, and share the width of the widest one, so that a Run
   link is placed right below the Copy button */
.code-bar {
  float: right;
  margin: 0.3rem 0.45rem 0 var(--space-s);
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

.fiddle-link, .copy-link, .perm {
  font-size: var(--tiny);
  border: var(--divider);
  border-radius: var(--radius);
  padding: 0 var(--label-pad);
  background-color: var(--shade);
}

/* the buttons sit above each other, so they are centered in the width they share */
.fiddle-link, .copy-link {
  text-align: center;
}

/* the width is fixed: the label changes when the code was copied */
.copy-link {
  min-width: 4rem;
}

.fiddle-link:hover {
  background-color: var(--shade-hover);
}

/* same box as the code buttons; the level name carries the meaning, color only reinforces it */
.perm {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  color: var(--badge);
  background-color: var(--badge-bg);
  border-color: var(--badge-border);
  font-weight: var(--bold);
}

.perm a {
  color: inherit;
}

#fiddle-dialog {
  width: min(72rem, 96vw);
  height: min(48rem, 94dvh);
  padding: 0;
}

/* boxes that float above the page: the fiddle dialog, the keyboard shortcuts */
#fiddle-dialog, #shortcuts {
  border: var(--frame);
  border-radius: calc(var(--radius) * 2);
  box-shadow: var(--shadow);
}

#fiddle-dialog[open] {
  display: flex;
  flex-direction: column;
}

/* the page behind a dialog is dimmed discreetly */
#fiddle-dialog::backdrop {
  background-color: var(--backdrop);
}

#fiddle-dialog iframe {
  flex: 1;
  width: 100%;
  border: none;
}

.fiddle-dialog-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space);
  font-size: var(--tiny);
  padding: var(--space-s) var(--space-m);
  border-bottom: var(--divider);
}

.fiddle-dialog-bar button {
  border: none;
  background: none;
  font-size: var(--smaller);
  padding: 0 var(--space-s);
}

/* code, however much of it there is, and keys */
code, kbd, .definition, pre.extract, .diff {
  font-size: 0.875em;
}

code, kbd, .definition, .viewport {
  border: var(--divider);
  border-radius: var(--radius);
}

code {
  padding: 0 var(--label-pad);
  margin: 0 2px;
}

/* a key, as the overview of the keyboard shortcuts names it */
kbd {
  padding: 0 var(--label-pad);
  border-color: var(--border);
  background-color: var(--shade);
}

/* fields, buttons, checkboxes and the editor share their frame */
textarea, body .cm-editor, select, button,
input:is([type="text"], [type="password"], [type="number"], [type="submit"], [type="button"],
  [type="checkbox"]),
input[type="file"]::file-selector-button {
  border: var(--frame);
  border-radius: var(--radius);
  outline: none;
}

textarea {
  resize: none;
}

select, button,
input:is([type="text"], [type="password"], [type="number"], [type="submit"], [type="button"]),
input[type="file"]::file-selector-button {
  padding: 0.25rem 0.5rem;
}

input:is([type="text"], [type="password"], [type="number"]), select {
  width: 12.5rem;
}

/* buttons share the flat face of the code buttons */
button, input:is([type="submit"], [type="button"]), input[type="file"]::file-selector-button {
  background-color: var(--shade);
  color: inherit;
  cursor: pointer;
  /* a button label is never broken over two lines */
  white-space: nowrap;
}

:where(input[type="submit"], input[type="button"], button):hover:not(:disabled),
input[type="file"]::file-selector-button:hover {
  background-color: var(--shade-hover);
}

:where(input[type="submit"], input[type="button"], input[type="checkbox"], button):disabled {
  opacity: 0.5;
  cursor: default;
}

/* a checked box is filled with the link color and carries a white tick */
input[type="checkbox"] {
  appearance: none;
  width: 0.875rem;
  height: 0.875rem;
  margin: 0 0.375rem 0 0;
  vertical-align: -0.125rem;
  background: var(--bg) center / 0.625rem no-repeat;
  cursor: pointer;
}

input[type="checkbox"]:hover:not(:disabled) {
  border-color: var(--rule);
}

input[type="checkbox"]:checked {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5.2 4 7.5 8.5 2.5' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* the search field of the page header keeps room for its placeholder */
#search {
  width: 15rem;
}

/* a selection is drawn like a field, with a chevron instead of the native arrow */
select {
  appearance: none;
  padding-right: 1.625rem;
  background: var(--bg) right 0.5625rem center / 0.5625rem no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  cursor: pointer;
}

/* the focus is marked inside the border: a ring outside would be clipped by a box that scrolls */
:is(input, select, textarea):focus {
  border-color: var(--rule);
  box-shadow: inset 0 0 0 0.5px var(--rule);
}

:is(input[type="submit"], input[type="button"], input[type="checkbox"]):focus {
  box-shadow: none;
}

:is(input[type="submit"], input[type="button"], input[type="checkbox"], button):focus-visible {
  border-color: var(--fg);
  box-shadow: inset 0 0 0 0.5px var(--fg);
}

/* a link is tinted instead, as a box that scrolls clips what sticks out of it */
a:focus-visible {
  outline: none;
  border-radius: var(--radius);
  background-color: color-mix(in srgb, var(--accent) 15%, transparent);
  text-decoration: underline;
}

/* whatever else takes the focus, such as a box that scrolls, is ringed inside its own box */
:focus-visible {
  outline-offset: -2px;
}

/* what reacts to the pointer changes its shade softly */
button, input:is([type="submit"], [type="button"], [type="checkbox"]),
input[type="file"]::file-selector-button {
  transition: background-color 0.1s, border-color 0.1s;
}

/* the navigation and the article scroll side by side: thin scrollbars keep them calm */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* a divider separates related blocks, such as the examples of a function */
hr {
  height: var(--line);
  border: 0;
  background-color: var(--border-light);
  margin: var(--space-m) 0;
}

/* the dividers between the groups of the navigation are drawn in the color of the DBA */
.leftbar hr {
  background-color: var(--border);
}

blockquote {
  border-left: var(--bar) solid var(--border-light);
  padding-left: 0.7rem;
  margin: var(--space-m);
}

img {
  padding: var(--space-s);
}

.preview {
  max-height: 100px;
  max-width: 150px;
}

.announce {
  color: var(--accent);
  font-weight: var(--bold);
}

.error {
  color: var(--accent-strong);
}

/* a message is a badge, tinted with its own color and marked by a glyph, as in the DBA; an empty
   one shows nothing */
.error:not(:empty) {
  width: fit-content;
  max-width: 100%;
  padding: 0 var(--label-pad);
  border-radius: var(--radius);
  background-color: color-mix(in srgb, currentColor 12%, transparent);
}

.error:not(:empty)::before {
  content: "\2717\00a0";
}

/* the error line of the editor keeps its height while it is empty */
#error {
  min-height: 1lh;
}

.invalid {
  text-decoration: line-through;
  font-weight: var(--bold);
}

.caps {
  font-variant: small-caps;
}

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

.align-center {
  text-align: center;
}

.align-right {
  text-align: right;
}

.max, .search, .diff {
  width: 100%;
}

.search td.max {
  max-width: 0;
}

/* section of the search extracts that follow */
p.section {
  font-size: var(--small);
  margin-bottom: 0;
}

/* number of matches of an article, if not all of them are shown */
h3 .count {
  font-size: var(--small);
  font-weight: normal;
  color: var(--muted);
  margin-left: var(--space-m);
}

.right {
  float: right;
  padding-left: 1.3rem;
}

.noborder {
  border: 0;
}

.small {
  font-size: var(--small);
}

/* secondary text: dates, counts, quotes, closings */
.muted {
  color: var(--muted);
}

.grayscale {
  filter: grayscale(1);
}

/* mailing list: messages keep their line breaks; quotes are collapsed. the avatar has a column
   of its own; the message is aligned with the name of the sender */
.list-message {
  --avatar: 2.2rem;
  display: flex;
  gap: 0.7rem;
  border-top: var(--divider);
  padding: var(--space-m) 0;
}

.list-body {
  flex: 1;
  min-width: 0;
}

.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.6rem;
  min-height: var(--avatar);
  align-content: center;
  margin-bottom: var(--space-s);
}

.list-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--avatar);
  height: var(--avatar);
  border-radius: 50%;
  color: #fff;
  font-size: var(--smaller);
  font-weight: var(--bold);
  flex-shrink: 0;
}

.list-from {
  font-weight: var(--bold);
}

.list-time {
  margin-left: auto;
  white-space: nowrap;
}

.list-text {
  margin: var(--space-s) 0;
}

.list-text p {
  margin: 0;
}

.list-text p + p {
  margin-top: 0.5lh;
}

.list-quote summary {
  font-size: var(--smaller);
  cursor: pointer;
}

.list-header {
  margin-bottom: var(--space-m);
}

.list-footer {
  border-top: var(--divider);
  padding-top: var(--space-m);
}

.list-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: var(--space-m) 0;
}

.list-search input[name='input'] {
  flex: 1 1 15rem;
}

.list-search input:not([name='input']) {
  width: 7rem;
}

.list-subscribe {
  margin: var(--space-m) 0;
  padding: var(--space-m);
  border-left: var(--bar) solid var(--accent);
}

.list-thread {
  padding: var(--space-m) 0;
  border-bottom: var(--divider);
}

.list-subject {
  font-weight: var(--bold);
  font-size: 1.09rem;
}

.list-title {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.list-badge {
  margin-left: auto;
  flex-shrink: 0;
  background-color: var(--shade-hover);
  border-radius: 0.7rem;
  padding: 0 var(--label-pad);
  white-space: nowrap;
}

.list-latest .list-preview {
  -webkit-line-clamp: 1;
}

.list-preview {
  color: var(--strong);
  font-size: var(--small);
  margin-top: var(--space-s);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.search td.list-authors {
  max-width: 14rem;
}

.list-navigation {
  display: flex;
  justify-content: space-between;
  gap: var(--gap);
  margin: 0 0 var(--space);
}

.list-navigation span:last-child {
  text-align: right;
}

.editor, .viewport {
  display: block;
  height: var(--editor-height);
  min-height: 10rem;
}

.cm-editor.editor {
  display: flex;
  flex-direction: column;
  max-height: var(--editor-height);
}

.cm-editor.editor .cm-scroller {
  flex: 1 1 0;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: auto;
}

/* the theme rings a focused editor in cyan, a color that is used nowhere else. The theme is
   injected after this stylesheet: the rules are one class more specific than the theme's, so
   that they win */
body .cm-editor {
  overflow: hidden;
}

body .cm-editor.cm-focused {
  outline: none;
  box-shadow: none;
  border-color: var(--rule);
}

/* the gutter is set apart by its shade; a second line next to the frame is not needed */
.cm-editor .cm-gutters {
  background-color: var(--shade);
  border-right: var(--divider);
  color: var(--muted);
}

.cm-editor .cm-activeLineGutter {
  background-color: var(--shade-hover);
  color: var(--fg);
}

.viewport {
  clear: both;
  overflow-y: auto;
  padding: var(--space-s) 0.7rem;
}

.buttons {
  display: flex;
  gap: var(--space-m);
  margin: var(--space-m) 0;
}

/* buttons that belong together, e.g. Download and Upload */
.buttons.group {
  gap: 0.15rem;
  margin: 0;
}

.nowrap {
  white-space: nowrap;
}

.oneline, .search td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the bottom margin separates the controls from the differences by a blank line */
.revisions {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

/* the list of keyboard shortcuts, toggled with '?' */
#shortcuts {
  position: fixed;
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: var(--space-m) 1.2rem var(--space);
  background-color: var(--bg);
  cursor: pointer;
}

/* the item (section, result, message) that was selected with J and K; the shadow extends the
   background beyond the text without shifting the layout */
.selected {
  background-color: var(--shade-hover);
  box-shadow: 0 0 0 var(--halo) var(--shade-hover);
  border-radius: var(--radius);
  scroll-margin: var(--halo);
}

/* the generic rule assigns a fixed width to every select: the flex basis takes its place */
.revisions select {
  flex: 1;
  min-width: 0;
}

.diff {
  table-layout: fixed;
  margin-top: var(--space-s);
}

.diff td {
  border: 0;
  padding: 0 var(--label-pad);
}

/* the column is wide enough for five digits, plus the padding of the cell */
.diff .num {
  width: calc(5ch + 2 * var(--label-pad));
  text-align: right;
  color: var(--muted);
  user-select: none;
}

.del {
  background-color: var(--del);
}

.ins {
  background-color: var(--ins);
}

/* the characters in which two paired lines differ: a stronger tint inside the tint of the line */
.del .chg {
  background-color: var(--del-strong);
}

.ins .chg {
  background-color: var(--ins-strong);
}

.pointer {
  cursor: pointer;
}

.logo {
  position: fixed;
  margin: 0.1rem 0 0.3rem 0.3rem;
  top: 10px;
  left: 10px;
}

.leftbar {
  position: fixed;
  width: 200px;
  height: 100%;
  padding-top: 110px;
  left: 5px;
}

/* the box is absolutely positioned: without a width, it would shrink to fit its entries, and a
   divider would not span the sidebar */
.leftnav {
  position: absolute;
  width: 100%;
  height: calc(100% - 150px);
  overflow-y: auto;
  padding-right: 1rem;
}

/* the scroll container clips its overflow: the left padding leaves room for the shadow of a
   selected item, and the left position is reduced by the same amount */
.content {
  position: fixed;
  top: var(--inset);
  bottom: 0;
  left: calc(228px - var(--halo));
  right: 0;
  overflow-y: auto;
  max-width: 852px;
  padding: 0 26px 0 var(--halo);
}

.content:focus {
  outline: none;
}

/* the strip of a version other than main is placed below the floating search field, which is
   higher than the breadcrumb, and the margin of the field separates both */
#content > form > .right {
  margin-bottom: var(--space-m);
}

.version-strip {
  clear: both;
  margin: var(--space-m) 0;
  padding: var(--space-s) var(--space-m);
  border-left: var(--bar) solid var(--accent);
}

.rightbar {
  position: fixed;
  margin-left: 1088px;
  overflow-y: auto;
  top: var(--inset);
  min-width: 216px;
  height: calc(100% - 2 * var(--inset));
  padding-right: 16px;
}

/* frames around the function names of the table of contents would outweigh the other entries */
.rightbar code {
  border: 0;
  padding: 0;
  margin: 0;
}

.nav ul {
  list-style-type: none;
  padding: 0;
  margin-left: 0.6rem;
}

.nav a {
  color: var(--strong);
  display: block;
  transition: background-color 0.2s;
}

.nav a:hover {
  text-decoration: none;
  background-color: var(--border-light);
}

/* the ☰ menu button is desktop-hidden; the mobile breakpoint reveals it */
#navtoggle {
  display: none;
}

/* Mobile: un-fix the panels. The left navigation becomes a slide-in drawer
   toggled by #navtoggle, the article takes the full width, the local TOC on
   the right is dropped. */
@media (max-width: 800px) {
  /* the size that a finger reliably hits, and the room right of the menu button
     (the 1rem is the left padding of .content) */
  :root {
    --touch: 2.75rem;
    --touch-offset: calc(var(--inset) + var(--touch) - 1rem);
  }

  #navtoggle {
    display: block;
    position: fixed;
    top: var(--inset);
    left: var(--inset);
    z-index: 30;
    width: var(--touch);
    height: var(--touch);
    font-size: 1.4rem;
    line-height: 1;
    padding: 0;
    color: var(--accent-strong);
    background: var(--bg);
    border: var(--line) solid var(--rule);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  }

  body.nav-open #navtoggle {
    background: var(--shade-hover);
  }

  /* the drawer dims the article; a tap on the dimmed part closes it (see toggleNav) */
  body.nav-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--backdrop);
    z-index: 10;
  }

  .logo {
    position: static;
    margin: 0 0 var(--space-m);
  }

  .leftbar {
    left: 0;
    width: 240px;
    max-width: 85vw;
    padding: 3.5rem 0 1rem 0.75rem;
    background: var(--bg);
    overflow-y: auto;
    box-shadow: var(--shadow);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 20;
  }

  body.nav-open .leftbar {
    transform: translateX(0);
  }

  /* entries are spaced out: they are tapped, not clicked */
  .leftnav {
    position: static;
    height: auto;
    overflow-y: visible;
    line-height: 2em;
  }

  .content {
    position: static;
    max-width: 100%;
    padding: 0 1rem 1rem;
  }

  /* the search field fills the row right of the menu button; without it, the breadcrumb does */
  .content > form {
    display: flex;
    align-items: center;
    min-height: var(--touch);
    margin-left: var(--touch-offset);
  }

  .content > form:has(input) + .small {
    margin-top: var(--space-m);
  }

  .content > form:not(:has(input)) {
    display: none;
  }

  .content > form:not(:has(input)) + .small {
    min-height: var(--touch);
    padding-left: var(--touch-offset);
    display: flex;
    align-items: center;
  }

  .content > form .right {
    float: none;
    flex: 1;
    padding-left: 0;
  }

  #search {
    width: 100%;
  }

  /* tables do not shrink below their contents: let them scroll on their own
     instead of widening the whole page (code blocks wrap, see 'pre') */
  .content table:not(.diff, .search) {
    display: block;
    overflow-x: auto;
  }

  .rightbar {
    display: none;
  }

  /* mailing list: smaller avatars leave more room for the text; participants are dropped */
  .list-message {
    --avatar: 1.6rem;
    gap: var(--space-m);
  }

  .list-avatar {
    font-size: var(--tiny);
  }

  /* the rows of the month table are stacked: subject, then messages and date of the last post */
  .list-threads tr:first-child,
  .list-threads td.list-authors {
    display: none;
  }

  .list-threads tr {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.6rem;
    padding: var(--space-s) 0;
    border-bottom: var(--divider);
  }

  .list-threads td {
    border: 0;
    padding: 0;
    color: var(--muted);
  }

  .list-threads td.max {
    flex-basis: 100%;
    max-width: none;
    white-space: normal;
  }

  .list-threads td.align-right::after {
    content: ' ' attr(data-unit) ' ·';
  }
}
