/* Tool courses: reading-first course theme shared with the user's other written courses.
   System fonts only (no third-party requests). */
:root {
  --paper: #fbfaf6; --ink: #1f2622; --muted: #5e6a63; --rule: #dcd8cc;
  --accent: #1f6f5c; --accent-soft: #e5f0ec; --code-bg: #f3f1ea; --nav-bg: #f4f2eb;
  --note: #2f5d8a; --tip: #1f6f5c; --important: #6b3fa0; --warning: #9a6200; --caution: #a33a2c;
  --serif: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #161a18; --ink: #e4e6e1; --muted: #9aa49e; --rule: #2e3531;
    --accent: #6cc2a8; --accent-soft: #1d2b26; --code-bg: #1f2421; --nav-bg: #1b201d;
    --note: #7fb0e0; --tip: #6cc2a8; --important: #b99be0; --warning: #e0b35c; --caution: #e58a7c; }
}
* { box-sizing: border-box; }
html { font-size: 18px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); line-height: 1.65; display: grid; grid-template-columns: 19rem minmax(0, 1fr); }
nav { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--nav-bg); border-right: 1px solid var(--rule); padding: 1.5rem 1.2rem; font-family: var(--sans); font-size: 0.8rem; line-height: 1.45; }
nav .brand { display: block; font-weight: 700; font-size: 1rem; color: var(--ink); text-decoration: none; margin-bottom: 1.2rem; }
nav ol { list-style: none; padding: 0; margin: 0; }
nav > ol > li { margin-bottom: 0.9rem; }
nav > ol > li > a { font-weight: 600; color: var(--ink); text-decoration: none; }
nav ol ol { margin: 0.35rem 0 0 0.7rem; border-left: 1px solid var(--rule); padding-left: 0.7rem; }
nav ol ol a { color: var(--muted); text-decoration: none; display: block; padding: 0.12rem 0; }
nav li.extra a { font-style: italic; }
nav a:hover { color: var(--accent); }
nav a.current { color: var(--accent); font-weight: 600; }
main { max-width: 46rem; padding: 3rem 2.5rem 4rem; }
h1 { font-family: var(--sans); font-size: 2.1rem; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 1.2rem; }
h2 { font-family: var(--sans); font-size: 1.35rem; margin: 2.6rem 0 0.8rem; padding-top: 0.6rem; border-top: 1px solid var(--rule); }
h3 { font-family: var(--sans); font-size: 1.08rem; margin: 1.8rem 0 0.5rem; }
p, li { max-width: 40rem; }
a { color: var(--accent); }
.meta { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); margin: 0 0 0.3rem; }
code { font-family: var(--mono); font-size: 0.82em; background: var(--code-bg); padding: 0.08em 0.3em; border-radius: 3px; }
pre, .hl pre { font-family: var(--mono); font-size: 0.74rem; line-height: 1.5; background: var(--code-bg); padding: 0.9rem 1rem; border-radius: 4px; overflow-x: auto; }
.hl { background: var(--code-bg) !important; border-radius: 4px; margin: 0 0 1.2rem; }
pre code { background: none; padding: 0; font-size: inherit; }
.code-title { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); margin: 1.2rem 0 -0.2rem; }
table { border-collapse: collapse; font-family: var(--sans); font-size: 0.8rem; margin: 1rem 0 1.4rem; display: block; overflow-x: auto; }
th, td { border-bottom: 1px solid var(--rule); padding: 0.45rem 0.7rem; text-align: left; vertical-align: top; }
th { border-bottom: 2px solid var(--ink); }
.callout { border-left: 4px solid var(--c); background: var(--accent-soft); padding: 0.6rem 1rem; margin: 1.4rem 0; border-radius: 0 4px 4px 0; }
.callout > :last-child { margin-bottom: 0; }
.callout-title { font-family: var(--sans); font-weight: 700; font-size: 0.8rem; color: var(--c); margin: 0 0 0.2rem; }
.callout.note { --c: var(--note); } .callout.tip { --c: var(--tip); } .callout.important { --c: var(--important); }
.callout.warning { --c: var(--warning); } .callout.caution { --c: var(--caution); }
details { background: var(--code-bg); border-radius: 4px; padding: 0.5rem 0.9rem; margin: 0.5rem 0; }
summary { cursor: pointer; font-family: var(--sans); font-size: 0.85rem; font-weight: 600; }
.q { border: 1px solid var(--rule); border-radius: 6px; padding: 0.4rem 1.2rem 1rem; margin: 1.2rem 0; }
.q h2 { border: 0; margin-top: 0.6rem; font-size: 1rem; }
.q label { display: block; padding: 0.35rem 0; cursor: pointer; }
.q button { margin-top: 0.6rem; font-family: var(--sans); font-size: 0.85rem; background: var(--accent); color: var(--paper); border: 0; padding: 0.45rem 1.1rem; border-radius: 4px; cursor: pointer; }
.result { margin-top: 0.8rem; padding: 0.6rem 0.8rem; border-radius: 4px; font-size: 0.9rem; }
.result.ok { background: var(--accent-soft); } .result.no { background: color-mix(in srgb, var(--caution) 14%, transparent); }
footer { margin-top: 4rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 0.75rem; color: var(--muted); }
.menu { display: none; }
@media (max-width: 900px) {
  html { font-size: 17px; }
  body { display: block; }
  nav { display: none; position: fixed; inset: 0; z-index: 10; height: 100%; }
  body.nav-open nav { display: block; }
  .menu { display: block; position: fixed; top: 0.6rem; right: 0.6rem; z-index: 11; font-size: 1.2rem; background: var(--nav-bg); color: var(--ink); border: 1px solid var(--rule); border-radius: 4px; padding: 0.2rem 0.6rem; }
  main { padding: 3rem 1.2rem 3rem; }
}

