.non-existent-page__way {
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  padding-right: 0.25rem;
}

.non-existent-page__title {
  margin-bottom: 1rem;
}
.non-existent-page__subtitle {
  margin: 0;
}

.amnt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
#upload-binary__input {
  display: block;
  margin: 0.25rem 0 0.25rem 0;
}

.modal__title {
  font-size: 2rem;
}
.modal__title_small {
  font-size: 1.5rem;
}
.modal__confirmation-msg {
  margin: 0 0 0.5rem 0;
}

ol:not(.mojomarkup-doc ol) a {
  text-decoration: none;
  display: inline-block;
  padding: 0.25rem;
}
ol:not(.mojomarkup-doc ol) a:hover {
  text-decoration: underline;
}
.media-type-badge {
  font-size: smaller;
  color: #999;
}

/* General element positions, from small to big */
/* Phones and whatnot */
body {
  display: grid;
  row-gap: 0.5rem;
}
header {
  width: 100%;
}

.layout-card li {
  list-style-type: none;
}

@media screen and (max-width: 800px) {
  .amnt-grid {
    grid-template-columns: 1fr;
  }
  body {
    /* minmax(0, 1fr), not auto: an auto track takes its minimum from its
       widest item, and a table wider than the screen then widens the page
       instead of scrolling inside its own box. */
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }
  .main-width {
    width: 100%;
  }
  main {
    padding: 0.5rem 1rem 1rem 1rem;
  }
}

@media screen and (min-width: 500px) {
  .non-existent-page__way {
    float: left;
    width: 50%;
  }

  .non-existent-page__ways::after {
    content: "";
    display: block;
    clear: both;
  }
}

/*
 * How wide the page is.
 *
 * The page was a fixed 800px at every size above a phone, so on a 1920px screen
 * two thirds of the window was grey.
 *
 * It is still 800px below 1200px, where there is no room to spare. Above that
 * the article takes whatever the side columns do not, up to --page-max: 1000px,
 * or 1100px on a screen wider than 1800. It stops there rather than filling the
 * window, because a line of text has a comfortable length whatever the screen.
 *
 * The text fills the article. A narrower measure was tried here — paragraphs
 * held to 42.5rem inside a wider article, so that tables and pictures could use
 * the room — and it was wrong twice over: the cap started at 1400px, where the
 * article is only 1000px wide, so the prose fell from 936px to 680px in one
 * step and left a 288px band of nothing along the right; and the things that
 * were not capped, a code block and the rule between sections, then ran past
 * the text they belonged to. A ragged right edge is not a margin.
 */
:root {
  /* The width below 1200px, where the side columns do not exist yet. */
  --page-width: 800px;
  /* The most the article gets once they do. */
  --page-max: 1000px;

  /* Tables. They are variables because the dark theme used to restate the
	   table's own border and forget the cells', which left a light grid on a
	   dark page. One value each, overridden once. */
  --table-border: #ddd;
  --table-head: #eee;

  /* The hairline under a page title, above the prev/next row, and around the
	   other separators. It was #eee written into four rules, none of which the
	   dark theme overrode, so each drew a light line on a dark page. */
  --hairline: #eee;

  /* The box a page's info table is drawn in. It has to read as a panel rather
	   than as running text, so it is bordered and tinted; the tint is subtle
	   because it sits beside the prose, not around it. */
  --infobox-border: #b0b0b0;
  --infobox-background: #f4f4f4;
  --infobox-rule: #dedede;
}

/* No longer a phone but still small screen: center main */
@media screen and (min-width: 801px) {
  .main-width {
    padding: 1rem 2rem;
    width: var(--page-width);
    margin: 0 auto;
  }
  main {
    border-radius: 0.25rem;
  }
  .layout-card {
    width: var(--page-width);
    margin: 0 auto;
  }
}

@media screen and (min-width: 1800px) {
  :root {
    --page-max: 1100px;
  }
}

/* Wide enough to fit two columns ok */
@media screen and (min-width: 1100px) {
  body {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1rem;
    row-gap: 0.5rem;
  }
  header {
    grid-column: 1 / span 2;
    grid-row: 1 / span 1;
    margin: 0;
  }
  main {
    grid-column: 1 / span 1;
    grid-row: 2 / span 2;
  }
  main.main-width {
    margin-left: 0.5rem;
  }
  .markup-toolbar,
  .help-topics,
  .tags-card {
    grid-column: 2 / span 1;
    grid-row: 2 / span 1;
  }
  /* Below the tags card in the same rail. It is given a row rather than left
     to place itself: an auto-placed card landed in the first column, on the
     other side of the page from the tags it belongs beside. */
  .type-card {
    grid-column: 2 / span 1;
    grid-row: 3 / span 1;
  }
  .action-toolbar {
    grid-column: 2 / span 1;
    grid-row: 3 / span 1;
  }
  .layout-card {
    width: 100%;
    margin-left: -0.5rem;
  }
  .edit-toolbar__buttons {
    display: grid;
  }
}

@media screen and (min-width: 1150px) {
  .edit-toolbar__buttons {
    grid-template-columns: 1fr 1fr;
    grid-column-gap: 0.125rem;
  }
}

