* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 40px 20px;
  color: #333;
  background-color: #f3f5f7;
  font-family: Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

button,
input {
  font: inherit;
}

.task-app {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 32px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

h1 {
  margin: 0 0 24px;
  text-align: center;
  font-size: 28px;
}

.task-form {
  display: flex;
  gap: 10px;
}

#taskInput {
  flex: 1;
  min-width: 0;
  padding: 12px;
  border: 1px solid #bbb;
  border-radius: 5px;
}

#taskInput:focus {
  border-color: #1976d2;
  outline: 2px solid rgba(25, 118, 210, 0.2);
}

button {
  padding: 10px 16px;
  color: #fff;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

#addButton {
  background-color: #1976d2;
}

#addButton:hover {
  background-color: #125ea8;
}

.task-count {
  margin: 24px 0 14px;
  font-weight: bold;
}

#emptyMessage {
  margin: 24px 0 0;
  color: #777;
  text-align: center;
}

#taskList {
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 12px;
  background-color: #f7f8fa;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.task-text {
  flex: 1;
  overflow-wrap: anywhere;
}

.task-item.completed .task-text {
  color: #888;
  text-decoration: line-through;
}

.complete-button {
  background-color: #2e7d32;
}

.task-item.completed .complete-button {
  background-color: #757575;
}

.delete-button {
  background-color: #d32f2f;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media screen and (max-width: 520px) {
  body {
    padding: 20px 12px;
  }

  .task-app {
    padding: 22px 16px;
  }

  .task-item {
    flex-wrap: wrap;
  }

  .task-text {
    flex-basis: 100%;
  }
}
