* {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
}

body {
  background: #111827;
  color: #f9fafb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.app {
  padding: 0 0.5rem 2rem;
  margin: 0 auto;
  width: 100%;
  max-width: 512px;
}

@media (min-device-width: 320px) {
  .app {
    padding: 0 1rem;
  }
}

.app-header {
  margin-top: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-title {
  text-align: center;
  font-weight: bold;
  font-size: 36px;
}

.items__empty {
  margin-top: 2.5rem;
  text-align: center;
  color: #EFF6FF;
}

.items__inner:empty .items__empty {
  display: block;
}

.add-item-input {
  display: flex;
  width: 100%;
  align-items: center;
}

.add-item-input__field {
  width: 100%;
  margin-bottom: 16px;
}

.add-item-input__field+.add-item-input__field {
  margin-left: 1rem;
}

.add-item-input__label {
  display: block;
  margin-bottom: 4px;
}

.add-item-input__input {
  width: 100%;
  border: none;
  color: #111827;
  background-color: #F3F4F6cc;
  padding: 0.625rem 1.25rem;
  border-radius: 0.2rem;
  outline-style: none;
}

.add-item-input__input:focus {
  background: white;
}

.items__list {
  display: flex;
  flex-direction: column;
  gap: 5px 0;
}

@media (min-device-width: 320px) {
  .items__list {
    gap: 10px 0;
  }
}

.item-group__title {
  display: flex;
  align-items: center;
  justify-content: center;

  form {
    margin-left: 1rem;
  }
}

@media (min-device-width: 320px) {
  .item-group__title {
    justify-content: space-between;
  }
}

.item {
  display: flex;
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  justify-content: space-between;
  align-items: center;
  border-radius: 0.5rem;
  color: #111827;
  background-color: #E5E7EB;
}

@media (min-device-width: 320px) {
  .item {
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

.item__inner {
  display: flex;
  flex-grow: 1;
  align-items: center;
}

.item__button {
  border: 2px solid #6B7280;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  width: 1.25rem;
  height: 1.25rem;
  color: #ffffff;
  cursor: pointer;
  padding: 0;
}

.item__submit {
  margin-left: 1rem;
  padding: 0 1rem;
  height: 30px;
}

.item__button:hover {
  border-color: #3B82F6;
}

.item--completed .item__button {
  border-color: #3B82F6;
  background-color: #3B82F6;
}

.item__title {
  flex-grow: 1;
  margin-left: 10px;
}

.item__notes {
  font-size: 0.625rem;
}

.item--completed .item__title {
  color: #6B7280;
  text-decoration: line-through;
}

.item__edit {
  color: #6B7280;
  padding: 0;
  border: none;
  cursor: pointer;
  background: transparent;
  display: none;
  margin-left: 1rem;
}

@media (min-device-width: 320px) {
  .item__edit {
    display: block;
  }
}

.item__edit-icon {
  width: 20px;
}

.item__edit:hover {
  color: #111827;
}

.item__checked-icon {
  width: 15px;
  display: none;
}

.item--completed .item__checked-icon {
  display: block;
}

.item_search__wrapper {
  position: relative;
}

.item_search__wrapper .item_history {
  position: absolute;
  top: 100%;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  border-radius: 0.5rem;
}

.item_history .history_result {
  cursor: pointer;
  padding: 0.875rem 1.25rem;
  color: #111827;
  background-color: #E5E7EB;
}

#add-item-top,
#add-item-bottom {
  margin: 1.5rem 0;
  display: none;
}

@media (min-device-width: 320px) {
  #add-item-bottom {
    display: block;
  }
}

@media screen and (min-device-width: 768px) {
  #add-item-top {
    display: block;
  }

  #add-item-bottom {
    display: none;
  }
}