@media screen and (min-width: 1200px) {
  /* Five tracks: a gutter, the left rail, the article, the right rail, and
	   another gutter. The rails are as wide as their cards and no wider, the
	   article stops at --page-max, and the gutters take whatever is left over.

	   The gutters are what keeps a rail beside the article. With three tracks
	   and a flexible middle, the middle took all the window's slack and the
	   tags sat at the window's edge: 278px from the article at 1920px and 598px
	   at 2560px, which reads as a stray box rather than as part of the page.
	   Slack outside the composition instead — a capped body, or a centred track
	   list — put the article beside its rail but left the header band narrower
	   than the window, and the band is the site's, not the sheet's.

	   Two earlier shapes failed, and the measurements say why: a fixed middle
	   track squashed the article to 640px once the prose was capped, and an
	   `auto` middle let the article collapse to 710px while squeezing the
	   editor's toolbar off the edge of the window. Neither had gutters. */
  body {
    grid-template-columns:
      minmax(0, 1fr)
      max-content
      minmax(0, var(--page-max))
      max-content
      minmax(0, 1fr);
  }
  header {
    grid-column: 1 / span 5;
    grid-row: 1 / span 1;
    margin: 0;
  }
  .layout-card {
    max-width: 18rem;
  }
  .main-width {
    margin: 0 auto;
  }
  main.main-width {
    grid-column: 3 / span 1;
    grid-row: 2 / span 3;
    margin: 0;
    width: min(100%, var(--page-max));
    justify-self: center;
  }

  /* These belong to the article, not to a rail. Left auto-placed they landed
	   in the first column, where their width decided how wide that column was
	   and squeezed the text. */
  .prevnext {
    grid-column: 3 / span 1;
  }
  .markup-toolbar,
  .help-topics {
    grid-column: 4 / span 1;
    margin-left: -0.5rem;
    grid-row: 2 / span 2;
  }
  .markup-toolbar {
    grid-column: 4 / span 1;
    grid-row: 2 / span 2;
    margin-left: -0.5rem;
  }
  .action-toolbar,
  .tags-card {
    grid-column: 2 / span 1;
    grid-row: 2 / span 1;
    margin: 0 -0.5rem 0 0.5rem;
    justify-self: end;
  }
  .type-card {
    grid-column: 2 / span 1;
    grid-row: 3 / span 1;
    margin: 0 -0.5rem 0 0.5rem;
    justify-self: end;
  }
  .edit-toolbar__buttons {
    grid-template-columns: 1fr;
  }
}

@media screen and (min-width: 1400px) {
  .edit-toolbar__buttons {
    grid-template-columns: 1fr 1fr;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  height: 100%;
  padding: 0;
}
body {
  margin: 0;
  font-size: 16px;
  font-family: sans-serif;
  color: black;
}
input,
kbd {
  font: inherit;
  color: inherit;
}
textarea {
  font-size: 16px;
  font-family: inherit;
  line-height: 150%;
}

.edit_no-preview {
  height: 90vh;
}
.edit_with-preview .edit-form {
  height: 90vh;
}
.edit__title {
  margin-top: 0;
}
.edit__preview {
  border: 2px dashed #ddd;
  padding: 10px;
  margin: 0 -10px;
}
.edit-form__textarea {
  width: 100%;
  height: 80vh;
  min-height: 4rem;
}
.edit-form p {
  margin: 0.25rem 0;
}
.edit-form__message {
  width: 100%;
  margin: 0.25em 0;
}
.edit-form__save {
  font-weight: bold;
}

/* A save that collided with somebody else's. It is a notice, not an error:
   nothing is wrong with the author's text, it is simply not the only text. */
.edit-conflict {
  border: 1px solid #d08700;
  background-color: #fff3cd;
  padding: 0.5rem 0.75rem;
  margin: 0 0 0.75rem 0;
  /* The form is a flex column, and a flex item will not shrink below the width
     of its content unless it is told it may. A diff of a long paragraph is very
     wide, and without this the panel pushed the page sideways on a middle-width
     screen. */
  min-width: 0;
  box-sizing: border-box;
  border-radius: 0.25rem;
}
.edit-conflict__title {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
}
.edit-conflict__reason {
  margin: 0 0 0.5rem 0;
}
.edit-conflict__hint {
  margin: 0;
}
.edit-conflict__diff {
  margin-top: 0.5rem;
}
.edit-conflict__legend {
  margin: 0.25rem 0;
  font-size: 90%;
}

/* A diff is a code block, and the code block styles are written for one inside
   an article. This one is in the editor, so it needs them itself — most of all
   the wrapping: without it a diff is as wide as its longest line, which is how
   it ran off the page. */
.edit-conflict__diff pre {
  margin: 0.25rem 0 0 0;
  padding: 0.5rem;
  border-radius: 0.25rem;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Menlo", "PT Mono", monospace;
  font-size: 90%;
  background-color: rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Lighter than the page behind it, so the panel still reads as a panel. */
    --infobox-border: #5a5a5a;
    --infobox-background: #3b3b3b;
    --infobox-rule: #4a4a4a;
  }
  .edit-conflict {
    border-color: #a06b00;
    background-color: #4a3d16;
  }
  .edit-conflict__diff pre {
    background-color: rgba(0, 0, 0, 0.25);
  }
}
.edit-toolbar__buttons,
.edit-toolbar__help {
  margin: 0.5rem;
}
.edit-form {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.icon {
  margin-right: 0.25rem;
  vertical-align: bottom;
}

main h1:not(.navi-title) {
  font-size: 1.7rem;
}
blockquote {
  margin: 0;
  padding-left: 0.75rem;
}
.wikilink_external {
  padding-left: 1.2rem;
}
.wikilink_gopher {
  background: transparent left no-repeat url("/static/icon/gopher-proto.svg");
}
.wikilink_http,
.wikilink_https {
  background: transparent left no-repeat url("/static/icon/http-proto.svg");
}
.wikilink_gemini {
  background: transparent left no-repeat url("/static/icon/gemini-proto.svg");
}
.wikilink_mailto {
  background: transparent left no-repeat url("/static/icon/mailto-proto.svg");
}

article {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  line-height: 150%;
}
main h1 {
  margin: 0.5rem 0 0 0;
}
main h2,
main h3,
main h4,
main h5,
main h6 {
  margin: 1.5rem 0 0 0;
  clear: both;
}
.heading__link {
  text-decoration: none;
  display: inline-block;
}
.heading__link::after {
  width: 1rem;
  content: "§";
  color: transparent;
}
.heading__link:hover::after,
.heading__link:active::after {
  color: #999;
}
article p {
  margin: 0.5rem 0;
}

/* Every list item is wrapped in a <p>, so the paragraph margin above applied
   inside it and a list spaced itself out like a series of paragraphs. */
article li > p {
  margin: 0.15rem 0;
}
article li > ul,
article li > ol {
  margin: 0.15rem 0;
}
article ul,
ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}
article code {
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
  font-size: 90%;
  font-family: "Menlo", "PT Mono", monospace;
}
article pre.codeblock {
  padding: 0.5rem;
  white-space: pre-wrap;
  border-radius: 0.25rem;
}
.codeblock code {
  padding: 0;
  font-size: 15px;
  tab-size: 3;
}

