:root {
  color-scheme: light dark;
  --bg: #FBFAF7;
  --fg: #1B1B1A;
  --muted: #6B6A66;
  --accent: #B4401F;
  --link: #B4401F;
  --good: #18794E;
  --line: #DDDDDD;
  --hl: #FFF3B0;
  --add-bg: #E6FFEC;
  --del-bg: #FFEBE9;
  --k: #0033B3;
  --t: #7A3E9D;
  --s: #18794E;
  --n: #1750EB;
  --c: #6A737D;
  --b: #8B4513;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181A;
    --fg: #E6E4DE;
    --muted: #9A988F;
    --accent: #EE8A63;
    --link: #EE8A63;
    --good: #6CCB8F;
    --line: #333333;
    --hl: #4A4000;
    --add-bg: #12361F;
    --del-bg: #4A1D1D;
    --k: #8AB4F8;
    --t: #D2A8FF;
    --s: #7EE787;
    --n: #79C0FF;
    --c: #9198A1;
    --b: #FFA657;
  }
}
* { box-sizing: border-box; }
/* a phone may inflate the text of a wide block; code would then outgrow the page's own */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0 auto;
  max-width: 56rem;
  padding: 1.5rem 1rem 3rem;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, sans-serif;
}
h1 { margin: 0 0 1rem; padding-bottom: .4rem; border-bottom: 3px solid var(--accent); }
h2 { margin: 2rem 0 .5rem; font-size: 1.1rem; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
table { width: 100%; border-collapse: collapse; }
td { padding: .25rem .5rem .25rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td.size, td.date { white-space: nowrap; color: var(--muted); }
td.size { text-align: right; padding-right: 0; }
td.hash { font-family: ui-monospace, monospace; }
td.hash a { color: var(--good); }
.empty { color: var(--muted); font-style: italic; }
/* code colours: the classes Colour writes; a span stays on its line */
.k { color: var(--k); font-weight: 600; }
.t { color: var(--t); }
.s { color: var(--s); }
.n { color: var(--n); }
.c { color: var(--c); font-style: italic; }
.b { color: var(--b); }
h1.crumbs { font-size: 1.4rem; overflow-wrap: anywhere; }
.meta { margin: 0 0 1rem; color: var(--muted); }
/* the row under the title (Lhtml.nav): the page you are on is bold and underlined, not only a colour */
nav { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; margin: 0 0 1rem; }
nav a[aria-current] { color: var(--fg); font-weight: 700; border-bottom: 2px solid var(--accent); }
/* one font for a whole code table, its numbers too, so that a row is as tall as its text */
code, table.code, table.diff { font-family: ui-monospace, monospace; font-size: .9rem; line-height: 1.45; }
table.code { margin-top: 1rem; border: 1px solid var(--line); }
table.code td { padding: 0 .5rem; border-bottom: 0; }
table.code td.ln { width: 1%; text-align: right; user-select: none; }
table.code td.ln a { color: var(--muted); }
table.code td.src { white-space: pre; tab-size: 4; }
table.code tr:target td { background: var(--hl); }
div.scroll { overflow-x: auto; }
td.subject { overflow-wrap: anywhere; }
.pages { margin-top: 1rem; }
dl.commit { display: grid; grid-template-columns: max-content 1fr; gap: .1rem 1rem; margin: 0 0 1rem; }
dl.commit dt { color: var(--muted); }
dl.commit dd { margin: 0; overflow-wrap: anywhere; }
dd.hash { font-family: ui-monospace, monospace; }
section.file { margin-top: 1.5rem; }
section.file h3 { margin: 0 0 .4rem; font-size: 1rem; overflow-wrap: anywhere; }
.change { color: var(--muted); font-weight: normal; }
.change.added, .plus { color: var(--good); }
.change.deleted, .minus { color: var(--link); }
ul.changes { margin: 0; padding-left: 1.2rem; }
table.diff { border: 1px solid var(--line); }
table.diff td { padding: 0 .4rem; border-bottom: 0; }
table.diff td.ln { width: 1%; text-align: right; color: var(--muted); user-select: none; }
table.diff td.src { white-space: pre; tab-size: 4; }
table.diff tr.add td { background: var(--add-bg); }
table.diff tr.del td { background: var(--del-bg); }
table.diff tr.hunk td { color: var(--muted); border-top: 1px solid var(--line); }
table.diff tr.note td { color: var(--muted); font-style: italic; }
pre.msg { margin: 0 0 1rem; padding: .6rem .8rem; border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
/* markdown: a README, or a .md file, written by Mdblocks */
article.markdown { overflow-wrap: anywhere; margin-bottom: 1rem; }
article.markdown h1 { font-size: 1.6rem; border-bottom: 1px solid var(--line); }
article.markdown h2 { font-size: 1.3rem; border-bottom: 1px solid var(--line); padding-bottom: .2rem; }
article.markdown h3, article.markdown h4, article.markdown h5, article.markdown h6 { margin: 1.5rem 0 .5rem; font-size: 1.05rem; }
article.markdown img { max-width: 100%; }
article.markdown pre { margin: 1rem 0; padding: .6rem .8rem; overflow-x: auto; border: 1px solid var(--line); font-size: .9rem; }
article.markdown pre code { font-size: inherit; }
article.markdown :not(pre) > code { padding: 0 .25rem; border: 1px solid var(--line); border-radius: 3px; }
article.markdown blockquote { margin: 1rem 0; padding: 0 1rem; border-left: 4px solid var(--line); color: var(--muted); }
article.markdown table { width: auto; margin: 1rem 0; border: 1px solid var(--line); display: block; overflow-x: auto; }
article.markdown th, article.markdown td { padding: .25rem .6rem; border: 1px solid var(--line); text-align: left; }
article.markdown th.r, article.markdown td.r { text-align: right; }
article.markdown th.c, article.markdown td.c { text-align: center; }
article.markdown hr { border: 0; border-top: 1px solid var(--line); }
a.anchor { margin-left: .4rem; opacity: 0; }
h1:hover > a.anchor, h2:hover > a.anchor, h3:hover > a.anchor, h4:hover > a.anchor, h5:hover > a.anchor, h6:hover > a.anchor, a.anchor:focus { opacity: 1; }
details.source { margin-top: 1.5rem; }
details.source summary { cursor: pointer; color: var(--muted); }
/* releases: a version's mark in the log, the latest on the front page, the table of files */
a.release { margin-left: .4rem; padding: 0 .35rem; border: 1px solid var(--good); border-radius: 3px; color: var(--good); font-size: .85rem; }
p.latest { margin: 0 0 1rem; color: var(--muted); }
/* how to clone, on the front page with -u */
p.clone { margin: 0 0 .3rem; color: var(--muted); }
pre.clone { margin: 0 0 1rem; padding: .5rem .8rem; overflow-x: auto; border: 1px solid var(--line); }
td.name { overflow-wrap: anywhere; }
td.sum { font-size: .85rem; overflow-wrap: anywhere; }
td.sum code { font-size: inherit; }
footer { margin-top: 3rem; color: var(--muted); font-size: .85rem; }
/* a narrow screen (doc/ladle.md, On a narrow screen): smaller code and margins, and a row of
   a table in two lines, its first the name (hash and day, name and size, version and day) and
   its second what describes it; the author goes, the commit's page has it */
@media (max-width: 40em) {
  body { padding: 1rem 12px 2rem; }
  h1 { font-size: 1.6rem; }
  nav a { padding: .2rem 0; }    /* a larger thing to touch */
  code, table.code, table.diff { font-size: .75rem; }
  table.code td, table.diff td { padding: 0 .3rem; }
  table.commits, table.files, table.releases,
  table.commits tbody, table.files tbody, table.releases tbody { display: block; }
  table.commits tr, table.files tr, table.releases tr {
    display: grid; grid-template-columns: minmax(0, 1fr) max-content;
    gap: 0 .75rem; padding: .3rem 0; border-bottom: 1px solid var(--line);
  }
  table.commits td, table.files td, table.releases td { padding: 0; border-bottom: 0; min-width: 0; }
  table.commits td.author { display: none; }
  table.commits td.subject, table.files td.sum { grid-column: 1 / -1; }
  table.commits td.date, table.files td.date, table.files td.size,
  table.releases td.date, table.releases td.size { text-align: right; }
  table.files td.subject a { color: var(--muted); }    /* the name is the link that reads as one */
}
