:root {
  color-scheme: light dark;
  --text: #1b1b1b;
  --bg: #ffffff;
  --muted: #333333;
  --link: #083d8f;
  --line: #c8c8c8;
  --focus: #083d8f;
  --surface: #f4f4f4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f3f3f3;
    --bg: #121212;
    --muted: #d0d0d0;
    --link: #9ec1ff;
    --line: #3a3a3a;
    --focus: #9ec1ff;
    --surface: #1e1e1e;
  }
}

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

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: anywhere;
}

.wrap {
  width: min(42rem, 100%);
  margin: 0 auto;
  padding: 1rem;
}

header.wrap,
footer.wrap {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.site-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.site-name a {
  color: inherit;
  text-decoration: none;
}

nav ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
}

nav a,
button,
input[type="text"],
input[type="search"],
input[type="submit"] {
  min-height: 44px;
}

nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0;
  color: var(--link);
}

main.wrap :focus-visible,
header.wrap :focus-visible,
footer.wrap :focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.notice {
  background: var(--surface);
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
}

main :is(ul, ol) {
  padding-left: 1.25rem;
}

code {
  font-family: ui-monospace, "Segoe UI Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  padding: 0 0 0.35rem;
}

h1 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 1.5rem 0 0.5rem;
}

p,
li {
  margin: 0.5rem 0;
}

.hint {
  color: var(--muted);
}

footer.wrap {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  color: var(--muted);
}

form.lookup {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
}

label {
  font-weight: 600;
}

input[type="text"],
input[type="search"] {
  width: 100%;
  font: inherit;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
}

button,
input[type="submit"] {
  font: inherit;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 2px solid var(--link);
  background: var(--link);
  color: #ffffff;
  cursor: pointer;
  width: fit-content;
}

@media (prefers-color-scheme: dark) {
  button,
  input[type="submit"] {
    color: #0d1b33;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 40rem) {
  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  tr {
    margin: 0 0 0.75rem;
    padding: 0.5rem;
    background: var(--surface);
  }

  td::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
  }
}

ul.plain {
  padding-left: 1.2rem;
}