/* The editor shows tabs as the size the code blocks do, so a tab the author
   typed is a tab the reader sees: the data block's JSON is written here. */
.edit-form__textarea {
  tab-size: 3;
}

/* A colour written as <<color #ffffff | White>>.

   The page carries the colour and, if it has one, the label. Everything about
   how a swatch looks is here, so a theme can change every swatch in the wiki
   by editing this one rule: rx: 0 makes squares, rx: 50% circles, and the
   stroke is what keeps a white swatch visible on a white page and a black one
   on a black page. */
.color-object__swatch {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
}
.color-object__swatch rect {
  rx: 50%;
  stroke: currentColor;
  stroke-opacity: 0.25;
  stroke-width: 0.08;
}
.color-object__label {
  margin-left: 0.25em;
}
/* The value of a colour written with <<color-v>>: the bytes the swatch is drawn
   from, as text, so it can be read and copied. Monospace because it is a code
   and not a word, and a little quieter than the prose so a row of colours does
   not read as a list of hex.

   It is a span rather than a <code> because the wiki's code span is drawn as a
   chip with its own background, and a chip inside a sentence about a colour
   would look like something to click. */
.color-object__value {
  margin-left: 0.25em;
  font-family: monospace;
  font-size: 0.9em;
  opacity: 0.75;
}
.transclusion {
  border-radius: 0.25rem;
  margin-bottom: 0.25rem;
  clear: both;
}
.transclusion_failed {
  padding: 0 0.5rem;
}
.transclusion__content > *:not(.binary-container) {
  margin: 0.5rem;
}
.transclusion__link {
  position: relative;
  display: block;
  float: right;
  text-align: right;
  font-style: italic;
  margin-right: 0.25rem;
  text-decoration: none;
  z-index: 2;
}
.transclusion__link::before {
  content: "⇐ ";
}

/* Derived from https://commons.wikimedia.org/wiki/File:U%2B21D2.svg */
.launchpad__entry {
  list-style-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' version='1.0' width='25' height='12'%3E%3Cg transform='scale(0.7,0.8) translate(-613.21429,-421)'%3E%3Cpath fill='%23999' d='M 638.06773,429.49751 L 631.01022,436.87675 L 630.1898,436.02774 L 632.416,433.30375 L 613.46876,433.30375 L 613.46876,431.66382 L 633.82089,431.66382 L 635.57789,429.5261 L 633.79229,427.35979 L 613.46876,427.35979 L 613.46876,425.71985 L 632.416,425.71985 L 630.1898,422.99587 L 631.01022,422.08788 L 638.06773,429.49751 z '/%3E%3C/g%3E%3C/svg%3E");
}

.binary-container {
  width: 100%;
  text-align: center;
}
.binary-container_with-img img,
.binary-container_with-video video,
.binary-container_with-audio audio {
  max-width: 100%;
  max-height: 30em;
  width: auto;
}

.subpages__title {
  padding-bottom: 0.5rem;
  clear: both;
}
.navi-title {
  padding-bottom: 0.5rem;
  margin: 0.25rem 0;
}
.navi-title a {
  text-decoration: none;
}
.navi-title__separator {
  margin: 0 0.25rem;
}
.navi-title__colon {
  margin-right: 0.5rem;
}
.upload-amnt {
  clear: both;
  padding: 0.5rem;
  border-radius: 0.25rem;
}
.upload-amnt__unattach {
  display: block;
}
aside {
  clear: both;
}

#new-name {
  width: 100%;
}

.prevnext__el {
  display: inline-block;
  min-width: 40%;
  padding: 0.5rem 0;
  margin-bottom: 0.25rem;
  text-decoration: none;
  border-radius: 0.25rem;
  max-width: 49%;
}
.prevnext__prev {
  float: left;
}
.prevnext__next {
  float: right;
  text-align: right;
}

.page-separator {
  clear: both;
}
.history__entries {
  background-color: #eee;
  margin: 0;
  padding: 0;
  border-radius: 0.25rem;
}
.history__month-anchor {
  text-decoration: none;
  color: inherit;
}
.history__entry {
  list-style-type: none;
  padding: 0.25rem;
}
.history-entry {
  padding: 0.25rem;
}
.history-entry__time {
  font-weight: bold;
}
.history-entry__author {
  font-style: italic;
}

/*
 * Tables.
 *
 * Three things were wrong with the old rules and all three showed on the page:
 * there was no rule for th at all, so a header row floated borderless above
 * boxed cells; the table and every cell each carried a border with no
 * border-collapse, so the doubled borders read as a grid of separate tiles
 * rather than a table; and the dark theme reset the table's border but not the
 * cells', leaving a light grid on a dark page.
 */
table {
  border-collapse: collapse;
  border: 1px solid var(--table-border);
  border-radius: 0.25rem;
  min-width: 4rem;
}

