:root { --bg: #000; --fg: #aaa; --hi: #fff; --cyan: #5ff; --dim: #888; --yellow: #ff5; --line: #333; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace; }
h1 { color: var(--hi); font-size: 1.5rem; line-height: 1.3; margin: 1rem 0 1rem; }
h2 { color: var(--yellow); font-size: 1.1rem; margin: 2.2rem 0 .6rem; }
h3 { color: var(--hi); font-size: 1rem; margin: 1.6rem 0 .4rem; }
a { color: var(--cyan); }
code, kbd { color: var(--hi); font-family: inherit; }
kbd { border: 1px solid var(--line); border-radius: 3px; padding: 0 .25em; }
pre { overflow-x: auto; border-left: 2px solid var(--line); padding: .25rem 0 .25rem 1rem; color: var(--hi); }
pre.help { color: var(--fg); font-size: .85rem; }
ol, ul { padding-left: 2rem; }
li { margin: .2rem 0; }
.soon { color: var(--dim); }
.soon span { font-size: .85rem; }
table { display: block; overflow-x: auto; border-collapse: collapse; margin: 1rem 0; }
th, td { border-bottom: 1px solid var(--line); padding: .3rem .8rem .3rem 0; text-align: left; vertical-align: top; }
th { color: var(--hi); }
img { max-width: 100%; height: auto; image-rendering: pixelated; vertical-align: top; }
/* A picture of a piece keeps its pixel size; a wide one scrolls rather than blurs. */
a.ans { display: block; width: fit-content; max-width: 100%; overflow-x: auto; margin: .25rem 0; }
a.ans img { max-width: none; outline: 1px solid var(--line); outline-offset: 0; }
details { margin: 1rem 0; }
summary { color: var(--hi); cursor: pointer; }
.checked { color: var(--dim); font-size: .85rem; margin-top: 3rem; border-top: 1px solid var(--line); padding-top: .5rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.bar { color: var(--cyan); white-space: pre; overflow: hidden; margin: 0 0 1.5rem; }

/* Layout: the site menu on the left, the page on the right at a readable measure. */
.page { display: grid; grid-template-columns: 17rem minmax(0, 44rem); gap: 0 2rem; justify-content: center; padding: 0 16px; }
.content { min-width: 0; }
main { padding: 1rem 0 4rem; }
footer { padding: 0 0 2rem; color: var(--dim); font-size: .85rem; }
.side { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 1.25rem 1rem 2rem 0; border-right: 1px solid var(--line); font-size: .9rem; line-height: 1.4; }
.side .home { display: inline-block; color: var(--hi); font-weight: bold; letter-spacing: .08em; text-decoration: none; margin-bottom: .75rem; }
.side details { margin: 0; }
.side summary { color: var(--hi); }
.side .part { margin: 1rem 0 0; }
.side .part-name { display: block; color: var(--fg); text-decoration: none; font-weight: bold; margin-bottom: .3rem; }
.side .here .part-name { color: var(--yellow); }
.side ol { list-style: decimal-leading-zero; margin: 0; padding-left: 2.2rem; }
.side li { margin: .15rem 0; }
.side li::marker { color: var(--dim); }
.side li a { text-decoration: none; }
.side li a:hover, .side .part-name:hover { text-decoration: underline; }
.side [aria-current="page"] { color: var(--hi); background: #00a; padding: 0 .25em; margin-inline: -.25em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.side .home[aria-current="page"], .side .part-name[aria-current="page"] { color: var(--hi); }
/* Beside the page the menu is always open; <details> only folds it on a narrow
   screen. A browser that can't style ::details-content keeps the Menu toggle. */
@supports selector(::details-content) {
  .side details::details-content { content-visibility: visible; }
  .side summary { display: none; }
}

@media (max-width: 50rem) {
  .page { display: block; }
  .side { position: static; max-height: none; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line);
    padding: 1rem 0 .75rem; }
  .side .home { float: left; margin-block: 0; }
  .side summary { display: block; text-align: right; list-style: none; }
  .side summary::-webkit-details-marker { display: none; }
  .side summary::after { content: " ▾"; color: var(--dim); }
  .side details[open] summary::after { content: " ▴"; }
  .side details:not([open])::details-content { content-visibility: hidden; }
  .side .parts { clear: both; padding-top: .25rem; }
}
