body {
  margin: 0;
  background: #f5f7fa;
  color: #172437;
  font: 1rem/1.5 system-ui, sans-serif;
}

main {
  max-width: 38rem;
  margin: 2rem auto;
  padding: 0 1rem;
}

label {
  font-weight: 600;
}

.entry {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .25rem;
}

input, button {
  font: inherit;
}

#description {
  flex: 1 1 12rem;
  min-width: 0;
  padding: .4rem .6rem;
  border: 1px solid #65758a;
  border-radius: .35rem;
}

button {
  padding: .4rem .7rem;
  border: 1px solid #254a71;
  border-radius: .35rem;
  background: #254a71;
  color: white;
  cursor: pointer;
}

#input-error {
  color: #9c2332;
}

#tasks {
  padding: 0;
  list-style: none;
}

#tasks li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: start;
  gap: .5rem;
  margin-block: .6rem;
}

.task-label {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: .5rem;
  cursor: pointer;
}

.task-check, .task-remove {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

.task-check input {
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: #254a71;
  cursor: pointer;
}

.task-description {
  padding-block: .625rem;
  overflow-wrap: anywhere;
}

.task-label:has(input:checked) .task-description {
  text-decoration: line-through;
}

.task-remove {
  padding: 0;
  background: transparent;
  color: #254a71;
}

.task-remove:hover {
  background: #e4ecf5;
}

.task-check input:focus-visible, .task-remove:focus-visible {
  outline: 2px solid #254a71;
  outline-offset: 2px;
}

.trash-icon {
  position: relative;
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 3px 3px;
}

.trash-icon::before, .trash-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: currentColor;
}

.trash-icon::before {
  top: -2px;
  width: 16px;
  height: 2px;
}

.trash-icon::after {
  top: -5px;
  width: 6px;
  height: 3px;
  border-radius: 2px 2px 0 0;
}