th,
td {
  border: 1px solid var(--table-border);
  padding: 0.25rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

th {
  background-color: var(--table-head);
  font-weight: bold;
}

td {
  word-break: keep-all;
}

caption {
  caption-side: top;
  font-size: small;
}

.subpages__list,
.subpages__list ul {
  display: flex;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}
.subpages__list ul {
  font-size: 90%;
}
.subpages__entry {
  list-style-type: none;
  border: 1px solid #999;
  padding: 0;
  margin: 0.125rem;
  border-radius: 0.25rem;
}
.subpages__link {
  display: block;
  padding: 0.25rem;
  text-decoration: none;
}
.subpages__link:hover {
  background: #eee;
}

/* Color stuff */
/* Lighter stuff #eee */
::-webkit-file-upload-button,
.btn {
  background-color: #eee;
  color: black;
}
.btn:visited {
  color: black;
}
.btn_weak {
  background-color: transparent;
}

p code,
article .codeblock,
table,
.transclusion_stand-out {
  background-color: rgba(220, 220, 220, 0.5);
}
.transclusion_failed {
  border: 1px solid #a55858;
}
.transclusion_blend .transclusion__link {
  display: none;
}

.layout-card {
  border-radius: 0.25rem;
  background-color: white;
}
.layout-card__title {
  font-size: 1rem;
  margin: 0;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem 0.25rem 0 0;
}
.layout-card__title {
  border-bottom: 1px solid var(--hairline);
}

/* Other stuff */
html {
  background-color: #eee;
}
header {
  background-color: #ddd;
}
main {
  background-color: white;
  /* A grid item's width is at least its content's, and a table is content that
     can be wider than the column. Without this the proposals table widened the
     page rather than scrolling inside its own box. */
  min-width: 0;
}
.shy-link {
  color: black;
}

blockquote {
  border-left: 2px #999 solid;
}
.wikilink_interwiki {
  color: #080;
}
.wikilink_new {
  color: #a55858;
}
.transclusion code,
.transclusion .codeblock {
  background-color: #ddd;
}
.transclusion__link {
  color: black;
}
.wikilink_new:visited {
  color: #a55858;
}
.navi-title {
  border-bottom: 1px solid var(--hairline);
}
.upload-amnt {
  border: 1px solid var(--hairline);
}
.prevnext {
  border-top: 1px solid var(--hairline);
  clear: both;
}

.tags-card__link:hover {
  background-color: #eee;
}

/* Dark theme! */
@media (prefers-color-scheme: dark) {
  html {
    background: #222;
    color: #ddd;
  }
  main,
  article,
  header,
  .layout-card {
    background-color: #343434;
    color: #ddd;
  }

  a,
  .wikilink_external {
    color: #f1fa8c;
  }
  a:visited,
  .wikilink_external:visited {
    color: #ffb86c;
  }
  .wikilink_new,
  .wikilink_new:visited {
    color: #dd4444;
  }

  .prevnext__el,
  .prevnext__el:visited {
    color: #ddd;
  }

  .layout-card__title {
    background-color: #343434;
  }

  .transclusion .transclusion__link,
  a.shy-link {
    color: #ddd;
  }

  input[type="text"],
  input[type="password"],
  ::-webkit-file-upload-button,
  .btn,
  article code,
  article .codeblock,
  .history__entry,
  .upload-amnt,
  textarea,
  table {
    border: 0;
    background-color: #444444;
    color: #ddd;
  }

  /* The cells follow the table through these two values. Before them the dark
   theme reset the table's own border and left the cells' light one, which is
   what drew a bright grid on a dark page. */
  :root {
    --table-border: #555555;
    --table-head: #3a3a3a;
    --hairline: #444444;
  }

  .transclusion_stand-out {
    background-color: rgba(68, 68, 68, 0.5);
  }

  .transclusion code,
  .transclusion .codeblock {
    background-color: #454545;
  }
  mark {
    background: rgba(130, 80, 30, 5);
    color: inherit;
  }
}

/*
 * Categories
 */
.tags-card__entries {
  padding: 0;
  margin: 0;
}
.tags-card__entry {
  display: flex;
}
.tags-card__link {
  display: inline-block;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  flex: 9;
}
.tags-card__add-to-tag {
  width: 100%;
}
.tags-card__add-form {
  width: 100%;
  display: flex;
}
.tags-card .tags-card__btn {
  display: block;
  flex: 1;
  border: none;
  background: none;
}
.tags-card #_cat-input {
  width: 100%;
  margin: 0;
  padding: 0 0.5rem;
  border: none;
}
h2 + .add-to-tagegory {
  margin-top: 0.5rem;
}
.add-to-tagegory input[type="submit"] {
  display: block;
}

@media screen and (max-width: 799px) {
  .tags-card .tags-card__btn {
    display: block;
    flex: 1;
    border: none;
    background: none;
    padding: 0.25rem 1.5rem;
  }
}

/*
 * Type
 *
 * The card that says what a page is. It is a second card rather than a second
 * list inside the Tags card, because a page is one thing and is about many:
 * one list for both is what makes a reader think a type is a tag with a
 * stricter manner.
 *
 * It uses the tags card's layout classes for its rows, and repeats the two
 * rules the tags card scopes to itself, so the two cards line up.
 */
.type-card .tags-card__btn {
  display: block;
  flex: 1;
  border: none;
  background: none;
}
.type-card #_type-input {
  width: 100%;
  margin: 0;
  padding: 0 0.5rem;
  border: none;
}
.type-card .type-card__clear {
  display: flex;
  flex: 1;
}
.type-card .type-card__clear .tags-card__btn {
  width: 100%;
}

/* The count beside a type in the list is context, not data: it says how much
   of the wiki the type describes, and it is not what the reader clicked for. */
.type-list__count {
  color: #777;
  font-size: 0.9em;
}

/*
 * A tag's or a type's description
 *
 * The prose of the page that says what the word means, above the list of pages
 * it applies to. It is set apart from the list by a rule and a little air: the
 * prose explains the word, and the list is the evidence.
 */
.description {
  margin: 0 0 0.75rem 0;
  padding: 0 0 0.75rem 0;
  border-bottom: 1px solid var(--hairline);
}

/* The link that writes the description. Quiet, because it is an offer and not
   part of what the page says. */
.description__edit {
  margin: -0.25rem 0 0.75rem 0;
  font-size: 0.9em;
}

/*
 * Shortcuts
 */
template {
  display: none;
}

kbd {
  display: inline-block;
  min-width: 1.5ch;
  text-align: center;
}

.kbd-or {
  opacity: 0.4;
}