.materials-link { margin-top: 1.4rem; font-weight: 600; }
.materials-link a { color: var(--ink); text-decoration: none; }

/* Tool-course additions: diagrams, two-part lessons, lab pages */
main img { display: block; max-width: 100%; height: auto; margin: 1.6rem auto 0.5rem; border: 1px solid var(--rule); border-radius: 6px; background: #fff; }
main img + em, main p > img + em { display: block; }
h2#theory, h2#practical { display: flex; align-items: baseline; gap: 0.6rem; }
h2#theory::before, h2#practical::before { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--paper); background: var(--accent); padding: 0.15rem 0.5rem; border-radius: 3px; }
h2#theory::before { content: "Part 1"; }
h2#practical::before { content: "Part 2"; background: var(--important); }
nav ul.tools { list-style: none; padding: 0; margin: 0 0 1.4rem; border-bottom: 1px solid var(--rule); padding-bottom: 0.9rem; }
nav ul.tools li { padding: 0.12rem 0; }
nav ul.tools a { color: var(--ink); text-decoration: none; font-weight: 600; }
.download a { display: inline-block; font-family: var(--sans); font-size: 0.85rem; font-weight: 600; background: var(--accent); color: var(--paper); padding: 0.4rem 0.9rem; border-radius: 4px; text-decoration: none; }
.nb-hint { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }
.nb-md { margin: 1.4rem 0 0.4rem; }
.nb-md h1 { font-size: 1.6rem; }
.nb-code .hl { border-left: 3px solid var(--accent); }

/* Code colours, day */
@media not (prefers-color-scheme: dark) {
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
:root:not([data-theme="dark"]) .hl .hll { background-color: #3c3836 }
:root:not([data-theme="dark"]) .hl { background: #fbf1c7; }
:root:not([data-theme="dark"]) .hl .c { color: #928374; font-style: italic } /* Comment */
:root:not([data-theme="dark"]) .hl .err { color: #FBF1C7; background-color: #9D0006 } /* Error */
:root:not([data-theme="dark"]) .hl .k { color: #9D0006 } /* Keyword */
:root:not([data-theme="dark"]) .hl .ch { color: #928374; font-style: italic } /* Comment.Hashbang */
:root:not([data-theme="dark"]) .hl .cm { color: #928374; font-style: italic } /* Comment.Multiline */
:root:not([data-theme="dark"]) .hl .c-PreProc { color: #427B58; font-style: italic } /* Comment.PreProc */
:root:not([data-theme="dark"]) .hl .cp { color: #928374; font-style: italic } /* Comment.Preproc */
:root:not([data-theme="dark"]) .hl .cpf { color: #928374; font-style: italic } /* Comment.PreprocFile */
:root:not([data-theme="dark"]) .hl .c1 { color: #928374; font-style: italic } /* Comment.Single */
:root:not([data-theme="dark"]) .hl .cs { color: #3C3836; font-weight: bold; font-style: italic } /* Comment.Special */
:root:not([data-theme="dark"]) .hl .gd { color: #FBF1C7; background-color: #9D0006 } /* Generic.Deleted */
:root:not([data-theme="dark"]) .hl .ge { font-style: italic } /* Generic.Emph */
:root:not([data-theme="dark"]) .hl .gr { color: #9D0006 } /* Generic.Error */
:root:not([data-theme="dark"]) .hl .gh { color: #3C3836; font-weight: bold } /* Generic.Heading */
:root:not([data-theme="dark"]) .hl .gi { color: #FBF1C7; background-color: #79740E } /* Generic.Inserted */
:root:not([data-theme="dark"]) .hl .go { color: #32302F } /* Generic.Output */
:root:not([data-theme="dark"]) .hl .gp { color: #7C6F64 } /* Generic.Prompt */
:root:not([data-theme="dark"]) .hl .gs { font-weight: bold } /* Generic.Strong */
:root:not([data-theme="dark"]) .hl .gu { color: #3C3836; text-decoration: underline } /* Generic.Subheading */
:root:not([data-theme="dark"]) .hl .gt { color: #9D0006 } /* Generic.Traceback */
:root:not([data-theme="dark"]) .hl .kc { color: #9D0006 } /* Keyword.Constant */
:root:not([data-theme="dark"]) .hl .kd { color: #9D0006 } /* Keyword.Declaration */
:root:not([data-theme="dark"]) .hl .kn { color: #9D0006 } /* Keyword.Namespace */
:root:not([data-theme="dark"]) .hl .kp { color: #9D0006 } /* Keyword.Pseudo */
:root:not([data-theme="dark"]) .hl .kr { color: #9D0006 } /* Keyword.Reserved */
:root:not([data-theme="dark"]) .hl .kt { color: #9D0006 } /* Keyword.Type */
:root:not([data-theme="dark"]) .hl .m { color: #8F3F71 } /* Literal.Number */
:root:not([data-theme="dark"]) .hl .s { color: #79740E } /* Literal.String */
:root:not([data-theme="dark"]) .hl .na { color: #B57614 } /* Name.Attribute */
:root:not([data-theme="dark"]) .hl .nb { color: #AF3A03 } /* Name.Builtin */
:root:not([data-theme="dark"]) .hl .nc { color: #427B58 } /* Name.Class */
:root:not([data-theme="dark"]) .hl .no { color: #8F3F71 } /* Name.Constant */
:root:not([data-theme="dark"]) .hl .nd { color: #9D0006 } /* Name.Decorator */
:root:not([data-theme="dark"]) .hl .ne { color: #9D0006 } /* Name.Exception */
:root:not([data-theme="dark"]) .hl .nf { color: #427B58 } /* Name.Function */
:root:not([data-theme="dark"]) .hl .nn { color: #427B58 } /* Name.Namespace */
:root:not([data-theme="dark"]) .hl .nt { color: #427B58 } /* Name.Tag */
:root:not([data-theme="dark"]) .hl .nv { color: #076678 } /* Name.Variable */
:root:not([data-theme="dark"]) .hl .ow { color: #9D0006 } /* Operator.Word */
:root:not([data-theme="dark"]) .hl .mb { color: #8F3F71 } /* Literal.Number.Bin */
:root:not([data-theme="dark"]) .hl .mf { color: #8F3F71 } /* Literal.Number.Float */
:root:not([data-theme="dark"]) .hl .mh { color: #8F3F71 } /* Literal.Number.Hex */
:root:not([data-theme="dark"]) .hl .mi { color: #8F3F71 } /* Literal.Number.Integer */
:root:not([data-theme="dark"]) .hl .mo { color: #8F3F71 } /* Literal.Number.Oct */
:root:not([data-theme="dark"]) .hl .sa { color: #79740E } /* Literal.String.Affix */
:root:not([data-theme="dark"]) .hl .sb { color: #79740E } /* Literal.String.Backtick */
:root:not([data-theme="dark"]) .hl .sc { color: #79740E } /* Literal.String.Char */
:root:not([data-theme="dark"]) .hl .dl { color: #79740E } /* Literal.String.Delimiter */
:root:not([data-theme="dark"]) .hl .sd { color: #79740E } /* Literal.String.Doc */
:root:not([data-theme="dark"]) .hl .s2 { color: #79740E } /* Literal.String.Double */
:root:not([data-theme="dark"]) .hl .se { color: #AF3A03 } /* Literal.String.Escape */
:root:not([data-theme="dark"]) .hl .sh { color: #79740E } /* Literal.String.Heredoc */
:root:not([data-theme="dark"]) .hl .si { color: #79740E } /* Literal.String.Interpol */
:root:not([data-theme="dark"]) .hl .sx { color: #79740E } /* Literal.String.Other */
:root:not([data-theme="dark"]) .hl .sr { color: #79740E } /* Literal.String.Regex */
:root:not([data-theme="dark"]) .hl .s1 { color: #79740E } /* Literal.String.Single */
:root:not([data-theme="dark"]) .hl .ss { color: #79740E } /* Literal.String.Symbol */
:root:not([data-theme="dark"]) .hl .bp { color: #AF3A03 } /* Name.Builtin.Pseudo */
:root:not([data-theme="dark"]) .hl .fm { color: #427B58 } /* Name.Function.Magic */
:root:not([data-theme="dark"]) .hl .vc { color: #076678 } /* Name.Variable.Class */
:root:not([data-theme="dark"]) .hl .vg { color: #076678 } /* Name.Variable.Global */
:root:not([data-theme="dark"]) .hl .vi { color: #076678 } /* Name.Variable.Instance */
:root:not([data-theme="dark"]) .hl .vm { color: #076678 } /* Name.Variable.Magic */
:root:not([data-theme="dark"]) .hl .il { color: #8F3F71 } /* Literal.Number.Integer.Long */
}
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
:root[data-theme="light"] .hl .hll { background-color: #3c3836 }
:root[data-theme="light"] .hl { background: #fbf1c7; }
:root[data-theme="light"] .hl .c { color: #928374; font-style: italic } /* Comment */
:root[data-theme="light"] .hl .err { color: #FBF1C7; background-color: #9D0006 } /* Error */
:root[data-theme="light"] .hl .k { color: #9D0006 } /* Keyword */
:root[data-theme="light"] .hl .ch { color: #928374; font-style: italic } /* Comment.Hashbang */
:root[data-theme="light"] .hl .cm { color: #928374; font-style: italic } /* Comment.Multiline */
:root[data-theme="light"] .hl .c-PreProc { color: #427B58; font-style: italic } /* Comment.PreProc */
:root[data-theme="light"] .hl .cp { color: #928374; font-style: italic } /* Comment.Preproc */
:root[data-theme="light"] .hl .cpf { color: #928374; font-style: italic } /* Comment.PreprocFile */
:root[data-theme="light"] .hl .c1 { color: #928374; font-style: italic } /* Comment.Single */
:root[data-theme="light"] .hl .cs { color: #3C3836; font-weight: bold; font-style: italic } /* Comment.Special */
:root[data-theme="light"] .hl .gd { color: #FBF1C7; background-color: #9D0006 } /* Generic.Deleted */
:root[data-theme="light"] .hl .ge { font-style: italic } /* Generic.Emph */
:root[data-theme="light"] .hl .gr { color: #9D0006 } /* Generic.Error */
:root[data-theme="light"] .hl .gh { color: #3C3836; font-weight: bold } /* Generic.Heading */
:root[data-theme="light"] .hl .gi { color: #FBF1C7; background-color: #79740E } /* Generic.Inserted */
:root[data-theme="light"] .hl .go { color: #32302F } /* Generic.Output */
:root[data-theme="light"] .hl .gp { color: #7C6F64 } /* Generic.Prompt */
:root[data-theme="light"] .hl .gs { font-weight: bold } /* Generic.Strong */
:root[data-theme="light"] .hl .gu { color: #3C3836; text-decoration: underline } /* Generic.Subheading */
:root[data-theme="light"] .hl .gt { color: #9D0006 } /* Generic.Traceback */
:root[data-theme="light"] .hl .kc { color: #9D0006 } /* Keyword.Constant */
:root[data-theme="light"] .hl .kd { color: #9D0006 } /* Keyword.Declaration */
:root[data-theme="light"] .hl .kn { color: #9D0006 } /* Keyword.Namespace */
:root[data-theme="light"] .hl .kp { color: #9D0006 } /* Keyword.Pseudo */
:root[data-theme="light"] .hl .kr { color: #9D0006 } /* Keyword.Reserved */
:root[data-theme="light"] .hl .kt { color: #9D0006 } /* Keyword.Type */
:root[data-theme="light"] .hl .m { color: #8F3F71 } /* Literal.Number */
:root[data-theme="light"] .hl .s { color: #79740E } /* Literal.String */
:root[data-theme="light"] .hl .na { color: #B57614 } /* Name.Attribute */
:root[data-theme="light"] .hl .nb { color: #AF3A03 } /* Name.Builtin */
:root[data-theme="light"] .hl .nc { color: #427B58 } /* Name.Class */
:root[data-theme="light"] .hl .no { color: #8F3F71 } /* Name.Constant */
:root[data-theme="light"] .hl .nd { color: #9D0006 } /* Name.Decorator */
:root[data-theme="light"] .hl .ne { color: #9D0006 } /* Name.Exception */
:root[data-theme="light"] .hl .nf { color: #427B58 } /* Name.Function */
:root[data-theme="light"] .hl .nn { color: #427B58 } /* Name.Namespace */
:root[data-theme="light"] .hl .nt { color: #427B58 } /* Name.Tag */
:root[data-theme="light"] .hl .nv { color: #076678 } /* Name.Variable */
:root[data-theme="light"] .hl .ow { color: #9D0006 } /* Operator.Word */
:root[data-theme="light"] .hl .mb { color: #8F3F71 } /* Literal.Number.Bin */
:root[data-theme="light"] .hl .mf { color: #8F3F71 } /* Literal.Number.Float */
:root[data-theme="light"] .hl .mh { color: #8F3F71 } /* Literal.Number.Hex */
:root[data-theme="light"] .hl .mi { color: #8F3F71 } /* Literal.Number.Integer */
:root[data-theme="light"] .hl .mo { color: #8F3F71 } /* Literal.Number.Oct */
:root[data-theme="light"] .hl .sa { color: #79740E } /* Literal.String.Affix */
:root[data-theme="light"] .hl .sb { color: #79740E } /* Literal.String.Backtick */
:root[data-theme="light"] .hl .sc { color: #79740E } /* Literal.String.Char */
:root[data-theme="light"] .hl .dl { color: #79740E } /* Literal.String.Delimiter */
:root[data-theme="light"] .hl .sd { color: #79740E } /* Literal.String.Doc */
:root[data-theme="light"] .hl .s2 { color: #79740E } /* Literal.String.Double */
:root[data-theme="light"] .hl .se { color: #AF3A03 } /* Literal.String.Escape */
:root[data-theme="light"] .hl .sh { color: #79740E } /* Literal.String.Heredoc */
:root[data-theme="light"] .hl .si { color: #79740E } /* Literal.String.Interpol */
:root[data-theme="light"] .hl .sx { color: #79740E } /* Literal.String.Other */
:root[data-theme="light"] .hl .sr { color: #79740E } /* Literal.String.Regex */
:root[data-theme="light"] .hl .s1 { color: #79740E } /* Literal.String.Single */
:root[data-theme="light"] .hl .ss { color: #79740E } /* Literal.String.Symbol */
:root[data-theme="light"] .hl .bp { color: #AF3A03 } /* Name.Builtin.Pseudo */
:root[data-theme="light"] .hl .fm { color: #427B58 } /* Name.Function.Magic */
:root[data-theme="light"] .hl .vc { color: #076678 } /* Name.Variable.Class */
:root[data-theme="light"] .hl .vg { color: #076678 } /* Name.Variable.Global */
:root[data-theme="light"] .hl .vi { color: #076678 } /* Name.Variable.Instance */
:root[data-theme="light"] .hl .vm { color: #076678 } /* Name.Variable.Magic */
:root[data-theme="light"] .hl .il { color: #8F3F71 } /* Literal.Number.Integer.Long */
/* Code colours, night */
@media (prefers-color-scheme: dark) {
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
:root:not([data-theme="light"]) .hl .hll { background-color: #ebdbb2 }
:root:not([data-theme="light"]) .hl { background: #282828; color: #DDD }
:root:not([data-theme="light"]) .hl .c { color: #928374; font-style: italic } /* Comment */
:root:not([data-theme="light"]) .hl .err { color: #282828; background-color: #FB4934 } /* Error */
:root:not([data-theme="light"]) .hl .esc { color: #DDD } /* Escape */
:root:not([data-theme="light"]) .hl .g { color: #DDD } /* Generic */
:root:not([data-theme="light"]) .hl .k { color: #FB4934 } /* Keyword */
:root:not([data-theme="light"]) .hl .l { color: #DDD } /* Literal */
:root:not([data-theme="light"]) .hl .n { color: #DDD } /* Name */
:root:not([data-theme="light"]) .hl .o { color: #DDD } /* Operator */
:root:not([data-theme="light"]) .hl .x { color: #DDD } /* Other */
:root:not([data-theme="light"]) .hl .p { color: #DDD } /* Punctuation */
:root:not([data-theme="light"]) .hl .ch { color: #928374; font-style: italic } /* Comment.Hashbang */
:root:not([data-theme="light"]) .hl .cm { color: #928374; font-style: italic } /* Comment.Multiline */
:root:not([data-theme="light"]) .hl .c-PreProc { color: #8EC07C; font-style: italic } /* Comment.PreProc */
:root:not([data-theme="light"]) .hl .cp { color: #928374; font-style: italic } /* Comment.Preproc */
:root:not([data-theme="light"]) .hl .cpf { color: #928374; font-style: italic } /* Comment.PreprocFile */
:root:not([data-theme="light"]) .hl .c1 { color: #928374; font-style: italic } /* Comment.Single */
:root:not([data-theme="light"]) .hl .cs { color: #EBDBB2; font-weight: bold; font-style: italic } /* Comment.Special */
:root:not([data-theme="light"]) .hl .gd { color: #282828; background-color: #FB4934 } /* Generic.Deleted */
:root:not([data-theme="light"]) .hl .ge { color: #DDD; font-style: italic } /* Generic.Emph */
:root:not([data-theme="light"]) .hl .ges { color: #DDD; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
:root:not([data-theme="light"]) .hl .gr { color: #FB4934 } /* Generic.Error */
:root:not([data-theme="light"]) .hl .gh { color: #EBDBB2; font-weight: bold } /* Generic.Heading */
:root:not([data-theme="light"]) .hl .gi { color: #282828; background-color: #B8BB26 } /* Generic.Inserted */
:root:not([data-theme="light"]) .hl .go { color: #F2E5BC } /* Generic.Output */
:root:not([data-theme="light"]) .hl .gp { color: #A89984 } /* Generic.Prompt */
:root:not([data-theme="light"]) .hl .gs { color: #DDD; font-weight: bold } /* Generic.Strong */
:root:not([data-theme="light"]) .hl .gu { color: #EBDBB2; text-decoration: underline } /* Generic.Subheading */
:root:not([data-theme="light"]) .hl .gt { color: #FB4934 } /* Generic.Traceback */
:root:not([data-theme="light"]) .hl .kc { color: #FB4934 } /* Keyword.Constant */
:root:not([data-theme="light"]) .hl .kd { color: #FB4934 } /* Keyword.Declaration */
:root:not([data-theme="light"]) .hl .kn { color: #FB4934 } /* Keyword.Namespace */
:root:not([data-theme="light"]) .hl .kp { color: #FB4934 } /* Keyword.Pseudo */
:root:not([data-theme="light"]) .hl .kr { color: #FB4934 } /* Keyword.Reserved */
:root:not([data-theme="light"]) .hl .kt { color: #FB4934 } /* Keyword.Type */
:root:not([data-theme="light"]) .hl .ld { color: #DDD } /* Literal.Date */
:root:not([data-theme="light"]) .hl .m { color: #D3869B } /* Literal.Number */
:root:not([data-theme="light"]) .hl .s { color: #B8BB26 } /* Literal.String */
:root:not([data-theme="light"]) .hl .na { color: #FABD2F } /* Name.Attribute */
:root:not([data-theme="light"]) .hl .nb { color: #FE8019 } /* Name.Builtin */
:root:not([data-theme="light"]) .hl .nc { color: #8EC07C } /* Name.Class */
:root:not([data-theme="light"]) .hl .no { color: #D3869B } /* Name.Constant */
:root:not([data-theme="light"]) .hl .nd { color: #FB4934 } /* Name.Decorator */
:root:not([data-theme="light"]) .hl .ni { color: #DDD } /* Name.Entity */
:root:not([data-theme="light"]) .hl .ne { color: #FB4934 } /* Name.Exception */
:root:not([data-theme="light"]) .hl .nf { color: #8EC07C } /* Name.Function */
:root:not([data-theme="light"]) .hl .nl { color: #DDD } /* Name.Label */
:root:not([data-theme="light"]) .hl .nn { color: #8EC07C } /* Name.Namespace */
:root:not([data-theme="light"]) .hl .nx { color: #DDD } /* Name.Other */
:root:not([data-theme="light"]) .hl .py { color: #DDD } /* Name.Property */
:root:not([data-theme="light"]) .hl .nt { color: #8EC07C } /* Name.Tag */
:root:not([data-theme="light"]) .hl .nv { color: #83A598 } /* Name.Variable */
:root:not([data-theme="light"]) .hl .ow { color: #FB4934 } /* Operator.Word */
:root:not([data-theme="light"]) .hl .pm { color: #DDD } /* Punctuation.Marker */
:root:not([data-theme="light"]) .hl .w { color: #DDD } /* Text.Whitespace */
:root:not([data-theme="light"]) .hl .mb { color: #D3869B } /* Literal.Number.Bin */
:root:not([data-theme="light"]) .hl .mf { color: #D3869B } /* Literal.Number.Float */
:root:not([data-theme="light"]) .hl .mh { color: #D3869B } /* Literal.Number.Hex */
:root:not([data-theme="light"]) .hl .mi { color: #D3869B } /* Literal.Number.Integer */
:root:not([data-theme="light"]) .hl .mo { color: #D3869B } /* Literal.Number.Oct */
:root:not([data-theme="light"]) .hl .sa { color: #B8BB26 } /* Literal.String.Affix */
:root:not([data-theme="light"]) .hl .sb { color: #B8BB26 } /* Literal.String.Backtick */
:root:not([data-theme="light"]) .hl .sc { color: #B8BB26 } /* Literal.String.Char */
:root:not([data-theme="light"]) .hl .dl { color: #B8BB26 } /* Literal.String.Delimiter */
:root:not([data-theme="light"]) .hl .sd { color: #B8BB26 } /* Literal.String.Doc */
:root:not([data-theme="light"]) .hl .s2 { color: #B8BB26 } /* Literal.String.Double */
:root:not([data-theme="light"]) .hl .se { color: #FE8019 } /* Literal.String.Escape */
:root:not([data-theme="light"]) .hl .sh { color: #B8BB26 } /* Literal.String.Heredoc */
:root:not([data-theme="light"]) .hl .si { color: #B8BB26 } /* Literal.String.Interpol */
:root:not([data-theme="light"]) .hl .sx { color: #B8BB26 } /* Literal.String.Other */
:root:not([data-theme="light"]) .hl .sr { color: #B8BB26 } /* Literal.String.Regex */
:root:not([data-theme="light"]) .hl .s1 { color: #B8BB26 } /* Literal.String.Single */
:root:not([data-theme="light"]) .hl .ss { color: #B8BB26 } /* Literal.String.Symbol */
:root:not([data-theme="light"]) .hl .bp { color: #FE8019 } /* Name.Builtin.Pseudo */
:root:not([data-theme="light"]) .hl .fm { color: #8EC07C } /* Name.Function.Magic */
:root:not([data-theme="light"]) .hl .vc { color: #83A598 } /* Name.Variable.Class */
:root:not([data-theme="light"]) .hl .vg { color: #83A598 } /* Name.Variable.Global */
:root:not([data-theme="light"]) .hl .vi { color: #83A598 } /* Name.Variable.Instance */
:root:not([data-theme="light"]) .hl .vm { color: #83A598 } /* Name.Variable.Magic */
:root:not([data-theme="light"]) .hl .il { color: #D3869B } /* Literal.Number.Integer.Long */
}
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
:root[data-theme="dark"] .hl .hll { background-color: #ebdbb2 }
:root[data-theme="dark"] .hl { background: #282828; color: #DDD }
:root[data-theme="dark"] .hl .c { color: #928374; font-style: italic } /* Comment */
:root[data-theme="dark"] .hl .err { color: #282828; background-color: #FB4934 } /* Error */
:root[data-theme="dark"] .hl .esc { color: #DDD } /* Escape */
:root[data-theme="dark"] .hl .g { color: #DDD } /* Generic */
:root[data-theme="dark"] .hl .k { color: #FB4934 } /* Keyword */
:root[data-theme="dark"] .hl .l { color: #DDD } /* Literal */
:root[data-theme="dark"] .hl .n { color: #DDD } /* Name */
:root[data-theme="dark"] .hl .o { color: #DDD } /* Operator */
:root[data-theme="dark"] .hl .x { color: #DDD } /* Other */
:root[data-theme="dark"] .hl .p { color: #DDD } /* Punctuation */
:root[data-theme="dark"] .hl .ch { color: #928374; font-style: italic } /* Comment.Hashbang */
:root[data-theme="dark"] .hl .cm { color: #928374; font-style: italic } /* Comment.Multiline */
:root[data-theme="dark"] .hl .c-PreProc { color: #8EC07C; font-style: italic } /* Comment.PreProc */
:root[data-theme="dark"] .hl .cp { color: #928374; font-style: italic } /* Comment.Preproc */
:root[data-theme="dark"] .hl .cpf { color: #928374; font-style: italic } /* Comment.PreprocFile */
:root[data-theme="dark"] .hl .c1 { color: #928374; font-style: italic } /* Comment.Single */
:root[data-theme="dark"] .hl .cs { color: #EBDBB2; font-weight: bold; font-style: italic } /* Comment.Special */
:root[data-theme="dark"] .hl .gd { color: #282828; background-color: #FB4934 } /* Generic.Deleted */
:root[data-theme="dark"] .hl .ge { color: #DDD; font-style: italic } /* Generic.Emph */
:root[data-theme="dark"] .hl .ges { color: #DDD; font-weight: bold; font-style: italic } /* Generic.EmphStrong */
:root[data-theme="dark"] .hl .gr { color: #FB4934 } /* Generic.Error */
:root[data-theme="dark"] .hl .gh { color: #EBDBB2; font-weight: bold } /* Generic.Heading */
:root[data-theme="dark"] .hl .gi { color: #282828; background-color: #B8BB26 } /* Generic.Inserted */
:root[data-theme="dark"] .hl .go { color: #F2E5BC } /* Generic.Output */
:root[data-theme="dark"] .hl .gp { color: #A89984 } /* Generic.Prompt */
:root[data-theme="dark"] .hl .gs { color: #DDD; font-weight: bold } /* Generic.Strong */
:root[data-theme="dark"] .hl .gu { color: #EBDBB2; text-decoration: underline } /* Generic.Subheading */
:root[data-theme="dark"] .hl .gt { color: #FB4934 } /* Generic.Traceback */
:root[data-theme="dark"] .hl .kc { color: #FB4934 } /* Keyword.Constant */
:root[data-theme="dark"] .hl .kd { color: #FB4934 } /* Keyword.Declaration */
:root[data-theme="dark"] .hl .kn { color: #FB4934 } /* Keyword.Namespace */
:root[data-theme="dark"] .hl .kp { color: #FB4934 } /* Keyword.Pseudo */
:root[data-theme="dark"] .hl .kr { color: #FB4934 } /* Keyword.Reserved */
:root[data-theme="dark"] .hl .kt { color: #FB4934 } /* Keyword.Type */
:root[data-theme="dark"] .hl .ld { color: #DDD } /* Literal.Date */
:root[data-theme="dark"] .hl .m { color: #D3869B } /* Literal.Number */
:root[data-theme="dark"] .hl .s { color: #B8BB26 } /* Literal.String */
:root[data-theme="dark"] .hl .na { color: #FABD2F } /* Name.Attribute */
:root[data-theme="dark"] .hl .nb { color: #FE8019 } /* Name.Builtin */
:root[data-theme="dark"] .hl .nc { color: #8EC07C } /* Name.Class */
:root[data-theme="dark"] .hl .no { color: #D3869B } /* Name.Constant */
:root[data-theme="dark"] .hl .nd { color: #FB4934 } /* Name.Decorator */
:root[data-theme="dark"] .hl .ni { color: #DDD } /* Name.Entity */
:root[data-theme="dark"] .hl .ne { color: #FB4934 } /* Name.Exception */
:root[data-theme="dark"] .hl .nf { color: #8EC07C } /* Name.Function */
:root[data-theme="dark"] .hl .nl { color: #DDD } /* Name.Label */
:root[data-theme="dark"] .hl .nn { color: #8EC07C } /* Name.Namespace */
:root[data-theme="dark"] .hl .nx { color: #DDD } /* Name.Other */
:root[data-theme="dark"] .hl .py { color: #DDD } /* Name.Property */
:root[data-theme="dark"] .hl .nt { color: #8EC07C } /* Name.Tag */
:root[data-theme="dark"] .hl .nv { color: #83A598 } /* Name.Variable */
:root[data-theme="dark"] .hl .ow { color: #FB4934 } /* Operator.Word */
:root[data-theme="dark"] .hl .pm { color: #DDD } /* Punctuation.Marker */
:root[data-theme="dark"] .hl .w { color: #DDD } /* Text.Whitespace */
:root[data-theme="dark"] .hl .mb { color: #D3869B } /* Literal.Number.Bin */
:root[data-theme="dark"] .hl .mf { color: #D3869B } /* Literal.Number.Float */
:root[data-theme="dark"] .hl .mh { color: #D3869B } /* Literal.Number.Hex */
:root[data-theme="dark"] .hl .mi { color: #D3869B } /* Literal.Number.Integer */
:root[data-theme="dark"] .hl .mo { color: #D3869B } /* Literal.Number.Oct */
:root[data-theme="dark"] .hl .sa { color: #B8BB26 } /* Literal.String.Affix */
:root[data-theme="dark"] .hl .sb { color: #B8BB26 } /* Literal.String.Backtick */
:root[data-theme="dark"] .hl .sc { color: #B8BB26 } /* Literal.String.Char */
:root[data-theme="dark"] .hl .dl { color: #B8BB26 } /* Literal.String.Delimiter */
:root[data-theme="dark"] .hl .sd { color: #B8BB26 } /* Literal.String.Doc */
:root[data-theme="dark"] .hl .s2 { color: #B8BB26 } /* Literal.String.Double */
:root[data-theme="dark"] .hl .se { color: #FE8019 } /* Literal.String.Escape */
:root[data-theme="dark"] .hl .sh { color: #B8BB26 } /* Literal.String.Heredoc */
:root[data-theme="dark"] .hl .si { color: #B8BB26 } /* Literal.String.Interpol */
:root[data-theme="dark"] .hl .sx { color: #B8BB26 } /* Literal.String.Other */
:root[data-theme="dark"] .hl .sr { color: #B8BB26 } /* Literal.String.Regex */
:root[data-theme="dark"] .hl .s1 { color: #B8BB26 } /* Literal.String.Single */
:root[data-theme="dark"] .hl .ss { color: #B8BB26 } /* Literal.String.Symbol */
:root[data-theme="dark"] .hl .bp { color: #FE8019 } /* Name.Builtin.Pseudo */
:root[data-theme="dark"] .hl .fm { color: #8EC07C } /* Name.Function.Magic */
:root[data-theme="dark"] .hl .vc { color: #83A598 } /* Name.Variable.Class */
:root[data-theme="dark"] .hl .vg { color: #83A598 } /* Name.Variable.Global */
:root[data-theme="dark"] .hl .vi { color: #83A598 } /* Name.Variable.Instance */
:root[data-theme="dark"] .hl .vm { color: #83A598 } /* Name.Variable.Magic */
:root[data-theme="dark"] .hl .il { color: #D3869B } /* Literal.Number.Integer.Long */

/* Course theme: "Paper & Lamplight", a reading theme that is easy on the eyes.
   code-light: gruvbox-light   code-dark: gruvbox-dark

   Day: warm cream paper, soft charcoal ink (13:1 contrast, no pure white or black glare).
   Night: warm charcoal, soft parchment text (11:1), low-saturation accents, little blue light.
   Every text colour meets WCAG AA (4.5:1) on its background.
   Follows the reader's system setting by default; theme.js adds a Day / Night / Auto switch
   that sets data-theme on <html>. Appended to course.css by _meta/tools/apply_theme.py after the build. System fonts only. */

/* Day (default) */
:root {
  --paper: #f7f3ea; --ink: #2b2a27; --muted: #625d55; --rule: #e2dac9;
  --accent: #2e6a8e; --accent-soft: #ebe5d8; --code-bg: #efe9dc; --nav-bg: #efe9dc;
  --heading: #23221f; --selection: #d9e6ee; --stripe: #f1ece1; --code-string: #66620b;
  --note: #3b6c8f; --tip: #46703f; --important: #7a5a8f; --warning: #8a6100; --caution: #a2463a;
  --diagram-primary: #ece5d6; --diagram-text: #2b2a27; --diagram-border: #8c8273;
  --diagram-line: #625d55; --diagram-secondary: #e2dac9; --diagram-tertiary: #f2ede2;
  color-scheme: light;
}

/* Night: when the system is dark (unless the reader chose Day), or when the reader chose Night */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1c1b19; --ink: #d8d2c6; --muted: #a39d92; --rule: #34312c;
    --accent: #8fbcd6; --accent-soft: #24231f; --code-bg: #24221f; --nav-bg: #181715;
    --heading: #e6e0d4; --selection: #34465a; --stripe: #201f1c; --code-string: #b8bb26;
    --note: #8fbcd6; --tip: #9cc59a; --important: #c3a6db; --warning: #e0bb6f; --caution: #e39a8c;
    --diagram-primary: #2a2824; --diagram-text: #d8d2c6; --diagram-border: #6f6a60;
    --diagram-line: #a39d92; --diagram-secondary: #262420; --diagram-tertiary: #211f1c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1c1b19; --ink: #d8d2c6; --muted: #a39d92; --rule: #34312c;
  --accent: #8fbcd6; --accent-soft: #24231f; --code-bg: #24221f; --nav-bg: #181715;
  --heading: #e6e0d4; --selection: #34465a; --stripe: #201f1c; --code-string: #b8bb26;
  --note: #8fbcd6; --tip: #9cc59a; --important: #c3a6db; --warning: #e0bb6f; --caution: #e39a8c;
  --diagram-primary: #2a2824; --diagram-text: #d8d2c6; --diagram-border: #6f6a60;
  --diagram-line: #a39d92; --diagram-secondary: #262420; --diagram-tertiary: #211f1c;
  color-scheme: dark;
}

/* Comfortable reading */
body { line-height: 1.72; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
main { max-width: 44rem; }
p, li { max-width: 38rem; }              /* about 65–70 characters per line */
p { margin: 0 0 1.15em; }
li { margin-bottom: 0.3em; }
h1, h2, h3 { color: var(--heading); }
h1 { letter-spacing: -0.015em; }
h2 { border-top-color: var(--rule); }
a { text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--selection); }
code { font-size: 0.85em; }
pre, .hl pre { font-size: 0.78rem; line-height: 1.6; }
table { font-size: 0.82rem; }
tbody tr:nth-child(even) { background: var(--stripe); }
th { border-bottom: 2px solid var(--rule); color: var(--heading); }
.callout { background: color-mix(in srgb, var(--c) 7%, var(--paper)); }
details { border: 1px solid var(--rule); }
.q button { background: var(--accent); color: var(--paper); }
nav a.current { color: var(--accent); }
footer { color: var(--muted); }

/* Code comments carry meaning in this course ("-- Step 1: ..."): keep them readable (5:1+) */
.hl .c, .hl .c1, .hl .cm, .hl .cs, .hl .ch, .hl .cp, .hl .cpf { color: var(--muted) !important; font-style: italic; }
/* SQL strings: gruvbox's day olive is 4.0:1 on our cream code background; use 5.2:1 by day, gruvbox's own 7.7:1 by night */
.hl [class^="s"] { color: var(--code-string, inherit) !important; }

/* Day / Night / Auto switch (added by theme.js) */
.theme-toggle {
  position: fixed; top: 0.7rem; right: 0.9rem; z-index: 12;
  font-family: var(--sans); font-size: 0.78rem; line-height: 1;
  color: var(--ink); background: var(--nav-bg);
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.45rem 0.8rem; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 900px) {
  .theme-toggle { top: 0.6rem; right: 3.6rem; }
}
@media print {
  .theme-toggle, nav, .menu { display: none !important; }
  body { display: block; background: #fff; color: #000; }
}
