:root {
  --fg-color: black;
  --bg-color: white;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  font-family: inherit;
  font-size: inherit;
  font-variant-ligatures: none;
  color: inherit;
  background: inherit;
  border-color: inherit;
  border-radius: 0;
  line-height: inherit;
  touch-action: manipulation;
  appearance: none;
  overscroll-behavior: none;
}

*:focus {
  outline: none;
}

html,
body {
  font-family: sans-serif;
  color: var(--fg-color);
  accent-color: var(--fg-color);
  caret-color: var(--fg-color);
  background: var(--bg-color);
}

body {
  max-width: 100vw;
  padding: 2rem 0.5rem;
  margin: auto;
  /* Fall back on vh units if dvh doesn't work (i.e., not on mobile). */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 1rem;
}

body > :not(.wide) {
  width: 100%;
  max-width: 512px;
  margin: auto;
}

button {
  user-select: none;
  -webkit-user-select: none;
}

ul {
  margin-left: 1em;
}

input[type="checkbox"] {
  appearance: auto;
}

code {
  font-family: monospace, monospace;
  background: #e8e8e8;
  padding: 0 0.25rem;
}

hr {
  width: 100%;
  border: none;
  border-top: 1px solid lightgray;
}

details > summary {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

pre {
  font-family: monospace, monospace;
  overflow: auto;
  white-space: pre;
}

  .buttons.svelte-hesa6 {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(var(--bottom));
    padding: 0.25em 0.5em;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5ch;
    overflow: auto;
  }

  button.svelte-hesa6 {
    aspect-ratio: 1 / 1;
    font-family: monospace, monospace;
    text-align: center;
    padding: 0.25em;
    min-width: 2.5em;
  }

  td.svelte-kdugxr {
    border: 1px solid var(--fg-color);
  }

  td.svelte-kdugxr:has(input:where(.svelte-kdugxr):focus) {
    outline: 1.5px solid var(--fg-color);
  }

  td.svelte-kdugxr > div:where(.svelte-kdugxr) {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    position: relative;
  }

  input.svelte-kdugxr {
    border: none;
    padding: 0.25rem;
    font-family: monospace, monospace;
    border-bottom: 1px dashed lightgray;
  }

  input.svelte-kdugxr:disabled {
    background: #f0f0f0;
  }

  .error.svelte-kdugxr {
    border: 2px solid red;
  }

  .correct.svelte-kdugxr {
    background: #e0ffe0;
  }

  .incorrect.svelte-kdugxr {
    background: #ffe0e0;
  }

  .star.svelte-kdugxr {
    position: absolute;
    top: 0.5rem;
    right: 0.5ch;
    background: none;
    opacity: 0.5;
  }

  .container.svelte-j903p3 {
    max-width: 100%;
    max-height: 100%;
    overflow: auto;
    flex-grow: 1;
  }

  table.svelte-j903p3 {
    border-collapse: collapse;
    width: 100%;
  }

  th.svelte-j903p3 {
    border: 1px solid var(--fg-color);
    background: lightgrey;
    padding: 0.25rem;
  }

  td.svelte-j903p3 {
    border: 1px solid var(--fg-color);
    padding: 0.5rem;
    text-align: center;
    vertical-align: middle;
  }

  .side-by-side.svelte-1n46o8q {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: auto;
    max-width: 100%;
  }

  button.svelte-1n46o8q {
    padding: 0.25rem;
    cursor: pointer;
    white-space: pre;
    min-width: max-content;
  }

  button.svelte-1n46o8q:disabled {
    cursor: not-allowed;
    background: #f0f0f0;
  }

  .button-bar.svelte-1n46o8q {
    width: 100%;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, 1fr);
    align-items: center;
    margin-bottom: 1rem;
  }