.dialog {
  position: absolute;

  top: 0;
  left: 50%;
  width: 100%;
  max-width: 800px;
  margin: 96px auto;
  padding: 24px;
  transform: translate(-50%, 0);

  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.dialog-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.3);
}

.dialog__header {
  position: relative;
  grid-column: 1 / -1;
}

.dialog__title {
  margin: 0;
  font-size: 1.5em;
}

.dialog__close-button {
  position: absolute;
  display: block;
  top: 0;
  right: 0;
  margin: 0;
  padding: 8px;
  border: none;
  background: url(/web/static/icon/x.svg) no-repeat 8px 8px / 16px 16px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.dialog__close-button:active {
  opacity: 0.7;
}

.shortcuts-help .dialog__content {
  columns: 300px 2;
  column-gap: 32px;
  overflow: hidden;
}

.shortcuts-group {
  /* Don't break a shortcut group between columns */
  break-inside: avoid;
  page-break-inside: avoid;
  overflow: hidden;
}

.shortcuts-group-heading {
  margin: 1em 0 0.5em;
  font-size: 1.2em;
}

.shortcuts-list {
  margin: 0;
  padding: 0;
}

.shortcuts-list + .shortcuts-list {
  margin-top: 1.5em;
}

.shortcut-row {
  display: flex;
  margin: 0.5em 0;
  padding: 0;
  list-style: none;
}

.shortcut-row__description {
  flex: 1;
}

@media (prefers-color-scheme: dark) {
  .dialog {
    background-color: #343434;
    color: #ddd;
  }
  input,
  kbd {
    color: #ddd;
  }
}

/*
 * Tables
 */

.users-table {
  width: 100%;
}

.users-table td {
  white-space: nowrap;
}

.table-cell--fill {
  width: 100%;
}

/*
 * Form fields
 */

.form-field {
  margin: 1em 0;
}

.form-field label {
  display: block;
}

@media (min-width: 600px) {
  .form--double .form-field {
    display: grid;
    grid-template-columns: 150px max-content;
    grid-column-gap: 16px;
  }
  .form--double .form-field label {
    grid-column: 1;
  }
  .form--double .form-field input,
  .form--double .form-field button,
  .form--double .form-field select,
  .form--double .form-field textarea,
  .form--double .form-field__input {
    grid-column: 2;
  }
}

/*
 * Form wrap
 */

.form-wrap h2 {
  margin: 1.5em 0 0.25em;
  font-size: 1.2em;
}

/*
 * Notices
 */

.notice {
  margin: 0.5em 0;
  border: 1px solid;
  padding: 0.5em 0.7em;
}

.notice--error {
  border-color: #e15757;
  background-color: #ffb1b1;
}

/* A warning is about a consequence, not a mistake the reader just made, so it
 * is amber rather than red. */
.notice--warning {
  border-color: #d08700;
  background-color: #fff3cd;
}

@media (prefers-color-scheme: dark) {
  .notice--error {
    border-color: #a84343;
    background-color: #5b3535;
  }

  .notice--warning {
    border-color: #a06b00;
    background-color: #4a3d16;
  }
}

/*
 * Buttons
 */

::-webkit-file-upload-button,
.btn {
  line-height: normal;
  display: inline-block;
  border: 1px #999 solid;
  border-radius: 0.15rem;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  font-size: 1rem;
  margin: 0;
}

.btn:hover {
  cursor: pointer;
}

.btn_accent {
  font-weight: bold;
}

.btn_weak {
  border: 1px dashed #999;
}

a.btn_destructive,
a.btn_destructive:visited,
.btn_destructive {
  border-color: #aa1818;
  background-color: #ee4343;
  color: white;
}

@media (prefers-color-scheme: dark) {
  .btn {
    border: #444 solid 1px;
  }

  .btn:visited {
    color: #ddd;
  }

  .btn_weak {
    background-color: transparent;
  }

  .btn_destructive {
    border-color: #e34343;
    background-color: #b92828;
  }
}

.edit-toolbar__btn {
  font-size: 0.75rem;
  margin-bottom: 0.125rem;
}

/*
 * Recent changes
 */

.recent-changes__heading {
  margin: 1.2em 0 0.3em;
  font-size: 1.2em;
}

.recent-changes__entry {
  padding: 8px 16px;
  border: 2px solid #999;
  margin: 0 -16px;
}
.recent-changes__entry + .recent-changes__entry {
  margin-top: -2px;
}

.recent-changes__entry * + * {
  margin-top: 4px;
}

.recent-changes__entry__time {
  font-weight: bold;
}

/*
 * The lock page
 */
.locked-notice {
  background-color: transparent;
  display: flex;
  justify-content: center;
}
.locked-notice__message {
  max-width: 30rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.locked-notice__lock {
  font-size: 8rem;
  margin: 0;
}

.locked-notice__title {
  margin: 0 0 1rem 0;
}

.locked-notice__login-form input {
  margin-bottom: 1rem;
}

/*
 * To-do lists
 */
.item_todo {
  position: relative;
  list-style: none;
}
.item_todo > input[type="checkbox"] {
  position: absolute;
  left: -1.6rem;
  top: 0.1rem;
}
.item_todo > input[type="checkbox"][checked] {
  outline: 3px solid;
}

/*
 * Help pages
 */
.help h2:first-of-type {
  margin-top: 0.5rem;
}
.help-topics__list {
  margin: 0.5rem 0;
  padding-left: 0.5rem;
}
.help-topics__list ul {
  padding-left: 1.5rem;
  line-height: 1.6rem;
}

/*
 * Top bar
 */
.top-bar__wrapper {
  display: grid;
  padding: 0;
}
.top-bar a {
  color: black;
  text-decoration: none;
}
.top-bar__section {
  display: block;
}

.top-bar__hamburger-wrapper {
  display: flex;
  height: 100%;
  justify-content: flex-end;
}
.top-bar__hamburger {
  background: transparent;
  color: inherit;
  font-size: inherit;
  border: 0;
  display: block;
  margin: 0 0.5rem 0 0;
  padding: 0 0.5rem;
}

.top-bar__hamburger:hover,
.top-bar__home-link:hover,
.auth-links__link:hover,
.top-bar__highlight-link:hover {
  background-color: #eee;
}
.auth-links__box {
  display: block;
  line-height: 2rem;
}
.auth-links__link {
  display: block;
  padding: 0 0.5rem;
}
.top-bar__home-link-wrapper,
.top-bar__highlight {
  display: block;
  margin-right: 0.5rem;
  line-height: 2rem;
}
.top-bar__home-link,
.auth-links__link,
.top-bar__highlight-link {
  display: block;
  padding: 0 0.5rem;
}

.top-bar__search-bar {
  border: 0;
  width: 100%;
  padding: 4px 2px;
}

.top-bar__section_search {
  align-self: center;
}

@media (prefers-color-scheme: dark) {
  .top-bar a {
    color: #ddd;
  }
  .top-bar__hamburger:hover,
  .top-bar__home-link:hover,
  .auth-links__link:hover,
  .top-bar__highlight-link:hover,
  .tags-card__link:hover,
  .subpages__link:hover {
    background-color: #444;
  }
}

@media screen and (min-width: 800px) {
  .top-bar {
    padding: 0;
  }
  .top-bar__wrapper {
    margin: 0 2rem;
    grid-template-columns: 1fr 1fr 1fr;
  }
  .top-bar__section_home {
    grid-column: 1 / span 1;
  }
  .top-bar__section_search {
    grid-column: 2 / span 1;
  }
  .top-bar__section_auth {
    grid-column: 3 / span 1;
  }
  .top-bar__section_highlights {
    grid-column: 1 / span 3;
  }
  .top-bar__section_hamburger {
    display: none;
  }

  .top-bar__search-bar {
    width: 100%;
  }

  .auth-links {
    display: flex;
    justify-content: flex-end;
    margin-right: -0.5rem;
  }
  .top-bar__section_home,
  .top-bar__highlights {
    display: flex;
    padding: 0;
    margin: 0 0 0 -0.5rem;
  }
}

@media screen and (max-width: 799px) {
  header {
    margin: 0;
  }
  .top-bar__wrapper {
    margin: 0;
    grid-template-columns: 2fr 1.3fr 0.7fr;
  }
  .top-bar__section_home {
    grid-column: 1 / span 1;
    margin-left: 0.5rem;
  }
  .top-bar__section_search {
    grid-column: 2 / span 1;
    text-align: center;
    width: 100%;
  }
  .top-bar__section_hamburger {
    grid-column: 3 / span 1;
    grid-row: 1 / span 1;
  }
  .top-bar__section_auth,
  .top-bar__section_highlights {
    grid-column: 1 / span 3;
  }
  .auth-links {
    padding: 0;
  }
  .top-bar__highlights {
    padding: 0;
  }
  .top-bar__highlight {
    margin-right: 0;
  }
  .auth-links__link,
  .top-bar__highlight-link {
    padding-left: 1rem;
  }
  .top-bar__section_hidden-on-mobile {
    display: none;
  }
}

/*
 * Buttons beside the page title
 */
.btn_navititle {
  float: right;
  margin: -0.25rem 0;
  padding: 0;
}
.btn__link_navititle {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0.25rem 0.5rem;
}

/*
 * The row at the top of a page: its name, and what can be done to it.
 *
 * The two are one wrapping row. The name keeps its width and the actions keep
 * theirs; when the window cannot hold both, the actions move under the name
 * rather than the name being squeezed into a column of single words. The
 * hairline belongs to the row and not to the name, so it stays the width of
 * the article whichever way that went.
 */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  column-gap: 1rem;
  row-gap: 0.25rem;
  padding-bottom: 0.5rem;
  margin: 0.25rem 0 0 0;
  border-bottom: 1px solid var(--hairline);
}
.page-header .navi-title {
  border-bottom: none;
  padding-bottom: 0;
  margin: 0;
}
.page-header__actions {
  display: flex;
  align-items: baseline;
  column-gap: 0.75rem;
  margin-left: auto;
}
/* The list keeps the button beside it however narrow the row gets: the links
   wrap inside the list rather than pushing the button down to a line of its
   own, where it would read as another link. */
.page-header__actions .page-info {
  min-width: 0;
}
/* The buttons still float on the pages that have no header row — the tag
   page draws one beside a plain <h1> — so the float is only cancelled where
   the row decides the placement. */
.page-header__actions .btn_navititle {
  float: none;
  margin: 0;
}

/*
 * Page actions
 *
 * They used to be a line of their own at the bottom of the page, which is a
 * long way from the page they act on. They are now in the page's header row,
 * left of the buttons; only the styling of the list is left here.
 */
.page-info {
  display: block;
}
.page-info__list {
  padding: 0;
  margin: 0;
}
.page-info__entry {
  display: inline;
}
.page-info__link {
  color: #999;
}
.page-info__link:hover {
  color: inherit;
}
.page-info__entry + .page-info__entry {
  text-transform: lowercase;
}
.page-info__entry:not(:last-child) a::after {
  content: ", ";
  display: inline-block;
  text-decoration: none;
}

/*
 * Definition list
 */
dt {
  font-weight: bold;
}
dd + dt {
  margin-top: 0.5rem;
}

/*
 * Interwiki page
 * A possible improvement: show those two fields when Generic is selected, hide otherwise
 */
body[data-rrh-addr^="/interwiki"] label,
body[data-rrh-addr^="/interwiki"] input[type="text"],
body[data-rrh-addr^="/interwiki"] input[type="url"] {
  display: block;
  width: 100%;
  max-width: 35rem;
}
body[data-rrh-addr^="/interwiki"] main form {
  padding: 0 16px 16px 16px;
  margin: 0 -16px 16px -16px;
  border: 2px solid #999;
}
body[data-rrh-addr^="/interwiki"] main form + form {
  margin-top: -18px;
}
.required-field::after {
  color: red;
  content: "*";
  margin-left: 0.25rem;
}

/*
 * Admin pages
 */
.users-table {
  margin-top: 1rem;
}

/*
 * Image galleries
 */
.img-gallery {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}
@media screen and (min-width: 700px) {
  .img-gallery_layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .img-gallery_layout-side {
    float: right;
    max-width: 50%;
    margin-left: 1em;
  }

  .img-gallery_layout-normal {
    display: table;
  }
  .img-gallery_layout-normal figure {
    width: 100%;
    display: table-row;
  }
  .img-gallery_layout-normal figure > a {
    display: table-cell;
  }
  .img-gallery_layout-normal figure figcaption {
    vertical-align: top;
    display: table-cell;
    padding-left: 1rem;
    width: 300px;
  }
}
.img-gallery img {
  max-width: 100%;
  max-height: 50vh;
}
figure {
  margin: 0;
}
figcaption {
  padding-bottom: 0.5rem;
}

/* The info table a page's data block draws: an infobox at the right of the
   page, with the prose running beside it. That is where a reader of an
   encyclopedia looks for the key facts of a subject, and it keeps the facts
   out of the flow of the article while staying on the same page.

   The box is the aside rather than the table, so that the border and the tint
   surround the whole panel: a table with its own border and padding does not
   draw that reliably once border-collapse is in play, and the aside is also
   the element a screen reader announces as complementary content. */
.info-box {
  float: right;
  width: 19rem;
  max-width: 100%;
  margin: 0 0 1rem 1.5rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--infobox-border);
  border-radius: 0.25rem;
  background-color: var(--infobox-background);
  box-sizing: border-box;
}

