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

  * {
    margin: 0;
    padding: 0;
  }

  html,
  body {
    height: 100%;
  }

  body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-width: 100%;
    height: auto;
  }

  input,
  button,
  textarea,
  select {
    font: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    color: currentColor;
  }

  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    overflow-wrap: break-word;
  }

  ol,
  ul {
    list-style: none;
  }
}

body {
  font-family: system-ui;
  letter-spacing: -0.05ch;
  padding: 2rem;
}

.app {
  max-width: 60ch;
  margin: 0 auto;
  border: 1px solid #0002;
  border-radius: 16px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
}

.filters {
  display: flex;
  align-items: center;
  font-size: 0.75em;
}

.filter {
  padding: 4px 8px;
  border-radius: 8px;
}

.filter input[type="radio"] {
  position: absolute;
  visibility: hidden;
}

.filter:has(:checked) {
  background-color: #0002;
}

.todos {
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}

.todo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;

  &:not(:last-child) {
    border-bottom: 1px solid #0002;
  }

  .preview {
    display: block;
    padding: 8px;
  }

  &:has(:checked) .preview {
    text-decoration: line-through;
  }

  .delete {
    margin-left: auto;
    display: grid;
    place-content: center;
    width: 1.5em;
    height: 1.5em;
    border: 0;
    background-color: #0002;
    border-radius: 8px;
  }
}

.submit {
  padding: 16px;
}

input[type="text"] {
  display: block;
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 0;
  box-shadow: inset 0 0 0 1px #0002;
}
