:root {
  --bg: #ffffff;
  --text: #1c2024;
  --muted: #555d66;
  --line: #dde1e5;
  --link: #0b5cad;
  --accent: #1e4f8a;
  --water: #cfe0f3;
  --rail: 0px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c;
    --text: #e8eaed;
    --muted: #a6adb5;
    --line: #2e343b;
    --link: #8cbcf2;
    --accent: #8cbcf2;
    --water: #24476e;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding-left: var(--rail);
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--link); text-underline-offset: 0.15em; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: 0.5rem 0.75rem; }
header, main, footer { max-width: 46rem; margin: 0 auto; padding: 0 1rem; }
header { padding-top: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.header-centre { text-align: center; }
.header-centre .brand { margin: 0; font-size: 1.75rem; line-height: 1.2; }
nav { margin-top: 0.25rem; }
nav a { margin-right: 1rem; }
main { padding-top: 1.5rem; padding-bottom: 2rem; }
h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 0.5rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 0.5rem; }
.meta { color: var(--muted); margin-top: 0; }
p, li { overflow-wrap: anywhere; }
ul, ol { padding-left: 1.4rem; }
li { margin: 0.25rem 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin: 0.5rem 0 1rem; font-size: 0.97rem; }
th, td { text-align: left; vertical-align: top; padding: 0.5rem; border: 1px solid var(--line); }
th { font-weight: 600; }
footer { border-top: 1px solid var(--line); padding-top: 1rem; padding-bottom: 2rem; color: var(--muted); font-size: 0.95rem; }

/* Reading rail (privacy and terms pages): fixed on the left, its level drains from full at the top
   of the page to empty at the end. rail.js sets --level and marks the section in view. Wide screens
   get the rail with section links; narrower screens a 12 px strip with the same level. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
h2[id] { scroll-margin-top: 1rem; }

.rail, .rail-mini { display: none; }

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  border-right: 1px solid var(--line);
  background: var(--bg);
  overflow-y: auto;
}
.rail__fill {
  position: absolute;
  left: 0; bottom: 0;
  width: 12px;
  height: 100%;
  background: var(--water);
  transform-origin: bottom;
  transform: scaleY(var(--level, 1));
}
.rail__marks {
  list-style: none;
  margin: 0;
  padding: 2rem 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.rail__marks a {
  position: relative;
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0.2rem 0.75rem 0.2rem 1.75rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.25;
}
.rail__marks a::before {
  content: "";
  position: absolute;
  left: 12px; top: 0.85em;
  width: 8px;
  border-top: 2px solid var(--text);
}
.rail__marks a:hover .rail__name { text-decoration: underline; }
.rail__no {
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.rail__marks a[aria-current="true"] { color: var(--text); font-weight: 600; }

.rail-mini {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.rail-mini__fill {
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform-origin: bottom;
  transform: scaleY(var(--level, 1));
}

@media screen and (min-width: 1000px) {
  body:has(.rail) { --rail: 11.5rem; }
  .rail { display: block; }
}
@media screen and (max-width: 999.98px) {
  body:has(.rail-mini) { --rail: 12px; }
  .rail-mini { display: block; }
}
@media print {
  .rail, .rail-mini { display: none; }
  body { --rail: 0px; }
}