/* The title is the box's name, so it comes first: a reader is told what the
   box describes before being shown it. The rule under it separates the name
   from everything below, which is the shape of a table header without being a
   table row, because the title is not a label for a value. */
.info-box__title {
  margin: 0 0 0.35rem 0;
  padding: 0 0 0.35rem 0;
  border-bottom: 1px solid var(--infobox-border);
  font-weight: bold;
  font-size: 1.05rem;
  text-align: center;
}

/* What the page is, under its name and above the picture: the reader is told
   what kind of thing the box describes before being shown a picture of it.
   Italic and centred so it reads as a subtitle rather than a second heading. */
.info-box__type {
  margin: 0 0 0.5rem 0;
  text-align: center;
  font-style: italic;
  font-size: 0.95rem;
}
.info-box__type-link {
  color: inherit;
}

/* The picture comes after the title and before the table, and its width is the
   box's width whatever the file is: an infobox is 19rem wide, and a 4000px
   photograph must not be what decides the layout of the page. The height
   follows, so a tall picture makes a tall box rather than an oval one. */
.info-box__image {
  margin: 0 0 0.5rem 0;
}
.info-box__image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.15rem;
}
/* A gallery entry is a figure with a caption. Inside the box those carry the
   margins of a block that stands alone in the text, which they no longer are. */
