:root {
  --ink: #1b2430;
  --muted: #56616f;
  --line: #d5dbe3;
  --paper: #ffffff;
  --wash: #f4f6f9;
  --accent: #0b5cad;
  --warn-bg: #fff6dd;
  --warn-line: #e2c25c;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none;
}

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

header,
main,
footer {
  max-width: 62rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

header {
  padding-bottom: 0;
}

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

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

a {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #f0a500;
  outline-offset: 2px;
}

main {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  margin-top: 1rem;
}

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

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

h3 {
  margin: 1.5rem 0 0.4rem;
  font-size: 1.08rem;
}

.lead {
  font-size: 1.08rem;
  color: var(--muted);
}

form {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

fieldset {
  margin: 0 0 0.75rem;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
  font-weight: 600;
}

label {
  display: block;
  margin: 0.5rem 0 0.2rem;
  font-weight: 600;
}

label.choice {
  display: block;
  margin: 0.3rem 0;
  font-weight: 400;
}

input[type="text"],
select,
textarea {
  width: 100%;
  max-width: 24rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid #8793a1;
  border-radius: 0.3rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

textarea {
  max-width: 100%;
  min-height: 8rem;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

button {
  margin-top: 0.75rem;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 0.3rem;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  background: #8793a1;
  cursor: not-allowed;
}

.message {
  margin: 0.75rem 0;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  margin: 0.75rem 0 0.25rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

caption {
  padding: 0.4rem 0;
  text-align: left;
  font-weight: 700;
}

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

thead th {
  background: var(--wash);
}

tbody th {
  font-weight: 600;
}

.source,
.sources {
  margin: 0.2rem 0;
  color: var(--muted);
  font-size: 0.86rem;
}

ul.sources {
  padding-left: 1.1rem;
}

.note,
.notice {
  margin: 0.75rem 0;
  padding: 0.6rem 0.8rem;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 0.3rem;
  font-size: 0.95rem;
}

dl.result {
  display: grid;
  grid-template-columns: minmax(10rem, max-content) 1fr;
  gap: 0.3rem 1rem;
  margin: 0.75rem 0;
}

dl.result dt {
  font-weight: 600;
}

dl.result dd {
  margin: 0;
}

footer {
  color: var(--muted);
  font-size: 0.9rem;
}

footer .disclaimer {
  color: var(--ink);
  font-weight: 600;
}

.buy-box {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

.buy-box h2 {
  margin-top: 0;
}

.buy-box .disclaimer {
  font-weight: 600;
}

a.buy {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: 0.3rem;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 40rem) {
  h1 {
    font-size: 1.4rem;
  }

  dl.result {
    grid-template-columns: 1fr;
  }
}
