:root {
  color-scheme: light dark;
  --background: #fafafa;
  --foreground: #222;
  --muted: #626262;
  --surface: #fff;
  --border: #d6d6d6;
  font-family: system-ui, sans-serif;
  line-height: 1.6;
  background: var(--background);
  color: var(--foreground);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #111;
    --foreground: #e5e5e5;
    --muted: #aaa;
    --surface: #191919;
    --border: #3a3a3a;
  }
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: clamp(1.25rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

header,
main {
  width: 100%;
  max-width: 42rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

header {
  text-align: center;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  font-size: 0.875rem;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

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

nav a:hover,
nav a[aria-current="page"] {
  color: var(--foreground);
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.25;
  font-weight: 600;
}

h1 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  margin: 1.5rem 0 0.5rem;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0.75rem 0;
}

header p,
label,
dt,
#cid-help,
[role="status"] > p {
  color: var(--muted);
}

section {
  margin-top: 2rem;
}

form {
  display: grid;
  gap: 0.625rem;
}

label,
#cid-help {
  font-size: 0.875rem;
}

input,
select,
button {
  min-width: 0;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  background: var(--surface);
  color: var(--foreground);
  font: inherit;
}

input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  cursor: pointer;
}

.checkbox input {
  width: 1rem;
  height: 1rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--foreground);
}

button {
  cursor: pointer;
  margin-top: 0.25rem;
}

button:hover {
  border-color: var(--muted);
}

button:disabled {
  opacity: 0.5;
  cursor: wait;
}

:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 3px;
}

#search-results ol {
  list-style: none;
  padding: 0;
}

#search-results li {
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
}

article h3 {
  margin-top: 0;
}

img {
  max-width: 100%;
  height: auto;
}

dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.25rem 1rem;
  font-size: 0.875rem;
}

dd {
  margin: 0;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  background: var(--surface);
  font-size: 0.875rem;
}

code {
  font-family: ui-monospace, monospace;
}

ul {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.5rem;
}

@media (max-width: 30rem) {
  dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.125rem;
  }

  dd + dt {
    margin-top: 0.5rem;
  }
}