.info-box__image figure {
  margin: 0;
}
.info-box__image figcaption {
  margin-top: 0.3rem;
  font-size: 0.85em;
  text-align: center;
}

/* The table inside is deliberately plain: two columns, the key in a heading
   cell so a screen reader reads it as the label of the value beside it, and a
   rule between rows rather than a grid. The global table rules draw a border on
   every cell; this one wants rules between rows and nothing else. */
.info-box .info-table {
  border: none;
  border-collapse: collapse;
  margin: 0;
  width: 100%;
  /* Tables carry a grey wash so a Mojomarkup table stands out from prose.
     Inside the box that wash would be a second panel drawn inside the first. */
  background-color: transparent;
}
.info-box .info-table th,
.info-box .info-table td {
  padding: 0.3rem 0.4rem;
  border: none;
  border-bottom: 1px solid var(--infobox-rule);
  background: none;
  text-align: left;
  vertical-align: top;
}
.info-box .info-table tr:last-child th,
.info-box .info-table tr:last-child td {
  border-bottom: none;
}
/* What the page is about, along the bottom of the box: a label and the tag
   links on one line, so a set of tags reads as a set rather than as a list of
   alternatives. The rule above it separates the page's own facts from where the
   page sits in the wiki, which is a different kind of statement. */
.info-box__tags {
  margin: 0.4rem 0 0 0;
  padding: 0.35rem 0 0 0;
  border-top: 1px solid var(--infobox-border);
  font-size: 0.85em;
  line-height: 1.5;
}
.info-box__tags-label {
  margin-right: 0.35rem;
  color: #777;
}
.info-box__tag {
  margin-right: 0.35rem;
  white-space: nowrap;
}

.info-table__key {
  /* The label column is as narrow as its content allows but never narrower than
     a couple of words, and never so wide that the values have no room. Without
     the floor the browser shrinks it to one character and every label breaks
     mid-word; without the ceiling a long label squeezes the values. */
  width: 1%;
  min-width: 6rem;
  max-width: 45%;
  font-weight: bold;
  opacity: 0.75;
  overflow-wrap: break-word;
}
.info-table__value {
  overflow-wrap: anywhere;
}
.info-table__error {
  margin: 0 0 1rem 0;
}

/* Headings clear both sides so that one never overlaps a floated image. The
   first thing after the infobox is the exception: the text is meant to begin
   beside the box, and without this it began under it, leaving the space beside
   the box empty. Later headings still clear, so a new section starts below the
   box rather than beside it. */
.info-box ~ article > :first-child,
.info-box ~ .mojomarkup-doc > :first-child {
  clear: none;
}

/* Narrow screens have no room for two columns: the box goes above the article
   at full width, where it is read before the text it summarises. The picture
   keeps the width of the column but not the height of a page: a portrait taller
   than the screen would push the one paragraph that summarises the subject off
   it, which is the opposite of what a box is for. */
@media screen and (max-width: 700px) {
  .info-box {
    float: none;
    width: auto;
    margin: 0 0 1rem 0;
  }
  .info-box__image {
    text-align: center;
  }
  .info-box__image img {
    width: auto;
    max-width: 100%;
    max-height: 45vh;
    margin: 0 auto;
  }
}

