/* The manual's look: the case view's own board (scripts/art/case_gui_textures.py: green board,
   gold traces, silkscreen white), around plain, readable pages. */
:root {
  --board: #28683a; --board-dark: #225831; --trace: #429254; --gold: #cca64a; --silk: #eaeade;
  --bg: #f6f5ee; --fg: #20241f; --muted: #5d655b; --card: #fff; --rule: #d9d8cb; --code: #ecebe0;
  --link: #1d6b35;
  /* code: comments, keywords, strings, numbers, functions, built-ins */
  --t-com: #66705f; --t-key: #8a5a00; --t-str: #1d6b35; --t-num: #a0402a; --t-fun: #1f5f8b; --t-bi: #5b4aa0;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151a16; --fg: #e4e6dc; --muted: #9aa496; --card: #1c231e; --rule: #2e382f;
          --code: #232c25; --link: #7fcf94;
          --t-com: #8a9886; --t-key: #e0b85a; --t-str: #8fd7a0; --t-num: #f0a07a; --t-fun: #7fb8e8; --t-bi: #b8a4f0; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
       font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--link); }
.top { background: var(--board); border-bottom: 3px solid var(--gold); color: var(--silk);
       display: flex; align-items: baseline; gap: .8rem; padding: .7rem 1rem; }
.top a { color: var(--silk); text-decoration: none; }
.brand { font: 700 1.2rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .04em; }
.tag { color: var(--gold); font: .8rem ui-monospace, Menlo, Consolas, monospace; text-transform: uppercase; }
.gh { margin-left: auto; font-size: .9rem; }
.wrap { display: flex; gap: 2rem; max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; }
.side { flex: 0 0 13rem; font-size: .92rem; }
.side h2 { margin: 1.2rem 0 .3rem; font: .75rem ui-monospace, Menlo, Consolas, monospace;
           text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
           border-bottom: 1px solid var(--rule); }
.side h2:first-child { margin-top: 0; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: block; padding: .15rem .5rem; border-left: 3px solid transparent;
             color: var(--fg); text-decoration: none; }
.side li a:hover { border-left-color: var(--trace); }
.side li.here a { border-left-color: var(--gold); font-weight: 600; }
.page { flex: 1; min-width: 0; }
.page h1 { margin-top: 0; font-size: 2rem; border-bottom: 2px solid var(--rule); padding-bottom: .3rem; }
.page h2 { margin-top: 2rem; border-bottom: 1px solid var(--rule); padding-bottom: .15rem; }
.page img { max-width: 100%; height: auto; border: 1px solid var(--rule); display: block; margin: 1rem 0 .2rem; }
.page img + em { display: block; margin-bottom: 1rem; color: var(--muted); font-size: .9rem; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; }
code { background: var(--code); padding: .1em .3em; border-radius: 3px; }
pre { background: var(--code); padding: .8rem 1rem; border-radius: 4px; overflow-x: auto;
      border-left: 3px solid var(--trace); }
pre code { background: none; padding: 0; }
table { border-collapse: collapse; margin: 1rem 0; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--rule); padding: .35rem .7rem; text-align: left; vertical-align: top; }
th { background: var(--code); }
/* A block's or item's facts, set aside at the page's right, as a datasheet. */
.infobox { float: right; width: 17rem; margin: 0 0 1rem 1.5rem; background: var(--card);
           border: 1px solid var(--rule); border-top: 3px solid var(--gold); padding: .6rem .8rem;
           font-size: .88rem; }
.infobox h3 { margin: 0 0 .4rem; font: .75rem ui-monospace, Menlo, Consolas, monospace;
              text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.infobox table { display: table; margin: 0; width: 100%; }
.infobox th, .infobox td { border: none; border-top: 1px solid var(--rule); padding: .2rem .3rem; background: none; }
.note, .warn, .tip { padding: .6rem 1rem; margin: 1rem 0; border-left: 4px solid; background: var(--card); }
.note { border-color: var(--trace); }
.tip { border-color: var(--gold); }
.warn { border-color: #b3402a; }
.note > :first-child, .tip > :first-child, .warn > :first-child { margin-top: 0; }
.note > :last-child, .tip > :last-child, .warn > :last-child { margin-bottom: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.cards > div { background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--trace);
               padding: .2rem 1rem .6rem; }
.cards h3 { margin: .6rem 0 .2rem; }
.foot { margin-top: 3rem; padding-top: .6rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .85rem; }
@media (max-width: 760px) {
  .wrap { flex-direction: column; gap: 1rem; }
  .side { flex: none; }
  .infobox { float: none; width: auto; margin: 0 0 1rem; }
}

/* Syntax highlighting (rouge's token classes): a Lua block reads as it would in an editor. */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp { color: var(--t-com); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kc, .highlight .kn, .highlight .kr, .highlight .kt,
.highlight .ow { color: var(--t-key); font-weight: 600; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd,
.highlight .se, .highlight .sh, .highlight .si, .highlight .sx { color: var(--t-str); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo, .highlight .il { color: var(--t-num); }
.highlight .nf, .highlight .fm, .highlight .nc { color: var(--t-fun); }
.highlight .nb, .highlight .bp, .highlight .nn { color: var(--t-bi); }
.highlight .err { color: inherit; background: none; }
