:root {
  color-scheme: light dark;
  --ink: #1b1f24;
  --muted: #4f5761;
  --line: #c9ced6;
  --surface: #fff;
  --page: #f5f6f8;
  --accent: #0b5cad;
  --accent-ink: #fff;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef1f5;
    --muted: #b7bec8;
    --line: #48505b;
    --surface: #1d2228;
    --page: #121519;
    --accent: #8cc4ff;
    --accent-ink: #0b1622;
  }
}

body {
  margin: 0;
}

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

main {
  padding-block-end: 2rem;
}

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

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

.languages {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem 1.25rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

h1 {
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem);
  line-height: 1.2;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;

  & legend {
    font-weight: 600;
    padding: 0 0.25rem;
  }

  & label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.25rem 1rem 0.25rem 0;
    min-height: 2.75rem;
  }
}

input[type='radio'] {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--accent);
}

.field {
  display: grid;
  gap: 0.25rem;
  margin: 0 0 1rem;

  & label {
    font-weight: 600;
  }

  & input {
    font: inherit;
    padding: 0.5rem;
    min-height: 2.75rem;
    border: 1px solid var(--muted);
    border-radius: 0.375rem;
    background: var(--surface);
    color: inherit;
  }
}

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

button,
.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 0.375rem;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;

  &:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;

  & button:not(:first-of-type) {
    background: var(--surface);
    color: var(--accent);
    box-shadow: inset 0 0 0 2px var(--accent);
  }
}

progress {
  width: min(100%, 24rem);
  vertical-align: middle;
}

iframe {
  width: 100%;
  height: 70vh;
  border: 2px solid var(--line);
  border-radius: 0.5rem;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-variant-numeric: tabular-nums;
}

caption {
  text-align: start;
  font-weight: 600;
  padding-block-end: 0.5rem;
}

th,
td {
  padding: 0.4rem 0.6rem;
  border-block-end: 1px solid var(--line);
  text-align: start;
}

.num {
  text-align: end;
}

#results {
  overflow-x: auto;
}

footer {
  color: var(--muted);
  border-block-start: 1px solid var(--line);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
