:root {
  --fg: #111111;
  --fg-dim: #454545;
  --bg: #ffffff;
  --muted: #555555;
  --link: #1d4ed8;
  --link-hover: #1e40af;
  --rule: #1d4ed8;
  --border: #e5e5e5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #f1f1f1;
    --fg-dim: #a3a3a3;
    --bg: #0a0a0a;
    --muted: #888888;
    --link: #7dd3fe;
    --link-hover: #93c5fd;
    --rule: #7dd3fe;
    --border: #2a2a2a;
  }
}

html { box-sizing: border-box; }
*, ::before, ::after { box-sizing: inherit; }

body {
  margin: 0;
  padding: 4rem 1rem 5rem;
  max-width: 66ch;
  margin-inline: auto;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 0.95rem + 0.6vw, 1.125rem);
  line-height: 1.65;
  color: var(--fg);
  background-color: var(--bg);
}

main { display: flex; flex-direction: column; gap: 1.75rem; }

h1 {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
  line-height: 1.2;
}

h2 {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

ul {
  margin: 0.25rem 0 0 1.25rem;
  padding: 0;
}

li { margin-bottom: 0.35rem; }

code {
  font-family: ui-monospace, "SF Mono", "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
  font-size: 0.9em;
  background: var(--border);
  color: var(--fg-dim);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover { color: var(--link-hover); }

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

p { margin: 0; }

footer {
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

#agent-directive { line-height: 1.5; }

ol {
  margin: 0.25rem 0 0 1.25rem;
  padding: 0;
}

pre {
  margin: 0.5rem 0 0;
  padding: 0.75rem;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: auto;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
}

@media print {
  body {
    background: #fff;
    color: #000;
    padding: 1in;
  }
  a { color: #000; }
  a[href]:after { content: " (" attr(href) ")"; font-size: 0.9em; }
  h1 { border: none; }
  code { background: none; color: #000; }
  footer { border-top-color: #000; }
}