/*
 * Primitive diff
 */
.primitive-diff__addition {
  color: green;
}
.primitive-diff__deletion {
  color: red;
}
.primitive-diff__context {
  opacity: 0.5;
}
@media (prefers-color-scheme: dark) {
  .primitive-diff__addition {
    color: #4cd74c;
  }
}

/*
 * Print CSS
 */
@media print {
  html {
    background: white;
  }
  .subpages,
  header,
  .btn_navititle,
  .page-info,
  h1 a:first-of-type,
  .prevnext,
  .tags-card input,
  .btn.tags-card__btn {
    display: none;
  }

  .tags-card h2 {
    display: inline;
    border: 0;
    margin-left: 2rem;
    padding: 0;
  }
  .tags-card h2:after {
    content: ":";
  }
  .tags-card {
    margin-top: -1rem;
  }
  .tags-card__entries {
    padding: 0;
    display: inline;
  }
  .tags-card__entry {
    display: inline-block;
  }
  .tags-card__link {
    text-decoration: underline;
    padding: 0;
  }
  .tags-card__link:after {
    content: ", ";
  }
  main {
    padding: 1rem 2rem;
    font-family: Georgia, serif;
  }
}

/*
 * Proposals: branches waiting to be merged into the served branch.
 *
 * The table borrows the user table's look, but not its no-wrap rule. That rule
 * suits a table of names; this one holds a branch name, a person's name and a
 * list of paths, and any of the three can be longer than the column the page can
 * give it. Left unwrapped they pushed the table past the article: at 1200px the
 * table was 1074 wide in a 1000px column, and the last button was cut off.
 *
 * So the cells wrap, long words break rather than stretch a column, and the
 * width is the article's.
 */
.proposals-table__scroll {
  max-width: 100%;
  overflow-x: auto;
}

.proposals-table {
  width: 100%;
  table-layout: auto;
}

.proposals-table td,
.proposals-table th {
  white-space: normal;
  vertical-align: top;
}

/* Long words break only when the column cannot take them.
   `break-word`, not `anywhere`: both break a long name, and only one of them
   leaves the column's natural width alone. `anywhere` counts the break
   opportunities when git sizes the table, so every column shrank to a single
   character and the table became a wall of letters. */
.proposals-table__name,
.proposals-table__tip,
.proposals-table__files code {
  overflow-wrap: break-word;
}

/* The actions are the point of the row, so they keep their width and the text
   gives way instead. Three buttons that each wrap mid-word are not a control.

   Selector written with the table in front of it because `.proposals-table td`
   above is a class and an element, and it would beat a bare class. Specificity
   is the difference between a rule and a rule that applies. */
.proposals-table td.proposals-table__actions,
.proposals-table th.proposals-table__actions {
  white-space: nowrap;
}

.proposals-table__name {
  font-size: 1em;
}

.proposals-table__tip,
.proposals-table__files {
  font-size: 0.9em;
  opacity: 0.75;
}

/* A conflicted proposal is not an error — it is work waiting — so it is marked
   with a rule rather than a red panel. */
.proposals-table__row_conflicted td:first-child {
  border-left: 3px solid #d08700;
  padding-left: 0.5rem;
}

.proposals-table__conflicted {
  color: #a06b00;
}

.proposals-table__action {
  display: inline-block;
  margin: 0 0 0.25rem 0.25rem;
}

@media (prefers-color-scheme: dark) {
  .proposals-table__row_conflicted td:first-child {
    border-left-color: #a06b00;
  }

  .proposals-table__conflicted {
    color: #d8a63a;
  }
}

/*
 * Settling a conflicted proposal.
 *
 * The list of pages is a checklist, because the work is one page at a time and
 * the question a resolver asks most is "how much is left". The textarea is the
 * editor's, reused: it is the same act of editing text, and the same key
 * bindings come with it.
 */
.resolve__progress {
  margin: 0.5rem 0 1rem 0;
}

.resolve__files {
  padding: 0;
  margin: 0 0 1.5rem 0;
  list-style: none;
}

.resolve__file {
  padding: 0.15rem 0;
}

.resolve__file_current {
  font-weight: bold;
}

.resolve__mark {
  display: inline-block;
  width: 1.2em;
}

.resolve__mark_settled {
  color: #1a7f37;
}

.resolve__mark_unsettled {
  color: #a06b00;
}

.resolve__textarea {
  min-height: 24rem;
}

.resolve__form {
  margin-bottom: 1.5rem;
}

.resolve__discard {
  border-top: 1px solid var(--hairline);
  padding-top: 0.75rem;
}

@media (prefers-color-scheme: dark) {
  .resolve__mark_settled {
    color: #4ac26b;
  }

  .resolve__mark_unsettled {
    color: #d8a63a;
  }
}

/*
 * Reviewing a proposal: the per-file diffs behind the list.
 *
 * A diff is already readable, so this adds only what a diff does not say: which
 * file, what happened to it, and which of the two comparisons is which. The
 * diffs themselves are the code block the rest of the wiki uses.
 */
.review__who {
  margin: 0.5rem 0 1.5rem 0;
}

.proposals-help {
  margin-top: 1rem;
}

.review__file {
  margin: 0 0 0.75rem 0;
  border: 1px solid var(--hairline);
  border-radius: 0.25rem;
  padding: 0.5rem 0.75rem;
}

.review__file > summary {
  cursor: pointer;
}

.review__path {
  font-size: 1em;
}

.review__status {
  margin-left: 0.5rem;
  font-size: 0.85em;
  opacity: 0.75;
}

.review__heading {
  margin: 1rem 0 0.25rem 0;
  font-size: 1rem;
}

.review__note {
  margin: 0 0 0.5rem 0;
  font-size: 0.9em;
  opacity: 0.8;
}

.review__back {
  margin-top: 1.5rem;
}

.proposals-table__author {
  max-width: 10rem;
}
